diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..6e7ca501d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +**/node_modules +**/typechain +**/tsconfig.build.tsbuildinfo +**/coverage +**/dist \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 10157b19e..13bee2eb7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -52,7 +52,9 @@ jobs: - 'docker/compose-local-dev.overrides.yml' - 'docker/compose-local-dev-traces-v2.overrides.yml' postman: + - 'postman/**' - 'sdk/**' + - 'ts-libs/linea-native-libs/**' - '.github/workflows/postman-*.yml' - '.github/workflows/build-and-publish.yml' - '.github/workflows/main.yml' @@ -193,7 +195,7 @@ jobs: secrets: inherit run-e2e-tests-geth-tracing: - needs: [ store-image-name-and-tags, docker-build, manual-docker-build-and-e2e-tests ] + needs: [ store-image-name-and-tags, docker-build, manual-docker-build-and-e2e-tests, filter-commit-changes ] # Make this execute for has-changes-requiring-build == 'false' so that we can get to the required job @ which is in reuse-run-e2e-tests.yml if: ${{ always() && needs.filter-commit-changes.outputs.has-changes-requiring-build == 'false' || needs.docker-build.result == 'success' }} concurrency: diff --git a/.github/workflows/postman-build-and-publish.yml b/.github/workflows/postman-build-and-publish.yml index 881df1730..698aec842 100644 --- a/.github/workflows/postman-build-and-publish.yml +++ b/.github/workflows/postman-build-and-publish.yml @@ -93,7 +93,7 @@ jobs: if: ${{ env.PUSH_IMAGE == 'false' }} with: context: ./ - file: ./sdk/Dockerfile + file: ./postman/Dockerfile platforms: linux/amd64 load: true push: false @@ -116,7 +116,7 @@ jobs: if: ${{ env.PUSH_IMAGE == 'true' || github.event_name == 'workflow_dispatch' }} with: context: ./ - file: ./sdk/Dockerfile + file: ./postman/Dockerfile platforms: linux/amd64,linux/arm64 push: true tags: ${{ env.TAGS }} diff --git a/.github/workflows/postman-testing.yml b/.github/workflows/postman-testing.yml index 411083146..a00aa9db8 100644 --- a/.github/workflows/postman-testing.yml +++ b/.github/workflows/postman-testing.yml @@ -24,4 +24,5 @@ jobs: run: | pnpm run -F ./ts-libs/linea-native-libs build; pnpm run -F ./sdk build; + pnpm run -F ./postman test; pnpm run -F ./sdk test; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0d0ef6247..7d696aa53 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -43,7 +43,7 @@ importers: dependencies: '@consensys/linea-sdk': specifier: 0.3.0 - version: 0.3.0(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(utf-8-validate@5.0.10) + version: 0.3.0(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(utf-8-validate@5.0.10) '@headlessui/react': specifier: 2.1.9 version: 2.1.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -131,7 +131,7 @@ importers: version: 8.1.0(typescript@5.4.5) '@synthetixio/synpress': specifier: 4.0.0-alpha.7 - version: 4.0.0-alpha.7(@playwright/test@1.45.3)(bufferutil@4.0.8)(playwright-core@1.45.3)(postcss@8.4.47)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4) + version: 4.0.0-alpha.7(@playwright/test@1.45.3)(bufferutil@4.0.8)(playwright-core@1.45.3)(postcss@8.4.47)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4) '@types/fs-extra': specifier: 11.0.4 version: 11.0.4 @@ -155,41 +155,41 @@ importers: version: 14.2.15(eslint@8.57.0)(typescript@5.4.5) eslint-plugin-tailwindcss: specifier: 3.17.4 - version: 3.17.4(tailwindcss@3.4.13(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))) + version: 3.17.4(tailwindcss@3.4.13(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))) postcss: specifier: 8.4.47 version: 8.4.47 tailwind-scrollbar: specifier: 3.1.0 - version: 3.1.0(tailwindcss@3.4.13(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))) + version: 3.1.0(tailwindcss@3.4.13(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))) tailwindcss: specifier: 3.4.13 - version: 3.4.13(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)) + version: 3.4.13(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)) contracts: dependencies: solidity-docgen: specifier: 0.6.0-beta.36 - version: 0.6.0-beta.36(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) + version: 0.6.0-beta.36(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) devDependencies: '@ethereumjs/util': specifier: 9.0.3 version: 9.0.3 '@nomicfoundation/hardhat-ethers': specifier: 3.0.5 - version: 3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) + version: 3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) '@nomicfoundation/hardhat-foundry': specifier: 1.1.3 - version: 1.1.3(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) + version: 1.1.3(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) '@nomicfoundation/hardhat-network-helpers': specifier: 1.0.10 - version: 1.0.10(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) + version: 1.0.10(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) '@nomicfoundation/hardhat-toolbox': specifier: 4.0.0 - version: 4.0.0(zgfjqfwfiondltx7mdbaovzgze) + version: 4.0.0(jj5kk3vargw6r5zphvcd7xwb3m) '@nomicfoundation/hardhat-verify': specifier: 1.1.1 - version: 1.1.1(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) + version: 1.1.1(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) '@openzeppelin/contracts': specifier: 4.9.6 version: 4.9.6 @@ -198,7 +198,7 @@ importers: version: 4.9.6 '@openzeppelin/hardhat-upgrades': specifier: 2.5.1 - version: 2.5.1(@nomicfoundation/hardhat-ethers@3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(@nomicfoundation/hardhat-verify@1.1.1(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(bufferutil@4.0.8)(encoding@0.1.13)(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10) + version: 2.5.1(@nomicfoundation/hardhat-ethers@3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(@nomicfoundation/hardhat-verify@1.1.1(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(bufferutil@4.0.8)(encoding@0.1.13)(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10) '@safe-global/protocol-kit': specifier: 3.0.2 version: 3.0.2(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) @@ -207,7 +207,7 @@ importers: version: 4.0.2(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) '@typechain/hardhat': specifier: 9.1.0 - version: 9.1.0(@typechain/ethers-v6@0.5.1(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))(typescript@5.4.5))(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5)) + version: 9.1.0(@typechain/ethers-v6@0.5.1(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))(typescript@5.4.5))(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5)) '@types/diff': specifier: 5.2.0 version: 5.2.0 @@ -237,16 +237,16 @@ importers: version: 6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) hardhat: specifier: 2.22.11 - version: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) + version: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) hardhat-deploy: specifier: 0.12.4 version: 0.12.4(bufferutil@4.0.8)(utf-8-validate@5.0.10) hardhat-storage-layout: specifier: 0.1.7 - version: 0.1.7(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) + version: 0.1.7(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) hardhat-tracer: specifier: 2.8.2 - version: 2.8.2(bufferutil@4.0.8)(chai@4.1.1)(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10) + version: 2.8.2(bufferutil@4.0.8)(chai@4.1.1)(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10) node-gyp: specifier: 10.1.0 version: 10.1.0 @@ -325,25 +325,28 @@ importers: version: 29.5.13 jest: specifier: 29.7.0 - version: 29.7.0(@types/node@20.12.7)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)) + version: 29.7.0(@types/node@22.7.5)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)) jest-mock-extended: specifier: 3.0.5 - version: 3.0.5(jest@29.7.0(@types/node@20.12.7)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)))(typescript@5.4.5) + version: 3.0.5(jest@29.7.0(@types/node@22.7.5)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)))(typescript@5.4.5) shx: specifier: 0.3.4 version: 0.3.4 ts-jest: specifier: 29.2.5 - version: 29.2.5(@babel/core@7.25.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.7))(jest@29.7.0(@types/node@20.12.7)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)))(typescript@5.4.5) + version: 29.2.5(@babel/core@7.25.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.7))(jest@29.7.0(@types/node@22.7.5)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)))(typescript@5.4.5) - sdk: + postman: dependencies: '@consensys/linea-native-libs': specifier: workspace:* version: link:../ts-libs/linea-native-libs + '@consensys/linea-sdk': + specifier: workspace:* + version: link:../sdk better-sqlite3: - specifier: 9.6.0 - version: 9.6.0 + specifier: 11.6.0 + version: 11.6.0 class-validator: specifier: 0.14.1 version: 0.14.1 @@ -351,51 +354,73 @@ importers: specifier: 16.4.5 version: 16.4.5 ethers: - specifier: 6.12.0 - version: 6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) - lru-cache: - specifier: 10.2.2 - version: 10.2.2 + specifier: 6.13.4 + version: 6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10) pg: - specifier: 8.11.3 - version: 8.11.3 + specifier: 8.13.1 + version: 8.13.1 typeorm: specifier: 0.3.20 - version: 0.3.20(better-sqlite3@9.6.0)(pg@8.11.3)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)) + version: 0.3.20(better-sqlite3@11.6.0)(pg@8.13.1)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)) typeorm-naming-strategies: specifier: 4.1.0 - version: 4.1.0(typeorm@0.3.20(better-sqlite3@9.6.0)(pg@8.11.3)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))) + version: 4.1.0(typeorm@0.3.20(better-sqlite3@11.6.0)(pg@8.13.1)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))) winston: - specifier: 3.13.0 - version: 3.13.0 + specifier: 3.17.0 + version: 3.17.0 + devDependencies: + '@jest/globals': + specifier: 29.7.0 + version: 29.7.0 + '@types/jest': + specifier: 29.5.14 + version: 29.5.14 + '@types/yargs': + specifier: 17.0.33 + version: 17.0.33 + jest: + specifier: 29.7.0 + version: 29.7.0(@types/node@22.7.5)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)) + jest-mock-extended: + specifier: 3.0.5 + version: 3.0.5(jest@29.7.0(@types/node@22.7.5)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)))(typescript@5.4.5) + ts-jest: + specifier: 29.2.5 + version: 29.2.5(@babel/core@7.25.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.7))(jest@29.7.0(@types/node@22.7.5)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)))(typescript@5.4.5) + yargs: + specifier: 17.7.2 + version: 17.7.2 + + sdk: + dependencies: + ethers: + specifier: 6.13.4 + version: 6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10) + lru-cache: + specifier: 11.0.2 + version: 11.0.2 devDependencies: '@jest/globals': specifier: 29.7.0 version: 29.7.0 '@typechain/ethers-v6': specifier: 0.5.1 - version: 0.5.1(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))(typescript@5.4.5) + version: 0.5.1(ethers@6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))(typescript@5.4.5) '@types/jest': - specifier: 29.5.12 - version: 29.5.12 - '@types/yargs': - specifier: 17.0.32 - version: 17.0.32 + specifier: 29.5.14 + version: 29.5.14 jest: specifier: 29.7.0 - version: 29.7.0(@types/node@20.12.7)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)) + version: 29.7.0(@types/node@22.7.5)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)) jest-mock-extended: specifier: 3.0.5 - version: 3.0.5(jest@29.7.0(@types/node@20.12.7)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)))(typescript@5.4.5) + version: 3.0.5(jest@29.7.0(@types/node@22.7.5)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)))(typescript@5.4.5) ts-jest: - specifier: 29.1.2 - version: 29.1.2(@babel/core@7.25.7)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.7))(jest@29.7.0(@types/node@20.12.7)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)))(typescript@5.4.5) + specifier: 29.2.5 + version: 29.2.5(@babel/core@7.25.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.7))(jest@29.7.0(@types/node@22.7.5)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)))(typescript@5.4.5) typechain: specifier: 8.3.2 version: 8.3.2(typescript@5.4.5) - yargs: - specifier: 17.7.2 - version: 17.7.2 ts-libs/linea-native-libs: dependencies: @@ -432,7 +457,7 @@ importers: version: 6.13.3(bufferutil@4.0.8)(utf-8-validate@5.0.10) jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@20.12.7)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)) + version: 29.7.0(@types/node@22.7.5)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)) jest-it-up: specifier: ^3.1.0 version: 3.2.0 @@ -441,7 +466,7 @@ importers: version: 3.3.2 ts-jest: specifier: ^29.1.5 - version: 29.2.5(@babel/core@7.25.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.7))(jest@29.7.0(@types/node@20.12.7)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)))(typescript@5.4.5) + version: 29.2.5(@babel/core@7.25.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.7))(jest@29.7.0(@types/node@22.7.5)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)))(typescript@5.4.5) unzipper: specifier: ^0.12.1 version: 0.12.3 @@ -569,10 +594,6 @@ packages: resolution: {integrity: sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.25.7': - resolution: {integrity: sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==} - engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.25.9': resolution: {integrity: sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==} engines: {node: '>=6.9.0'} @@ -3094,12 +3115,12 @@ packages: '@types/istanbul-reports@3.0.4': resolution: {integrity: sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==} - '@types/jest@29.5.12': - resolution: {integrity: sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==} - '@types/jest@29.5.13': resolution: {integrity: sha512-wd+MVEZCHt23V0/L642O5APvspWply/rGY5BcW4SUETo2UzPU3Z26qr8jC2qxpimI2jjx9h7+2cj2FwIr01bXg==} + '@types/jest@29.5.14': + resolution: {integrity: sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==} + '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} @@ -3139,6 +3160,9 @@ packages: '@types/node@20.12.7': resolution: {integrity: sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==} + '@types/node@22.7.5': + resolution: {integrity: sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==} + '@types/node@8.10.66': resolution: {integrity: sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw==} @@ -3205,6 +3229,9 @@ packages: '@types/yargs@17.0.32': resolution: {integrity: sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==} + '@types/yargs@17.0.33': + resolution: {integrity: sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==} + '@typescript-eslint/eslint-plugin@7.6.0': resolution: {integrity: sha512-gKmTNwZnblUdnTIJu3e9kmeRRzV2j1a/LUO27KNNAnIC5zjy1aSvXSRp4rVNlmAoHlQ7HzX42NbKpcSr4jF80A==} engines: {node: ^18.18.0 || >=20.0.0} @@ -3835,6 +3862,9 @@ packages: bech32@1.1.4: resolution: {integrity: sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==} + better-sqlite3@11.6.0: + resolution: {integrity: sha512-2J6k/eVxcFYY2SsTxsXrj6XylzHWPxveCn4fKPKZFv/Vqn/Cd7lOuX4d7rGQXT5zL+97MkNL3nSbCrIoe3LkgA==} + better-sqlite3@9.6.0: resolution: {integrity: sha512-yR5HATnqeYNVnkaUTf4bOP2dJSnyhP4puJN/QPRyx4YkBEEUxib422n2XzPqDEHjQQqazoYoADdAm5vE15+dAQ==} @@ -5133,6 +5163,10 @@ packages: resolution: {integrity: sha512-/DzbZOLVtoO4fKvvQwpEucHAQgIwBGWuRvBdwE/lMXgXvvHHTSkn7XqAQ2b+gjJzZDJjWA9OD05bVceVOsBHbg==} engines: {node: '>=14.0.0'} + ethers@6.13.4: + resolution: {integrity: sha512-21YtnZVg4/zKkCQPjrDj38B1r4nQvTZLopUGMLQ1ePU2zV/joCfDC3t3iKQjWRzjjjbzR+mdAIoikeBRNkdllA==} + engines: {node: '>=14.0.0'} + ethjs-unit@0.1.6: resolution: {integrity: sha512-/Sn9Y0oKl0uqQuvgFk/zQgR7aw1g36qX/jzSQ5lSwlO0GigPymk4eGQfeNTD03w1dPOqfz8V77Cy43jH56pagw==} engines: {node: '>=6.5.0', npm: '>=3'} @@ -6611,6 +6645,10 @@ packages: resolution: {integrity: sha512-CdaO738xRapbKIMVn2m4F6KTj4j7ooJ8POVnebSgKo3KBz5axNXRAL7ZdRjIV6NOr2Uf4vjtRkxrFETOioCqSA==} engines: {node: '>= 12.0.0'} + logform@2.7.0: + resolution: {integrity: sha512-TFYA4jnP7PVbmlBIfhlSe+WKxs9dklXMTEGcBCIvLhE/Tn3H6Gk1norupVW7m5Cnd4bLcr08AytbyV/xj7f/kQ==} + engines: {node: '>= 12.0.0'} + logkitty@0.7.1: resolution: {integrity: sha512-/3ER20CTTbahrCrpYfPn7Xavv9diBROZpoXGVZDWMw4b/X4uuUwAC0ki85tgsdMRONURyIJbcOvS94QsUBYPbQ==} hasBin: true @@ -6641,6 +6679,10 @@ packages: lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} + lru-cache@11.0.2: + resolution: {integrity: sha512-123qHRfJBmo2jXDbo/a5YOQrJoHF/GNQTLzQ5+IdK5pWpceK17yRc6ozlWd25FxvGKQbIUs91fDFkXmDHTKcyA==} + engines: {node: 20 || >=22} + lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} @@ -7519,12 +7561,24 @@ packages: pg-native: optional: true + pg@8.13.1: + resolution: {integrity: sha512-OUir1A0rPNZlX//c7ksiu7crsGZTKSOXJPgtNiHGIlC9H0lO+NC6ZDYksSgBYY/thSWhnSRBv8w1lieNNGATNQ==} + engines: {node: '>= 8.0.0'} + peerDependencies: + pg-native: '>=3.0.1' + peerDependenciesMeta: + pg-native: + optional: true + pgpass@1.0.5: resolution: {integrity: sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==} picocolors@1.1.0: resolution: {integrity: sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==} + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} @@ -8786,27 +8840,6 @@ packages: ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} - ts-jest@29.1.2: - resolution: {integrity: sha512-br6GJoH/WUX4pu7FbZXuWGKGNDuU7b8Uj77g/Sp7puZV6EXzuByl6JrECvm0MzVzSTkSHWTihsXt+5XYER5b+g==} - engines: {node: ^16.10.0 || ^18.0.0 || >=20.0.0} - hasBin: true - peerDependencies: - '@babel/core': '>=7.0.0-beta.0 <8' - '@jest/types': ^29.0.0 - babel-jest: ^29.0.0 - esbuild: '*' - jest: ^29.0.0 - typescript: '>=4.3 <6' - peerDependenciesMeta: - '@babel/core': - optional: true - '@jest/types': - optional: true - babel-jest: - optional: true - esbuild: - optional: true - ts-jest@29.2.5: resolution: {integrity: sha512-KD8zB2aAZrcKIdGk4OwpJggeLcH1FgrICqDSROWqlnJXGCXK4Mn6FcdK2B6670Xr73lHMG1kHw8R87A0ecZ+vA==} engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0} @@ -9060,6 +9093,9 @@ packages: undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + undici-types@6.19.8: + resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} + undici@5.28.4: resolution: {integrity: sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==} engines: {node: '>=14.0'} @@ -9440,10 +9476,18 @@ packages: resolution: {integrity: sha512-qxSTKswC6llEMZKgCQdaWgDuMJQnhuvF5f2Nk3SNXc4byfQ+voo2mX1Px9dkNOuR8p0KAjfPG29PuYUSIb+vSA==} engines: {node: '>= 12.0.0'} + winston-transport@4.9.0: + resolution: {integrity: sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A==} + engines: {node: '>= 12.0.0'} + winston@3.13.0: resolution: {integrity: sha512-rwidmA1w3SE4j0E5MuIufFhyJPBDG7Nu71RkZor1p2+qHvJSZ9GYDA81AyleQcZbh/+V6HjeBdfnTZJm9rSeQQ==} engines: {node: '>= 12.0.0'} + winston@3.17.0: + resolution: {integrity: sha512-DLiFIXYC5fMPxaRg832S6F5mJYvePtmO5G9v9IgUFPhXm9/GkXarH/TUrBAVzhTCzAj9anE/+GjrgXp/54nOgw==} + engines: {node: '>= 12.0.0'} + word-wrap@1.2.5: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} @@ -9732,7 +9776,7 @@ snapshots: '@babel/code-frame@7.25.7': dependencies: '@babel/highlight': 7.25.9 - picocolors: 1.1.0 + picocolors: 1.1.1 '@babel/compat-data@7.25.7': {} @@ -9877,8 +9921,6 @@ snapshots: '@babel/helper-string-parser@7.25.9': {} - '@babel/helper-validator-identifier@7.25.7': {} - '@babel/helper-validator-identifier@7.25.9': {} '@babel/helper-validator-option@7.25.7': {} @@ -9901,7 +9943,7 @@ snapshots: '@babel/helper-validator-identifier': 7.25.9 chalk: 2.4.2 js-tokens: 4.0.0 - picocolors: 1.1.0 + picocolors: 1.1.1 '@babel/parser@7.25.7': dependencies: @@ -10653,7 +10695,7 @@ snapshots: '@babel/types@7.25.7': dependencies: '@babel/helper-string-parser': 7.25.9 - '@babel/helper-validator-identifier': 7.25.7 + '@babel/helper-validator-identifier': 7.25.9 to-fast-properties: 2.0.0 '@bcoe/v8-coverage@0.2.3': {} @@ -10683,16 +10725,16 @@ snapshots: '@colors/colors@1.6.0': {} - '@consensys/linea-sdk@0.3.0(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(utf-8-validate@5.0.10)': + '@consensys/linea-sdk@0.3.0(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(utf-8-validate@5.0.10)': dependencies: better-sqlite3: 9.6.0 class-validator: 0.14.1 dotenv: 16.4.5 - ethers: 6.13.3(bufferutil@4.0.8)(utf-8-validate@5.0.10) + ethers: 6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10) lru-cache: 10.2.2 pg: 8.11.3 - typeorm: 0.3.20(better-sqlite3@9.6.0)(pg@8.11.3)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)) - typeorm-naming-strategies: 4.1.0(typeorm@0.3.20(better-sqlite3@9.6.0)(pg@8.11.3)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))) + typeorm: 0.3.20(better-sqlite3@9.6.0)(pg@8.11.3)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)) + typeorm-naming-strategies: 4.1.0(typeorm@0.3.20(better-sqlite3@9.6.0)(pg@8.11.3)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))) winston: 3.13.0 transitivePeerDependencies: - '@google-cloud/spanner' @@ -11391,6 +11433,41 @@ snapshots: - supports-color - ts-node + '@jest/core@29.7.0(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))': + dependencies: + '@jest/console': 29.7.0 + '@jest/reporters': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 20.12.7 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + ci-info: 3.9.0 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-changed-files: 29.7.0 + jest-config: 29.7.0(@types/node@20.12.7)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)) + jest-haste-map: 29.7.0 + jest-message-util: 29.7.0 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-resolve-dependencies: 29.7.0 + jest-runner: 29.7.0 + jest-runtime: 29.7.0 + jest-snapshot: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + jest-watcher: 29.7.0 + micromatch: 4.0.8 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-ansi: 6.0.1 + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + - ts-node + '@jest/create-cache-key-function@29.7.0': dependencies: '@jest/types': 29.6.3 @@ -11518,7 +11595,7 @@ snapshots: '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 '@types/node': 20.12.7 - '@types/yargs': 17.0.32 + '@types/yargs': 17.0.33 chalk: 4.1.2 '@jridgewell/gen-mapping@0.3.5': @@ -11898,64 +11975,64 @@ snapshots: optionalDependencies: c-kzg: 2.1.2 - '@nomicfoundation/hardhat-chai-matchers@2.0.8(@nomicfoundation/hardhat-ethers@3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(chai@4.1.1)(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))': + '@nomicfoundation/hardhat-chai-matchers@2.0.8(@nomicfoundation/hardhat-ethers@3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(chai@4.1.1)(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))': dependencies: - '@nomicfoundation/hardhat-ethers': 3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) + '@nomicfoundation/hardhat-ethers': 3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) '@types/chai-as-promised': 7.1.8 chai: 4.1.1 chai-as-promised: 7.1.2(chai@4.1.1) deep-eql: 4.1.4 ethers: 6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) - hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) + hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) ordinal: 1.0.3 - '@nomicfoundation/hardhat-ethers@3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))': + '@nomicfoundation/hardhat-ethers@3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))': dependencies: debug: 4.3.7(supports-color@8.1.1) ethers: 6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) - hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) + hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) lodash.isequal: 4.5.0 transitivePeerDependencies: - supports-color - '@nomicfoundation/hardhat-foundry@1.1.3(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))': + '@nomicfoundation/hardhat-foundry@1.1.3(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))': dependencies: - hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) + hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) picocolors: 1.1.0 - '@nomicfoundation/hardhat-network-helpers@1.0.10(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))': + '@nomicfoundation/hardhat-network-helpers@1.0.10(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))': dependencies: ethereumjs-util: 7.1.5 - hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) + hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) - '@nomicfoundation/hardhat-toolbox@4.0.0(zgfjqfwfiondltx7mdbaovzgze)': + '@nomicfoundation/hardhat-toolbox@4.0.0(jj5kk3vargw6r5zphvcd7xwb3m)': dependencies: - '@nomicfoundation/hardhat-chai-matchers': 2.0.8(@nomicfoundation/hardhat-ethers@3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(chai@4.1.1)(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) - '@nomicfoundation/hardhat-ethers': 3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) - '@nomicfoundation/hardhat-network-helpers': 1.0.10(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) - '@nomicfoundation/hardhat-verify': 1.1.1(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) + '@nomicfoundation/hardhat-chai-matchers': 2.0.8(@nomicfoundation/hardhat-ethers@3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(chai@4.1.1)(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) + '@nomicfoundation/hardhat-ethers': 3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) + '@nomicfoundation/hardhat-network-helpers': 1.0.10(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) + '@nomicfoundation/hardhat-verify': 1.1.1(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) '@typechain/ethers-v6': 0.5.1(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))(typescript@5.4.5) - '@typechain/hardhat': 9.1.0(@typechain/ethers-v6@0.5.1(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))(typescript@5.4.5))(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5)) + '@typechain/hardhat': 9.1.0(@typechain/ethers-v6@0.5.1(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))(typescript@5.4.5))(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5)) '@types/chai': 4.3.20 '@types/mocha': 10.0.9 - '@types/node': 20.12.7 + '@types/node': 22.7.5 chai: 4.1.1 ethers: 6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) - hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) - hardhat-gas-reporter: 1.0.10(bufferutil@4.0.8)(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10) - solidity-coverage: 0.8.13(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) - ts-node: 10.9.2(@types/node@20.12.7)(typescript@5.4.5) + hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) + hardhat-gas-reporter: 1.0.10(bufferutil@4.0.8)(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10) + solidity-coverage: 0.8.13(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) + ts-node: 10.9.2(@types/node@22.7.5)(typescript@5.4.5) typechain: 8.3.2(typescript@5.4.5) typescript: 5.4.5 - '@nomicfoundation/hardhat-verify@1.1.1(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))': + '@nomicfoundation/hardhat-verify@1.1.1(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))': dependencies: '@ethersproject/abi': 5.7.0 '@ethersproject/address': 5.7.0 cbor: 8.1.0 chalk: 2.4.2 debug: 4.3.7(supports-color@8.1.1) - hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) + hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) lodash.clonedeep: 4.5.0 semver: 6.3.1 table: 6.8.2 @@ -12101,9 +12178,9 @@ snapshots: - debug - encoding - '@openzeppelin/hardhat-upgrades@2.5.1(@nomicfoundation/hardhat-ethers@3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(@nomicfoundation/hardhat-verify@1.1.1(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(bufferutil@4.0.8)(encoding@0.1.13)(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10)': + '@openzeppelin/hardhat-upgrades@2.5.1(@nomicfoundation/hardhat-ethers@3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(@nomicfoundation/hardhat-verify@1.1.1(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(bufferutil@4.0.8)(encoding@0.1.13)(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10)': dependencies: - '@nomicfoundation/hardhat-ethers': 3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) + '@nomicfoundation/hardhat-ethers': 3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) '@openzeppelin/defender-admin-client': 1.54.6(bufferutil@4.0.8)(debug@4.3.7)(encoding@0.1.13)(utf-8-validate@5.0.10) '@openzeppelin/defender-base-client': 1.54.6(debug@4.3.7)(encoding@0.1.13) '@openzeppelin/defender-sdk-base-client': 1.15.0(encoding@0.1.13) @@ -12113,11 +12190,11 @@ snapshots: debug: 4.3.7(supports-color@8.1.1) ethereumjs-util: 7.1.5 ethers: 6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) - hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) + hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) proper-lockfile: 4.1.2 undici: 5.28.4 optionalDependencies: - '@nomicfoundation/hardhat-verify': 1.1.1(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) + '@nomicfoundation/hardhat-verify': 1.1.1(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) transitivePeerDependencies: - bufferutil - encoding @@ -12582,7 +12659,7 @@ snapshots: '@noble/hashes': 1.5.0 '@safe-global/safe-deployments': 1.37.10 ethereumjs-util: 7.1.5 - ethers: 6.13.3(bufferutil@4.0.8)(utf-8-validate@5.0.10) + ethers: 6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10) semver: 7.6.3 web3: 1.10.4(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) web3-core: 1.10.4(encoding@0.1.13) @@ -12616,7 +12693,7 @@ snapshots: '@safe-global/safe-core-sdk-types@4.0.2(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)': dependencies: '@safe-global/safe-deployments': 1.37.10 - ethers: 6.13.3(bufferutil@4.0.8)(utf-8-validate@5.0.10) + ethers: 6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10) web3-core: 1.10.4(encoding@0.1.13) web3-utils: 1.10.4 transitivePeerDependencies: @@ -12960,7 +13037,7 @@ snapshots: - utf-8-validate - zod - '@synthetixio/synpress-cache@0.0.1-alpha.7(playwright-core@1.45.3)(postcss@8.4.47)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)': + '@synthetixio/synpress-cache@0.0.1-alpha.7(playwright-core@1.45.3)(postcss@8.4.47)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)': dependencies: axios: 1.6.7 chalk: 5.3.0 @@ -12971,7 +13048,7 @@ snapshots: gradient-string: 2.0.2 playwright-core: 1.45.3 progress: 2.0.3 - tsup: 8.0.2(postcss@8.4.47)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5) + tsup: 8.0.2(postcss@8.4.47)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5) unzipper: 0.10.14 zod: 3.22.4 transitivePeerDependencies: @@ -12987,10 +13064,10 @@ snapshots: dependencies: '@playwright/test': 1.45.3 - '@synthetixio/synpress-metamask@0.0.1-alpha.7(@playwright/test@1.45.3)(bufferutil@4.0.8)(playwright-core@1.45.3)(postcss@8.4.47)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)': + '@synthetixio/synpress-metamask@0.0.1-alpha.7(@playwright/test@1.45.3)(bufferutil@4.0.8)(playwright-core@1.45.3)(postcss@8.4.47)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)': dependencies: '@playwright/test': 1.45.3 - '@synthetixio/synpress-cache': 0.0.1-alpha.7(playwright-core@1.45.3)(postcss@8.4.47)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5) + '@synthetixio/synpress-cache': 0.0.1-alpha.7(playwright-core@1.45.3)(postcss@8.4.47)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5) '@synthetixio/synpress-core': 0.0.1-alpha.7(@playwright/test@1.45.3) '@viem/anvil': 0.0.7(bufferutil@4.0.8)(utf-8-validate@5.0.10) fs-extra: 11.2.0 @@ -13007,13 +13084,13 @@ snapshots: - typescript - utf-8-validate - '@synthetixio/synpress@4.0.0-alpha.7(@playwright/test@1.45.3)(bufferutil@4.0.8)(playwright-core@1.45.3)(postcss@8.4.47)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4)': + '@synthetixio/synpress@4.0.0-alpha.7(@playwright/test@1.45.3)(bufferutil@4.0.8)(playwright-core@1.45.3)(postcss@8.4.47)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4)': dependencies: '@playwright/test': 1.45.3 '@synthetixio/ethereum-wallet-mock': 0.0.1-alpha.7(@playwright/test@1.45.3)(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.22.4) - '@synthetixio/synpress-cache': 0.0.1-alpha.7(playwright-core@1.45.3)(postcss@8.4.47)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5) + '@synthetixio/synpress-cache': 0.0.1-alpha.7(playwright-core@1.45.3)(postcss@8.4.47)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5) '@synthetixio/synpress-core': 0.0.1-alpha.7(@playwright/test@1.45.3) - '@synthetixio/synpress-metamask': 0.0.1-alpha.7(@playwright/test@1.45.3)(bufferutil@4.0.8)(playwright-core@1.45.3)(postcss@8.4.47)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) + '@synthetixio/synpress-metamask': 0.0.1-alpha.7(@playwright/test@1.45.3)(bufferutil@4.0.8)(playwright-core@1.45.3)(postcss@8.4.47)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) transitivePeerDependencies: - '@microsoft/api-extractor' - '@swc/core' @@ -13087,12 +13164,20 @@ snapshots: typechain: 8.3.2(typescript@5.4.5) typescript: 5.4.5 - '@typechain/hardhat@9.1.0(@typechain/ethers-v6@0.5.1(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))(typescript@5.4.5))(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))': + '@typechain/ethers-v6@0.5.1(ethers@6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))(typescript@5.4.5)': + dependencies: + ethers: 6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10) + 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 + + '@typechain/hardhat@9.1.0(@typechain/ethers-v6@0.5.1(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))(typescript@5.4.5))(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))': dependencies: '@typechain/ethers-v6': 0.5.1(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))(typescript@5.4.5) ethers: 6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) fs-extra: 9.1.0 - hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) + hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) typechain: 8.3.2(typescript@5.4.5) '@types/babel__core@7.20.5': @@ -13187,12 +13272,12 @@ snapshots: dependencies: '@types/istanbul-lib-report': 3.0.3 - '@types/jest@29.5.12': + '@types/jest@29.5.13': dependencies: expect: 29.7.0 pretty-format: 29.7.0 - '@types/jest@29.5.13': + '@types/jest@29.5.14': dependencies: expect: 29.7.0 pretty-format: 29.7.0 @@ -13231,6 +13316,10 @@ snapshots: dependencies: undici-types: 5.26.5 + '@types/node@22.7.5': + dependencies: + undici-types: 6.19.8 + '@types/node@8.10.66': {} '@types/pbkdf2@3.1.2': @@ -13296,6 +13385,10 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 + '@types/yargs@17.0.33': + dependencies: + '@types/yargs-parser': 21.0.3 + '@typescript-eslint/eslint-plugin@7.6.0(@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)': dependencies: '@eslint-community/regexpp': 4.11.1 @@ -14547,6 +14640,11 @@ snapshots: bech32@1.1.4: {} + better-sqlite3@11.6.0: + dependencies: + bindings: 1.5.0 + prebuild-install: 7.1.2 + better-sqlite3@9.6.0: dependencies: bindings: 1.5.0 @@ -15217,6 +15315,21 @@ snapshots: - supports-color - ts-node + create-jest@29.7.0(@types/node@22.7.5)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)): + dependencies: + '@jest/types': 29.6.3 + chalk: 4.1.2 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-config: 29.7.0(@types/node@22.7.5)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)) + jest-util: 29.7.0 + prompts: 2.4.2 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + create-require@1.1.1: {} cross-fetch@3.1.8(encoding@0.1.13): @@ -15965,11 +16078,11 @@ snapshots: string.prototype.matchall: 4.0.11 string.prototype.repeat: 1.0.0 - eslint-plugin-tailwindcss@3.17.4(tailwindcss@3.4.13(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))): + eslint-plugin-tailwindcss@3.17.4(tailwindcss@3.4.13(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))): dependencies: fast-glob: 3.3.2 postcss: 8.4.47 - tailwindcss: 3.4.13(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)) + tailwindcss: 3.4.13(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)) eslint-scope@7.2.2: dependencies: @@ -16259,6 +16372,19 @@ snapshots: - bufferutil - utf-8-validate + ethers@6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10): + dependencies: + '@adraffy/ens-normalize': 1.10.1 + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.2 + '@types/node': 22.7.5 + aes-js: 4.0.0-beta.5 + tslib: 2.7.0 + ws: 8.17.1(bufferutil@4.0.8)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + ethjs-unit@0.1.6: dependencies: bn.js: 4.11.6 @@ -16948,11 +17074,11 @@ snapshots: - supports-color - utf-8-validate - hardhat-gas-reporter@1.0.10(bufferutil@4.0.8)(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10): + hardhat-gas-reporter@1.0.10(bufferutil@4.0.8)(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10): dependencies: array-uniq: 1.0.3 eth-gas-reporter: 0.2.27(bufferutil@4.0.8)(utf-8-validate@5.0.10) - hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) + hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) sha1: 1.1.1 transitivePeerDependencies: - '@codechecks/client' @@ -16960,24 +17086,24 @@ snapshots: - debug - utf-8-validate - hardhat-storage-layout@0.1.7(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)): + hardhat-storage-layout@0.1.7(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)): dependencies: console-table-printer: 2.12.1 - hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) + hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) - hardhat-tracer@2.8.2(bufferutil@4.0.8)(chai@4.1.1)(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10): + hardhat-tracer@2.8.2(bufferutil@4.0.8)(chai@4.1.1)(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10): dependencies: chai: 4.1.1 chalk: 4.1.2 debug: 4.3.7(supports-color@8.1.1) ethers: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) - hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) + hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) transitivePeerDependencies: - bufferutil - supports-color - utf-8-validate - hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10): + hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10): dependencies: '@ethersproject/abi': 5.7.0 '@metamask/eth-sig-util': 4.0.1 @@ -17024,7 +17150,7 @@ snapshots: uuid: 8.3.2 ws: 7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10) optionalDependencies: - ts-node: 10.9.2(@types/node@20.12.7)(typescript@5.4.5) + ts-node: 10.9.2(@types/node@22.7.5)(typescript@5.4.5) typescript: 5.4.5 transitivePeerDependencies: - bufferutil @@ -17576,6 +17702,25 @@ snapshots: - supports-color - ts-node + jest-cli@29.7.0(@types/node@22.7.5)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)): + dependencies: + '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)) + '@jest/test-result': 29.7.0 + '@jest/types': 29.6.3 + chalk: 4.1.2 + create-jest: 29.7.0(@types/node@22.7.5)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)) + exit: 0.1.2 + import-local: 3.2.0 + jest-config: 29.7.0(@types/node@22.7.5)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)) + jest-util: 29.7.0 + jest-validate: 29.7.0 + yargs: 17.7.2 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + jest-config@29.7.0(@types/node@20.12.7)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)): dependencies: '@babel/core': 7.25.7 @@ -17607,6 +17752,68 @@ snapshots: - babel-plugin-macros - supports-color + jest-config@29.7.0(@types/node@20.12.7)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)): + dependencies: + '@babel/core': 7.25.7 + '@jest/test-sequencer': 29.7.0 + '@jest/types': 29.6.3 + babel-jest: 29.7.0(@babel/core@7.25.7) + chalk: 4.1.2 + ci-info: 3.9.0 + deepmerge: 4.3.1 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-circus: 29.7.0 + jest-environment-node: 29.7.0 + jest-get-type: 29.6.3 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-runner: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + micromatch: 4.0.8 + parse-json: 5.2.0 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-json-comments: 3.1.1 + optionalDependencies: + '@types/node': 20.12.7 + ts-node: 10.9.2(@types/node@22.7.5)(typescript@5.4.5) + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + + jest-config@29.7.0(@types/node@22.7.5)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)): + dependencies: + '@babel/core': 7.25.7 + '@jest/test-sequencer': 29.7.0 + '@jest/types': 29.6.3 + babel-jest: 29.7.0(@babel/core@7.25.7) + chalk: 4.1.2 + ci-info: 3.9.0 + deepmerge: 4.3.1 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-circus: 29.7.0 + jest-environment-node: 29.7.0 + jest-get-type: 29.6.3 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-runner: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + micromatch: 4.0.8 + parse-json: 5.2.0 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-json-comments: 3.1.1 + optionalDependencies: + '@types/node': 22.7.5 + ts-node: 10.9.2(@types/node@22.7.5)(typescript@5.4.5) + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + jest-diff@29.7.0: dependencies: chalk: 4.1.2 @@ -17683,9 +17890,9 @@ snapshots: slash: 3.0.0 stack-utils: 2.0.6 - jest-mock-extended@3.0.5(jest@29.7.0(@types/node@20.12.7)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)))(typescript@5.4.5): + jest-mock-extended@3.0.5(jest@29.7.0(@types/node@22.7.5)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)))(typescript@5.4.5): dependencies: - jest: 29.7.0(@types/node@20.12.7)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)) + jest: 29.7.0(@types/node@22.7.5)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)) ts-essentials: 7.0.3(typescript@5.4.5) typescript: 5.4.5 @@ -17846,6 +18053,18 @@ snapshots: - supports-color - ts-node + jest@29.7.0(@types/node@22.7.5)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)): + dependencies: + '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)) + '@jest/types': 29.6.3 + import-local: 3.2.0 + jest-cli: 29.7.0(@types/node@22.7.5)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)) + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + jiti@1.21.6: {} jiti@2.3.3: {} @@ -18135,6 +18354,15 @@ snapshots: safe-stable-stringify: 2.5.0 triple-beam: 1.4.1 + logform@2.7.0: + dependencies: + '@colors/colors': 1.6.0 + '@types/triple-beam': 1.3.5 + fecha: 4.2.3 + ms: 2.1.3 + safe-stable-stringify: 2.5.0 + triple-beam: 1.4.1 + logkitty@0.7.1: dependencies: ansi-fragments: 0.2.1 @@ -18159,6 +18387,8 @@ snapshots: lru-cache@10.4.3: {} + lru-cache@11.0.2: {} + lru-cache@5.1.1: dependencies: yallist: 3.1.1 @@ -19053,6 +19283,10 @@ snapshots: dependencies: pg: 8.11.3 + pg-pool@3.7.0(pg@8.13.1): + dependencies: + pg: 8.13.1 + pg-protocol@1.7.0: {} pg-types@2.2.0: @@ -19075,12 +19309,24 @@ snapshots: optionalDependencies: pg-cloudflare: 1.1.1 + pg@8.13.1: + dependencies: + pg-connection-string: 2.7.0 + pg-pool: 3.7.0(pg@8.13.1) + pg-protocol: 1.7.0 + pg-types: 2.2.0 + pgpass: 1.0.5 + optionalDependencies: + pg-cloudflare: 1.1.1 + pgpass@1.0.5: dependencies: split2: 4.2.0 picocolors@1.1.0: {} + picocolors@1.1.1: {} + picomatch@2.3.1: {} pify@2.3.0: {} @@ -19178,13 +19424,13 @@ snapshots: camelcase-css: 2.0.1 postcss: 8.4.47 - postcss-load-config@4.0.2(postcss@8.4.47)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)): + postcss-load-config@4.0.2(postcss@8.4.47)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)): dependencies: lilconfig: 3.1.2 yaml: 2.5.1 optionalDependencies: postcss: 8.4.47 - ts-node: 10.9.2(@types/node@20.12.7)(typescript@5.4.5) + ts-node: 10.9.2(@types/node@22.7.5)(typescript@5.4.5) postcss-nested@6.2.0(postcss@8.4.47): dependencies: @@ -19207,7 +19453,7 @@ snapshots: postcss@8.4.47: dependencies: nanoid: 3.3.7 - picocolors: 1.1.0 + picocolors: 1.1.1 source-map-js: 1.2.1 postgres-array@2.0.0: {} @@ -20098,7 +20344,7 @@ snapshots: solidity-comments-extractor@0.0.8: {} - solidity-coverage@0.8.13(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)): + solidity-coverage@0.8.13(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)): dependencies: '@ethersproject/abi': 5.7.0 '@solidity-parser/parser': 0.18.0 @@ -20109,7 +20355,7 @@ snapshots: ghost-testrpc: 0.0.2 global-modules: 2.0.0 globby: 10.0.2 - hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) + hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) jsonschema: 1.4.1 lodash: 4.17.21 mocha: 10.7.3 @@ -20121,10 +20367,10 @@ snapshots: shelljs: 0.8.5 web3-utils: 1.10.4 - solidity-docgen@0.6.0-beta.36(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)): + solidity-docgen@0.6.0-beta.36(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)): dependencies: handlebars: 4.7.8 - hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) + hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) solidity-ast: 0.4.59 sonic-boom@2.8.0: @@ -20433,11 +20679,11 @@ snapshots: tailwind-merge@2.5.3: {} - tailwind-scrollbar@3.1.0(tailwindcss@3.4.13(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))): + tailwind-scrollbar@3.1.0(tailwindcss@3.4.13(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))): dependencies: - tailwindcss: 3.4.13(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)) + tailwindcss: 3.4.13(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)) - tailwindcss@3.4.13(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)): + tailwindcss@3.4.13(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)): dependencies: '@alloc/quick-lru': 5.2.0 arg: 5.0.2 @@ -20456,7 +20702,7 @@ snapshots: postcss: 8.4.47 postcss-import: 15.1.0(postcss@8.4.47) postcss-js: 4.0.1(postcss@8.4.47) - postcss-load-config: 4.0.2(postcss@8.4.47)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)) + postcss-load-config: 4.0.2(postcss@8.4.47)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)) postcss-nested: 6.2.0(postcss@8.4.47) postcss-selector-parser: 6.1.2 resolve: 1.22.8 @@ -20614,9 +20860,10 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-jest@29.1.2(@babel/core@7.25.7)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.7))(jest@29.7.0(@types/node@20.12.7)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)))(typescript@5.4.5): + ts-jest@29.2.5(@babel/core@7.25.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.7))(jest@29.7.0(@types/node@20.12.7)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)))(typescript@5.4.5): dependencies: bs-logger: 0.2.6 + ejs: 3.1.10 fast-json-stable-stringify: 2.1.0 jest: 29.7.0(@types/node@20.12.7)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)) jest-util: 29.7.0 @@ -20628,15 +20875,16 @@ snapshots: yargs-parser: 21.1.1 optionalDependencies: '@babel/core': 7.25.7 + '@jest/transform': 29.7.0 '@jest/types': 29.6.3 babel-jest: 29.7.0(@babel/core@7.25.7) - ts-jest@29.2.5(@babel/core@7.25.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.7))(jest@29.7.0(@types/node@20.12.7)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)))(typescript@5.4.5): + ts-jest@29.2.5(@babel/core@7.25.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.7))(jest@29.7.0(@types/node@22.7.5)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)))(typescript@5.4.5): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@20.12.7)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)) + jest: 29.7.0(@types/node@22.7.5)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)) jest-util: 29.7.0 json5: 2.2.3 lodash.memoize: 4.1.2 @@ -20668,6 +20916,24 @@ snapshots: v8-compile-cache-lib: 3.0.1 yn: 3.1.1 + ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5): + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.11 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 22.7.5 + acorn: 8.12.1 + acorn-walk: 8.3.4 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.4.5 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + tsconfig-paths@3.15.0: dependencies: '@types/json5': 0.0.29 @@ -20683,7 +20949,7 @@ snapshots: tsort@0.0.1: {} - tsup@8.0.2(postcss@8.4.47)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5): + tsup@8.0.2(postcss@8.4.47)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))(typescript@5.4.5): dependencies: bundle-require: 4.2.1(esbuild@0.19.12) cac: 6.7.14 @@ -20693,7 +20959,7 @@ snapshots: execa: 5.1.1 globby: 11.1.0 joycon: 3.1.1 - postcss-load-config: 4.0.2(postcss@8.4.47)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)) + postcss-load-config: 4.0.2(postcss@8.4.47)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)) resolve-from: 5.0.0 rollup: 4.24.0 source-map: 0.8.0-beta.0 @@ -20797,11 +21063,39 @@ snapshots: typedarray@0.0.6: {} - typeorm-naming-strategies@4.1.0(typeorm@0.3.20(better-sqlite3@9.6.0)(pg@8.11.3)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))): + typeorm-naming-strategies@4.1.0(typeorm@0.3.20(better-sqlite3@11.6.0)(pg@8.13.1)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))): + dependencies: + typeorm: 0.3.20(better-sqlite3@11.6.0)(pg@8.13.1)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)) + + typeorm-naming-strategies@4.1.0(typeorm@0.3.20(better-sqlite3@9.6.0)(pg@8.11.3)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5))): dependencies: - typeorm: 0.3.20(better-sqlite3@9.6.0)(pg@8.11.3)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)) + typeorm: 0.3.20(better-sqlite3@9.6.0)(pg@8.11.3)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)) - typeorm@0.3.20(better-sqlite3@9.6.0)(pg@8.11.3)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5)): + typeorm@0.3.20(better-sqlite3@11.6.0)(pg@8.13.1)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)): + dependencies: + '@sqltools/formatter': 1.2.5 + app-root-path: 3.1.0 + buffer: 6.0.3 + chalk: 4.1.2 + cli-highlight: 2.1.11 + dayjs: 1.11.13 + debug: 4.3.7(supports-color@8.1.1) + dotenv: 16.4.5 + glob: 10.4.5 + mkdirp: 2.1.6 + reflect-metadata: 0.2.2 + sha.js: 2.4.11 + tslib: 2.7.0 + uuid: 9.0.1 + yargs: 17.7.2 + optionalDependencies: + better-sqlite3: 11.6.0 + pg: 8.13.1 + ts-node: 10.9.2(@types/node@22.7.5)(typescript@5.4.5) + transitivePeerDependencies: + - supports-color + + typeorm@0.3.20(better-sqlite3@9.6.0)(pg@8.11.3)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5)): dependencies: '@sqltools/formatter': 1.2.5 app-root-path: 3.1.0 @@ -20821,7 +21115,7 @@ snapshots: optionalDependencies: better-sqlite3: 9.6.0 pg: 8.11.3 - ts-node: 10.9.2(@types/node@20.12.7)(typescript@5.4.5) + ts-node: 10.9.2(@types/node@22.7.5)(typescript@5.4.5) transitivePeerDependencies: - supports-color @@ -20855,6 +21149,8 @@ snapshots: undici-types@5.26.5: {} + undici-types@6.19.8: {} + undici@5.28.4: dependencies: '@fastify/busboy': 2.1.1 @@ -20940,7 +21236,7 @@ snapshots: dependencies: browserslist: 4.24.0 escalade: 3.2.0 - picocolors: 1.1.0 + picocolors: 1.1.1 uqr@0.1.2: {} @@ -21397,6 +21693,12 @@ snapshots: readable-stream: 4.5.2 triple-beam: 1.4.1 + winston-transport@4.9.0: + dependencies: + logform: 2.7.0 + readable-stream: 3.6.2 + triple-beam: 1.4.1 + winston@3.13.0: dependencies: '@colors/colors': 1.6.0 @@ -21411,6 +21713,20 @@ snapshots: triple-beam: 1.4.1 winston-transport: 4.8.0 + winston@3.17.0: + dependencies: + '@colors/colors': 1.6.0 + '@dabh/diagnostics': 2.0.3 + async: 3.2.6 + is-stream: 2.0.1 + logform: 2.7.0 + one-time: 1.0.0 + readable-stream: 3.6.2 + safe-stable-stringify: 2.5.0 + stack-trace: 0.0.10 + triple-beam: 1.4.1 + winston-transport: 4.9.0 + word-wrap@1.2.5: {} wordwrap@1.0.0: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index f4ba00293..9d21baaa8 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -2,6 +2,7 @@ packages: - 'contracts/**' - 'e2e/**' - 'sdk/**' + - 'postman/**' - 'operations/**' - 'bridge-ui/**' - 'ts-libs/**' diff --git a/postman/.env.sample b/postman/.env.sample new file mode 100644 index 000000000..820609898 --- /dev/null +++ b/postman/.env.sample @@ -0,0 +1,44 @@ +L1_RPC_URL=http://localhost:8445 +L1_CONTRACT_ADDRESS=0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9 +# Only use the following PRIVATE KEY for testing +L1_SIGNER_PRIVATE_KEY=0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba +L1_LISTENER_INTERVAL=2000 +# L1_LISTENER_INITIAL_FROM_BLOCK=0 +L1_LISTENER_BLOCK_CONFIRMATION=1 +L1_MAX_BLOCKS_TO_FETCH_LOGS=1000 +L1_MAX_GAS_FEE_ENFORCED=false +L2_RPC_URL=http://localhost:8845 +L2_CONTRACT_ADDRESS=0xe537D669CA013d86EBeF1D64e40fC74CADC91987 +# Only use the following PRIVATE KEY for testing +L2_SIGNER_PRIVATE_KEY=0xfcf854e0a0bc6fd7e97d7050e61a362c915cecd6767a32267b22e8b7af572e58 +L2_LISTENER_INTERVAL=2000 +# L2_LISTENER_INITIAL_FROM_BLOCK=0 +L2_LISTENER_BLOCK_CONFIRMATION=0 +L2_MAX_BLOCKS_TO_FETCH_LOGS=1000 +L2_MESSAGE_TREE_DEPTH=5 +L2_MAX_GAS_FEE_ENFORCED=false +MESSAGE_SUBMISSION_TIMEOUT=300000 +MAX_FETCH_MESSAGES_FROM_DB=1000 +MAX_NONCE_DIFF=10000 +MAX_FEE_PER_GAS_CAP=100000000000 +GAS_ESTIMATION_PERCENTILE=50 +PROFIT_MARGIN=0.0 +MAX_NUMBER_OF_RETRIES=100 +RETRY_DELAY_IN_SECONDS=30 +MAX_CLAIM_GAS_LIMIT=2560000 +MAX_TX_RETRIES=20 +L1_L2_EOA_ENABLED=true +L1_L2_CALLDATA_ENABLED=true +L1_L2_AUTO_CLAIM_ENABLED=true +L2_L1_EOA_ENABLED=true +L2_L1_CALLDATA_ENABLED=true +L2_L1_AUTO_CLAIM_ENABLED=true +POSTGRES_HOST=127.0.0.1 +POSTGRES_PORT=5432 +POSTGRES_USER=postgres +POSTGRES_PASSWORD=postgres +POSTGRES_DB=postman_db +DB_CLEANER_ENABLED=false +DB_CLEANING_INTERVAL=10000 +DB_DAYS_BEFORE_NOW_TO_DELETE=1 +ENABLE_LINEA_ESTIMATE_GAS=false \ No newline at end of file diff --git a/postman/.eslintignore b/postman/.eslintignore new file mode 100644 index 000000000..0e177d4fc --- /dev/null +++ b/postman/.eslintignore @@ -0,0 +1,3 @@ +dist +node_modules +typechain \ No newline at end of file diff --git a/postman/.eslintrc.js b/postman/.eslintrc.js new file mode 100644 index 000000000..cb78cb3f7 --- /dev/null +++ b/postman/.eslintrc.js @@ -0,0 +1,15 @@ +module.exports = { + extends: "../.eslintrc.js", + env: { + commonjs: true, + es2021: true, + node: true, + jest: true, + }, + parserOptions: { + sourceType: "module", + }, + rules: { + "prettier/prettier": "error", + }, +}; diff --git a/postman/.prettierignore b/postman/.prettierignore new file mode 100644 index 000000000..0e177d4fc --- /dev/null +++ b/postman/.prettierignore @@ -0,0 +1,3 @@ +dist +node_modules +typechain \ No newline at end of file diff --git a/postman/.prettierrc.js b/postman/.prettierrc.js new file mode 100644 index 000000000..2dcec9868 --- /dev/null +++ b/postman/.prettierrc.js @@ -0,0 +1,3 @@ +module.exports = { + ...require('../.prettierrc.js'), +}; diff --git a/sdk/Dockerfile b/postman/Dockerfile similarity index 79% rename from sdk/Dockerfile rename to postman/Dockerfile index c77e6993b..a627677f8 100644 --- a/sdk/Dockerfile +++ b/postman/Dockerfile @@ -18,16 +18,19 @@ ARG NATIVE_LIBS_RELEASE_TAG ENV NATIVE_LIBS_RELEASE_TAG=${NATIVE_LIBS_RELEASE_TAG} COPY package.json pnpm-lock.yaml pnpm-workspace.yaml tsconfig.json ./ + +COPY ./postman/package.json ./postman/package.json COPY ./sdk/package.json ./sdk/package.json COPY ./ts-libs/linea-native-libs/package.json ./ts-libs/linea-native-libs/package.json RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile --prefer-offline --ignore-scripts +COPY ./postman ./postman COPY ./sdk ./sdk COPY ts-libs/linea-native-libs ./ts-libs/linea-native-libs RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm run build \ - && pnpm deploy --filter=./sdk --prod ./prod/sdk + && pnpm deploy --filter=./postman --prod ./prod/postman FROM node:lts-slim AS production @@ -37,6 +40,6 @@ WORKDIR /usr/src/app USER node -COPY --from=builder /usr/src/app/prod/sdk ./sdk +COPY --from=builder /usr/src/app/prod/postman ./postman -CMD [ "node", "./sdk/dist/scripts/runPostman.js" ] \ No newline at end of file +CMD [ "node", "./postman/dist/scripts/runPostman.js" ] \ No newline at end of file diff --git a/postman/LICENSE b/postman/LICENSE new file mode 100644 index 000000000..2325b1b32 --- /dev/null +++ b/postman/LICENSE @@ -0,0 +1,13 @@ +Copyright 2023 Consensys Software Inc. + +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. \ No newline at end of file diff --git a/postman/README.md b/postman/README.md new file mode 100644 index 000000000..d57565208 --- /dev/null +++ b/postman/README.md @@ -0,0 +1,115 @@ +# Linea Postman Service + +The Linea Postman service is a component of the Linea blockchain infrastructure that facilitates cross-chain message delivery between Layer 1 (Ethereum) and Layer 2 (Linea). + +## Overview + +The Postman service monitors and processes messages between L1 and L2 chains, handling message submission, verification, and claiming. It operates as a Docker container and integrates with both L1 and L2 nodes. + +It offers the following key features: + +- Feature 1: Listening for message sent events on Ethereum and Linea +- Feature 2: Listening for message hash anchoring events to check if a message is ready to be claimed +- Feature 3: Automatic claiming of messages with a configurable retry mechanism +- Feature 4: Checking receipt status for each transaction + +All messages are stored in a configurable Postgres DB. + +## Configuration + +### Environment Variables + +#### L1 Configuration +- `L1_RPC_URL`: Ethereum node RPC endpoint +- `L1_CONTRACT_ADDRESS`: Address of the LineaRollup contract on L1 +- `L1_SIGNER_PRIVATE_KEY`: Private key for L1 transactions +- `L1_LISTENER_INTERVAL`: Block listening interval (ms) +- `L1_LISTENER_INITIAL_FROM_BLOCK`: Starting block for event listening (optional) +- `L1_LISTENER_BLOCK_CONFIRMATION`: Required block confirmations +- `L1_MAX_BLOCKS_TO_FETCH_LOGS`: Maximum blocks to fetch in one request +- `L1_MAX_GAS_FEE_ENFORCED`: Enable/disable gas fee enforcement + +#### L2 Configuration +- `L2_RPC_URL`: Linea node RPC endpoint +- `L2_CONTRACT_ADDRESS`: Address of the L2MessageService contract on L2 +- `L2_SIGNER_PRIVATE_KEY`: Private key for L2 transactions +- `L2_LISTENER_INTERVAL`: Block listening interval (ms) +- `L2_LISTENER_INITIAL_FROM_BLOCK`: Starting block for event listening (optional) +- `L2_LISTENER_BLOCK_CONFIRMATION`: Required block confirmations +- `L2_MAX_BLOCKS_TO_FETCH_LOGS`: Maximum blocks to fetch in one request +- `L2_MAX_GAS_FEE_ENFORCED`: Enable/disable gas fee enforcement +- `L2_MESSAGE_TREE_DEPTH`: Depth of the message Merkle tree + +#### Message Processing +- `MESSAGE_SUBMISSION_TIMEOUT`: Timeout for message submission (ms) +- `MAX_FETCH_MESSAGES_FROM_DB`: Maximum messages to fetch from database +- `MAX_NONCE_DIFF`: Maximum allowed nonce difference between the DB and the chain +- `MAX_FEE_PER_GAS_CAP`: Maximum gas fee cap +- `GAS_ESTIMATION_PERCENTILE`: Gas estimation percentile +- `PROFIT_MARGIN`: Profit margin for gas fees +- `MAX_NUMBER_OF_RETRIES`: Maximum retry attempts +- `RETRY_DELAY_IN_SECONDS`: Delay between retries +- `MAX_CLAIM_GAS_LIMIT`: Maximum gas limit for claim transactions + +#### Feature Flags +- `L1_L2_EOA_ENABLED`: Enable L1->L2 EOA messages +- `L1_L2_CALLDATA_ENABLED`: Enable L1->L2 calldata messages +- `L1_L2_AUTO_CLAIM_ENABLED`: Enable auto-claiming for L1->L2 messages +- `L2_L1_EOA_ENABLED`: Enable L2->L1 EOA messages +- `L2_L1_CALLDATA_ENABLED`: Enable L2->L1 calldata messages +- `L2_L1_AUTO_CLAIM_ENABLED`: Enable auto-claiming for L2->L1 messages +- `ENABLE_LINEA_ESTIMATE_GAS`: Enable `linea_estimateGas`endpoint usage for L2 chain gas fees estimation +- `DB_CLEANER_ENABLED`: Enable DB cleaning to delete old claimed messages + +#### DB cleaning +- `DB_CLEANING_INTERVAL`: DB cleaning polling interval (ms) +- `DB_DAYS_BEFORE_NOW_TO_DELETE`: Number of days to retain messages in the database before deletion. Messages older than this number of days will be automatically cleaned up if they are in a final state (CLAIMED_SUCCESS, CLAIMED_REVERTED, EXCLUDED, or ZERO_FEE) + +#### Database Configuration +- `POSTGRES_HOST`: PostgreSQL host +- `POSTGRES_PORT`: PostgreSQL port +- `POSTGRES_USER`: Database user +- `POSTGRES_PASSWORD`: Database password +- `POSTGRES_DB`: Database name + +## Development + +### Running + +#### Start the docker local stack + +From the root folder, run the following command: +```bash +make fresh-start-all +``` + +Stop the postman docker container manually. + +#### Run the postman locally: + +From the postman folder run the following commands: + +```bash +# Create a new .env file +cp .env.sample .env + +# Run the postman +ts-node scripts/runPostman.ts +``` + +### Building +```bash +# Build the Postman service +pnpm run build +``` + +### Testing + +```bash +# Run unit tests +pnpm run test +``` + +## License + +This package is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for more information. diff --git a/postman/jest.config.js b/postman/jest.config.js new file mode 100644 index 000000000..f4837d563 --- /dev/null +++ b/postman/jest.config.js @@ -0,0 +1,25 @@ +module.exports = { + preset: "ts-jest", + testEnvironment: "node", + rootDir: ".", + testRegex: "test.ts$", + verbose: true, + collectCoverage: true, + collectCoverageFrom: ["src/**/*.ts"], + coverageReporters: ["html", "lcov", "text"], + testPathIgnorePatterns: [ + "src/clients/blockchain/typechain", + "src/application/postman/persistence/migrations/", + "src/application/postman/persistence/repositories/", + "src/index.ts", + "src/utils/WinstonLogger.ts", + ], + coveragePathIgnorePatterns: [ + "src/clients/blockchain/typechain", + "src/application/postman/persistence/migrations/", + "src/application/postman/persistence/repositories/", + "src/index.ts", + "src/utils/WinstonLogger.ts", + "src/utils/testing/", + ], +}; diff --git a/postman/package.json b/postman/package.json new file mode 100644 index 000000000..4aa225699 --- /dev/null +++ b/postman/package.json @@ -0,0 +1,44 @@ +{ + "name": "@consensys/linea-postman", + "version": "1.0.0", + "author": "Consensys Software Inc.", + "license": "Apache-2.0", + "description": "", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", + "scripts": { + "lint:ts": "npx eslint '**/*.ts'", + "lint:ts:fix": "npx eslint --fix '**/*.ts'", + "prettier": "prettier -c '**/*.ts'", + "prettier:fix": "prettier -w '**/*.ts'", + "clean": "rimraf dist node_modules coverage tsconfig.build.tsbuildinfo", + "build": "tsc -p tsconfig.build.json", + "build:runSdk": "tsc ./scripts/runSdk.ts", + "test": "npx jest --bail --detectOpenHandles --forceExit", + "lint:fix": "pnpm run lint:ts:fix && pnpm run prettier:fix" + }, + "dependencies": { + "@consensys/linea-native-libs": "workspace:*", + "@consensys/linea-sdk": "workspace:*", + "better-sqlite3": "11.6.0", + "class-validator": "0.14.1", + "dotenv": "16.4.5", + "ethers": "6.13.4", + "pg": "8.13.1", + "typeorm": "0.3.20", + "typeorm-naming-strategies": "4.1.0", + "winston": "3.17.0" + }, + "devDependencies": { + "@jest/globals": "29.7.0", + "@types/jest": "29.5.14", + "@types/yargs": "17.0.33", + "jest": "29.7.0", + "jest-mock-extended": "3.0.5", + "ts-jest": "29.2.5", + "yargs": "17.7.2" + }, + "files": [ + "dist/**/*" + ] +} diff --git a/sdk/scripts/cli.ts b/postman/scripts/cli.ts similarity index 100% rename from sdk/scripts/cli.ts rename to postman/scripts/cli.ts diff --git a/sdk/scripts/helpers.ts b/postman/scripts/helpers.ts similarity index 100% rename from sdk/scripts/helpers.ts rename to postman/scripts/helpers.ts diff --git a/sdk/scripts/runPostman.ts b/postman/scripts/runPostman.ts similarity index 96% rename from sdk/scripts/runPostman.ts rename to postman/scripts/runPostman.ts index 81bf2d7f8..e9006e5a9 100644 --- a/sdk/scripts/runPostman.ts +++ b/postman/scripts/runPostman.ts @@ -32,7 +32,7 @@ async function main() { ? parseInt(process.env.MESSAGE_SUBMISSION_TIMEOUT) : undefined, maxNonceDiff: process.env.MAX_NONCE_DIFF ? parseInt(process.env.MAX_NONCE_DIFF) : undefined, - maxFeePerGas: process.env.MAX_FEE_PER_GAS ? BigInt(process.env.MAX_FEE_PER_GAS) : undefined, + maxFeePerGasCap: process.env.MAX_FEE_PER_GAS_CAP ? BigInt(process.env.MAX_FEE_PER_GAS_CAP) : undefined, gasEstimationPercentile: process.env.GAS_ESTIMATION_PERCENTILE ? parseInt(process.env.GAS_ESTIMATION_PERCENTILE) : undefined, @@ -72,7 +72,7 @@ async function main() { ? parseInt(process.env.MESSAGE_SUBMISSION_TIMEOUT) : undefined, maxNonceDiff: process.env.MAX_NONCE_DIFF ? parseInt(process.env.MAX_NONCE_DIFF) : undefined, - maxFeePerGas: process.env.MAX_FEE_PER_GAS ? BigInt(process.env.MAX_FEE_PER_GAS) : undefined, + maxFeePerGasCap: process.env.MAX_FEE_PER_GAS_CAP ? BigInt(process.env.MAX_FEE_PER_GAS_CAP) : undefined, gasEstimationPercentile: process.env.GAS_ESTIMATION_PERCENTILE ? parseInt(process.env.GAS_ESTIMATION_PERCENTILE) : undefined, diff --git a/sdk/scripts/sendMessageOnL1.ts b/postman/scripts/sendMessageOnL1.ts similarity index 91% rename from sdk/scripts/sendMessageOnL1.ts rename to postman/scripts/sendMessageOnL1.ts index 18fb2750f..1f1986429 100644 --- a/sdk/scripts/sendMessageOnL1.ts +++ b/postman/scripts/sendMessageOnL1.ts @@ -1,17 +1,10 @@ import { BytesLike, ContractTransactionReceipt, Overrides, Wallet, JsonRpcProvider } from "ethers"; import { config } from "dotenv"; +import { L2MessageService, L2MessageService__factory, LineaRollup, LineaRollup__factory } from "@consensys/linea-sdk"; import yargs from "yargs"; import { hideBin } from "yargs/helpers"; import { SendMessageArgs } from "./types"; import { sanitizeAddress, sanitizePrivKey } from "./cli"; -import { - L2MessageService, - L2MessageService__factory, - ZkEvmV2__factory, - ZkEvmV2, - LineaRollup, - LineaRollup__factory, -} from "../src/clients/blockchain/typechain"; import { encodeSendMessage } from "./helpers"; config(); @@ -86,7 +79,7 @@ const argv = yargs(hideBin(process.argv)) .parseSync(); const sendMessage = async ( - contract: ZkEvmV2, + contract: LineaRollup, args: SendMessageArgs, overrides: Overrides = {}, ): Promise => { @@ -95,7 +88,7 @@ const sendMessage = async ( }; const sendMessages = async ( - contract: ZkEvmV2, + contract: LineaRollup, signer: Wallet, numberOfMessages: number, args: SendMessageArgs, @@ -118,7 +111,7 @@ const sendMessages = async ( }; const getMessageCounter = async (contractAddress: string, signer: Wallet) => { - const lineaRollup = ZkEvmV2__factory.connect(contractAddress, signer) as ZkEvmV2; + const lineaRollup = LineaRollup__factory.connect(contractAddress, signer) as LineaRollup; return lineaRollup.nextMessageNumber(); }; @@ -158,11 +151,15 @@ const main = async (args: typeof argv) => { calldata: args.calldata, }; - const zkEvmV2 = ZkEvmV2__factory.connect(args.l1ContractAddress, l1Signer) as ZkEvmV2; + const lineaRollup = LineaRollup__factory.connect(args.l1ContractAddress, l1Signer) as LineaRollup; - await sendMessages(zkEvmV2, l1Signer, args.numberOfMessage, functionArgs, { value: BigInt(args.value.toString()) }); + await sendMessages(lineaRollup, l1Signer, args.numberOfMessage, functionArgs, { + value: BigInt(args.value.toString()), + }); // Anchor messages hash on L2 + if (!args.autoAnchoring) return; + const nextMessageCounter = await getMessageCounter(args.l1ContractAddress, l1Signer); const startCounter = nextMessageCounter - BigInt(args.numberOfMessage); @@ -180,10 +177,7 @@ const main = async (args: typeof argv) => { messageHashesToAnchor.push(messageHash); } - if (!args.autoAnchoring) return; - const l2Signer = new Wallet(args.l2PrivKey!, l2Provider); - const lineaRollup = LineaRollup__factory.connect(args.l1ContractAddress, l1Signer) as LineaRollup; const l2MessageService = L2MessageService__factory.connect(args.l2ContractAddress, l2Signer) as L2MessageService; const startingMessageNumber = startCounter; await anchorMessageHashesOnL2(lineaRollup, l2MessageService, messageHashesToAnchor, startingMessageNumber); diff --git a/sdk/scripts/sendMessageOnL2.ts b/postman/scripts/sendMessageOnL2.ts similarity index 96% rename from sdk/scripts/sendMessageOnL2.ts rename to postman/scripts/sendMessageOnL2.ts index 8d6242e03..3ee60f5fe 100644 --- a/sdk/scripts/sendMessageOnL2.ts +++ b/postman/scripts/sendMessageOnL2.ts @@ -2,9 +2,9 @@ import { ContractTransactionReceipt, Overrides, JsonRpcProvider, Wallet } from " import { config } from "dotenv"; import yargs from "yargs"; import { hideBin } from "yargs/helpers"; +import { L2MessageService, L2MessageService__factory } from "@consensys/linea-sdk"; import { SendMessageArgs } from "./types"; import { sanitizeAddress, sanitizePrivKey } from "./cli"; -import { L2MessageService, L2MessageService__factory } from "../src/clients/blockchain/typechain"; config(); diff --git a/sdk/scripts/types.ts b/postman/scripts/types.ts similarity index 100% rename from sdk/scripts/types.ts rename to postman/scripts/types.ts diff --git a/sdk/src/application/postman/app/PostmanServiceClient.ts b/postman/src/application/postman/app/PostmanServiceClient.ts similarity index 67% rename from sdk/src/application/postman/app/PostmanServiceClient.ts rename to postman/src/application/postman/app/PostmanServiceClient.ts index 3bb7f0062..ac8ae45f0 100644 --- a/sdk/src/application/postman/app/PostmanServiceClient.ts +++ b/postman/src/application/postman/app/PostmanServiceClient.ts @@ -1,38 +1,28 @@ -import { Wallet, JsonRpcProvider } from "ethers"; import { DataSource } from "typeorm"; +import { LineaSDK, Direction } from "@consensys/linea-sdk"; import { ILogger } from "../../../core/utils/logging/ILogger"; -import { DatabaseCleaner } from "../../../services/persistence/DatabaseCleaner"; import { TypeOrmMessageRepository } from "../persistence/repositories/TypeOrmMessageRepository"; -import { LineaRollupClient } from "../../../clients/blockchain/ethereum/LineaRollupClient"; -import { L2MessageServiceClient } from "../../../clients/blockchain/linea/L2MessageServiceClient"; -import { EthersLineaRollupLogClient } from "../../../clients/blockchain/ethereum/EthersLineaRollupLogClient"; -import { ChainQuerier } from "../../../clients/blockchain/ChainQuerier"; import { WinstonLogger } from "../../../utils/WinstonLogger"; -import { EthersL2MessageServiceLogClient } from "../../../clients/blockchain/linea/EthersL2MessageServiceLogClient"; -import { MessageSentEventPoller } from "../../../services/pollers/MessageSentEventPoller"; import { IPoller } from "../../../core/services/pollers/IPoller"; -import { MessageAnchoringPoller } from "../../../services/pollers/MessageAnchoringPoller"; -import { MessageAnchoringProcessor } from "../../../services/processors/MessageAnchoringProcessor"; +import { + MessageAnchoringProcessor, + MessageClaimingProcessor, + MessageClaimingPersister, + MessageSentEventProcessor, + L2ClaimMessageTransactionSizeProcessor, +} from "../../../services/processors"; import { PostmanOptions } from "./config/config"; import { DB } from "../persistence/dataSource"; -import { Direction } from "../../../core/enums/MessageEnums"; -import { MessageClaimingProcessor } from "../../../services/processors/MessageClaimingProcessor"; -import { MessageClaimingPoller } from "../../../services/pollers/MessageClaimingPoller"; -import { MessageClaimingPersister } from "../../../services/processors/MessageClaimingPersister"; -import { MessagePersistingPoller } from "../../../services/pollers/MessagePersistingPoller"; -import { MessageSentEventProcessor } from "../../../services/processors/MessageSentEventProcessor"; -import { DatabaseCleaningPoller } from "../../../services/pollers/DatabaseCleaningPoller"; -import { BaseError } from "../../../core/errors/Base"; -import { LineaRollupMessageRetriever } from "../../../clients/blockchain/ethereum/LineaRollupMessageRetriever"; -import { L2MessageServiceMessageRetriever } from "../../../clients/blockchain/linea/L2MessageServiceMessageRetriever"; -import { MerkleTreeService } from "../../../clients/blockchain/ethereum/MerkleTreeService"; -import { LineaMessageDBService } from "../../../services/persistence/LineaMessageDBService"; -import { L2ChainQuerier } from "../../../clients/blockchain/linea/L2ChainQuerier"; -import { EthereumMessageDBService } from "../../../services/persistence/EthereumMessageDBService"; -import { L2ClaimMessageTransactionSizePoller } from "../../../services/pollers/L2ClaimMessageTransactionSizePoller"; -import { L2ClaimMessageTransactionSizeProcessor } from "../../../services/processors/L2ClaimMessageTransactionSizeProcessor"; +import { + MessageSentEventPoller, + MessageAnchoringPoller, + MessageClaimingPoller, + MessagePersistingPoller, + DatabaseCleaningPoller, + L2ClaimMessageTransactionSizePoller, +} from "../../../services/pollers"; +import { DatabaseCleaner, LineaMessageDBService, EthereumMessageDBService } from "../../../services/persistence"; import { L2ClaimTransactionSizeCalculator } from "../../../services/L2ClaimTransactionSizeCalculator"; -import { GasProvider } from "../../../clients/blockchain/gas/GasProvider"; import { LineaTransactionValidationService } from "../../../services/LineaTransactionValidationService"; import { EthereumTransactionValidationService } from "../../../services/EthereumTransactionValidationService"; import { getConfig } from "./config/utils"; @@ -72,85 +62,50 @@ export class PostmanServiceClient { this.l1L2AutoClaimEnabled = config.l1L2AutoClaimEnabled; this.l2L1AutoClaimEnabled = config.l2L1AutoClaimEnabled; - const l1Provider = new JsonRpcProvider(config.l1Config.rpcUrl); - const l2Provider = new JsonRpcProvider(config.l2Config.rpcUrl); - - const l1Signer = this.getSigner(config.l1Config.claiming.signerPrivateKey, l1Provider); - const l2Signer = this.getSigner(config.l2Config.claiming.signerPrivateKey, l2Provider); - - const l1Querier = new ChainQuerier(l1Provider, l1Signer); - const l2Querier = new L2ChainQuerier(l2Provider, l2Signer); - - const lineaRollupLogClient = new EthersLineaRollupLogClient( - l1Provider, - config.l1Config.messageServiceContractAddress, - ); - const l2MessageServiceLogClient = new EthersL2MessageServiceLogClient( - l2Provider, - config.l2Config.messageServiceContractAddress, - ); - - const l1GasProvider = new GasProvider(l1Querier, { - maxFeePerGas: config.l1Config.claiming.maxFeePerGas, - gasEstimationPercentile: config.l1Config.claiming.gasEstimationPercentile, - enforceMaxGasFee: config.l1Config.claiming.isMaxGasFeeEnforced, - enableLineaEstimateGas: false, - direction: Direction.L2_TO_L1, + const lineaSdk = new LineaSDK({ + l1RpcUrlOrProvider: config.l1Config.rpcUrl, + l2RpcUrlOrProvider: config.l2Config.rpcUrl, + l1SignerPrivateKeyOrWallet: config.l1Config.claiming.signerPrivateKey, + l2SignerPrivateKeyOrWallet: config.l2Config.claiming.signerPrivateKey, + network: "custom", + mode: "read-write", + l1FeeEstimatorOptions: { + gasFeeEstimationPercentile: config.l1Config.claiming.gasEstimationPercentile, + maxFeePerGasCap: config.l1Config.claiming.maxFeePerGasCap, + enforceMaxGasFee: config.l1Config.claiming.isMaxGasFeeEnforced, + }, + l2FeeEstimatorOptions: { + gasFeeEstimationPercentile: config.l2Config.claiming.gasEstimationPercentile, + maxFeePerGasCap: config.l2Config.claiming.maxFeePerGasCap, + enforceMaxGasFee: config.l2Config.claiming.isMaxGasFeeEnforced, + enableLineaEstimateGas: config.l2Config.enableLineaEstimateGas, + }, }); - const l2GasProvider = new GasProvider(l2Querier, { - maxFeePerGas: config.l2Config.claiming.maxFeePerGas, - gasEstimationPercentile: config.l2Config.claiming.gasEstimationPercentile, - enforceMaxGasFee: config.l2Config.claiming.isMaxGasFeeEnforced, - enableLineaEstimateGas: config.l2Config.enableLineaEstimateGas, - direction: Direction.L1_TO_L2, - }); + const l1Provider = lineaSdk.getL1Provider(config.l1Config.rpcUrl); + const l2Provider = lineaSdk.getL2Provider(config.l2Config.rpcUrl); - const lineaRollupMessageRetriever = new LineaRollupMessageRetriever( - l1Querier, - lineaRollupLogClient, - config.l1Config.messageServiceContractAddress, - ); + const l1Signer = lineaSdk.getL1Signer(); + const l2Signer = lineaSdk.getL2Signer(); - const l1MerkleTreeService = new MerkleTreeService( - l1Querier, + const lineaRollupClient = lineaSdk.getL1Contract( config.l1Config.messageServiceContractAddress, - lineaRollupLogClient, - l2MessageServiceLogClient, - config.l2Config.l2MessageTreeDepth, - ); - - const l2MessageServiceMessageRetriever = new L2MessageServiceMessageRetriever( - l2Querier, - l2MessageServiceLogClient, config.l2Config.messageServiceContractAddress, ); - const l1MessageServiceContract = new LineaRollupClient( - l1Querier, - config.l1Config.messageServiceContractAddress, - lineaRollupLogClient, - l2MessageServiceLogClient, - l1GasProvider, - lineaRollupMessageRetriever, - l1MerkleTreeService, - "read-write", - l1Signer, - ); + const l2MessageServiceClient = lineaSdk.getL2Contract(config.l2Config.messageServiceContractAddress); - const l2MessageServiceContract = new L2MessageServiceClient( - l2Querier, + const lineaRollupLogClient = lineaSdk.getL1ContractEventLogClient(config.l1Config.messageServiceContractAddress); + const l2MessageServiceLogClient = lineaSdk.getL2ContractEventLogClient( config.l2Config.messageServiceContractAddress, - l2MessageServiceMessageRetriever, - l2GasProvider, - "read-write", - l2Signer, ); + const l1GasProvider = lineaSdk.getL1GasProvider(); + this.db = DB.create(config.databaseOptions); const messageRepository = new TypeOrmMessageRepository(this.db); - const lineaMessageDBService = new LineaMessageDBService(l2Querier, messageRepository); + const lineaMessageDBService = new LineaMessageDBService(l2Provider, messageRepository); const ethereumMessageDBService = new EthereumMessageDBService(l1GasProvider, messageRepository); // L1 -> L2 flow @@ -158,7 +113,7 @@ export class PostmanServiceClient { const l1MessageSentEventProcessor = new MessageSentEventProcessor( lineaMessageDBService, lineaRollupLogClient, - l1Querier, + l1Provider, { direction: Direction.L1_TO_L2, maxBlocksToFetchLogs: config.l1Config.listener.maxBlocksToFetchLogs, @@ -171,7 +126,7 @@ export class PostmanServiceClient { this.l1MessageSentEventPoller = new MessageSentEventPoller( l1MessageSentEventProcessor, - l1Querier, + l1Provider, lineaMessageDBService, { direction: Direction.L1_TO_L2, @@ -183,8 +138,8 @@ export class PostmanServiceClient { ); const l2MessageAnchoringProcessor = new MessageAnchoringProcessor( - l2MessageServiceContract, - l2Querier, + l2MessageServiceClient, + l2Provider, lineaMessageDBService, { maxFetchMessagesFromDb: config.l1Config.listener.maxFetchMessagesFromDb, @@ -207,13 +162,13 @@ export class PostmanServiceClient { profitMargin: config.l2Config.claiming.profitMargin, maxClaimGasLimit: BigInt(config.l2Config.claiming.maxClaimGasLimit), }, - l2Querier, - l2MessageServiceContract, + l2Provider, + l2MessageServiceClient, ); const l2MessageClaimingProcessor = new MessageClaimingProcessor( - l2MessageServiceContract, - l2Querier, + l2MessageServiceClient, + l2Signer, lineaMessageDBService, l2TransactionValidationService, { @@ -240,8 +195,8 @@ export class PostmanServiceClient { const l2MessageClaimingPersister = new MessageClaimingPersister( lineaMessageDBService, - l2MessageServiceContract, - l2Querier, + l2MessageServiceClient, + l2Provider, { direction: Direction.L1_TO_L2, messageSubmissionTimeout: config.l2Config.claiming.messageSubmissionTimeout, @@ -259,10 +214,10 @@ export class PostmanServiceClient { new WinstonLogger(`L2${MessagePersistingPoller.name}`, config.loggerOptions), ); - const transactionSizeCalculator = new L2ClaimTransactionSizeCalculator(l2MessageServiceContract); + const transactionSizeCalculator = new L2ClaimTransactionSizeCalculator(l2MessageServiceClient); const transactionSizeCompressor = new L2ClaimMessageTransactionSizeProcessor( lineaMessageDBService, - l2MessageServiceContract, + l2MessageServiceClient, transactionSizeCalculator, { direction: Direction.L1_TO_L2, @@ -283,7 +238,7 @@ export class PostmanServiceClient { const l2MessageSentEventProcessor = new MessageSentEventProcessor( ethereumMessageDBService, l2MessageServiceLogClient, - l2Querier, + l2Provider, { direction: Direction.L2_TO_L1, maxBlocksToFetchLogs: config.l2Config.listener.maxBlocksToFetchLogs, @@ -296,7 +251,7 @@ export class PostmanServiceClient { this.l2MessageSentEventPoller = new MessageSentEventPoller( l2MessageSentEventProcessor, - l2Querier, + l2Provider, ethereumMessageDBService, { direction: Direction.L2_TO_L1, @@ -308,8 +263,8 @@ export class PostmanServiceClient { ); const l1MessageAnchoringProcessor = new MessageAnchoringProcessor( - l1MessageServiceContract, - l1Querier, + lineaRollupClient, + l1Provider, ethereumMessageDBService, { maxFetchMessagesFromDb: config.l1Config.listener.maxFetchMessagesFromDb, @@ -327,18 +282,14 @@ export class PostmanServiceClient { new WinstonLogger(`L1${MessageAnchoringPoller.name}`, config.loggerOptions), ); - const l1TransactionValidationService = new EthereumTransactionValidationService( - l1MessageServiceContract, - l1GasProvider, - { - profitMargin: config.l1Config.claiming.profitMargin, - maxClaimGasLimit: BigInt(config.l1Config.claiming.maxClaimGasLimit), - }, - ); + const l1TransactionValidationService = new EthereumTransactionValidationService(lineaRollupClient, l1GasProvider, { + profitMargin: config.l1Config.claiming.profitMargin, + maxClaimGasLimit: BigInt(config.l1Config.claiming.maxClaimGasLimit), + }); const l1MessageClaimingProcessor = new MessageClaimingProcessor( - l1MessageServiceContract, - l1Querier, + lineaRollupClient, + l1Signer, ethereumMessageDBService, l1TransactionValidationService, { @@ -365,8 +316,8 @@ export class PostmanServiceClient { const l1MessageClaimingPersister = new MessageClaimingPersister( ethereumMessageDBService, - l1MessageServiceContract, - l1Querier, + lineaRollupClient, + l1Provider, { direction: Direction.L2_TO_L1, messageSubmissionTimeout: config.l1Config.claiming.messageSubmissionTimeout, @@ -401,23 +352,6 @@ export class PostmanServiceClient { ); } - /** - * Creates a Wallet instance as a signer using the provided private key and JSON RPC provider. - * - * @param {string} privateKey - The private key to use for the signer. - * @param {JsonRpcProvider} provider - The JSON RPC provider associated with the network. - * @returns {Wallet} A Wallet instance configured with the provided private key and provider. - */ - private getSigner(privateKey: string, provider: JsonRpcProvider): Wallet { - try { - return new Wallet(privateKey, provider); - } catch (e) { - throw new BaseError( - "Something went wrong when trying to generate Wallet. Please check your private key and the provider url.", - ); - } - } - /** * Initializes the database connection using the configuration provided. */ diff --git a/sdk/src/application/postman/app/__tests__/PostmanServiceClient.test.ts b/postman/src/application/postman/app/__tests__/PostmanServiceClient.test.ts similarity index 94% rename from sdk/src/application/postman/app/__tests__/PostmanServiceClient.test.ts rename to postman/src/application/postman/app/__tests__/PostmanServiceClient.test.ts index 911f3f6d2..4a55d95a1 100644 --- a/sdk/src/application/postman/app/__tests__/PostmanServiceClient.test.ts +++ b/postman/src/application/postman/app/__tests__/PostmanServiceClient.test.ts @@ -54,7 +54,7 @@ const postmanServiceClientOptions: PostmanOptions = { signerPrivateKey: TEST_L1_SIGNER_PRIVATE_KEY, messageSubmissionTimeout: 300000, maxNonceDiff: 10000, - maxFeePerGas: 100000000000n, + maxFeePerGasCap: 100000000000n, gasEstimationPercentile: 50, profitMargin: 1.0, maxNumberOfRetries: 100, @@ -75,7 +75,7 @@ const postmanServiceClientOptions: PostmanOptions = { signerPrivateKey: TEST_L2_SIGNER_PRIVATE_KEY, messageSubmissionTimeout: 300000, maxNonceDiff: 10000, - maxFeePerGas: 100000000000n, + maxFeePerGasCap: 100000000000n, gasEstimationPercentile: 50, profitMargin: 1.0, maxNumberOfRetries: 100, @@ -119,15 +119,20 @@ describe("PostmanServiceClient", () => { ...postmanServiceClientOptions.l1Options, claiming: { ...postmanServiceClientOptions.l1Options.claiming, - signerPrivateKey: "", + signerPrivateKey: "0x", + }, + }, + l2Options: { + ...postmanServiceClientOptions.l2Options, + claiming: { + ...postmanServiceClientOptions.l2Options.claiming, + signerPrivateKey: "0x", }, }, }; expect(() => new PostmanServiceClient(postmanServiceClientOptionsWithInvalidPrivateKey)).toThrow( - new Error( - "Something went wrong when trying to generate Wallet. Please check your private key and the provider url.", - ), + new Error("Something went wrong when trying to generate Wallet. Please check your private key."), ); }); }); diff --git a/sdk/src/application/postman/app/config/__tests__/utils.test.ts b/postman/src/application/postman/app/config/__tests__/utils.test.ts similarity index 97% rename from sdk/src/application/postman/app/config/__tests__/utils.test.ts rename to postman/src/application/postman/app/config/__tests__/utils.test.ts index 00152a6ba..d0c7a6b7f 100644 --- a/sdk/src/application/postman/app/config/__tests__/utils.test.ts +++ b/postman/src/application/postman/app/config/__tests__/utils.test.ts @@ -23,7 +23,7 @@ import { DEFAULT_LISTENER_INTERVAL, DEFAULT_MAX_BLOCKS_TO_FETCH_LOGS, DEFAULT_MAX_CLAIM_GAS_LIMIT, - DEFAULT_MAX_FEE_PER_GAS, + DEFAULT_MAX_FEE_PER_GAS_CAP, DEFAULT_MAX_FETCH_MESSAGES_FROM_DB, DEFAULT_MAX_NONCE_DIFF, DEFAULT_MAX_NUMBER_OF_RETRIES, @@ -74,7 +74,7 @@ describe("Config utils", () => { gasEstimationPercentile: DEFAULT_GAS_ESTIMATION_PERCENTILE, isMaxGasFeeEnforced: DEFAULT_ENFORCE_MAX_GAS_FEE, maxClaimGasLimit: DEFAULT_MAX_CLAIM_GAS_LIMIT, - maxFeePerGas: DEFAULT_MAX_FEE_PER_GAS, + maxFeePerGasCap: DEFAULT_MAX_FEE_PER_GAS_CAP, maxNonceDiff: DEFAULT_MAX_NONCE_DIFF, maxNumberOfRetries: DEFAULT_MAX_NUMBER_OF_RETRIES, maxTxRetries: DEFAULT_MAX_TX_RETRIES, @@ -102,7 +102,7 @@ describe("Config utils", () => { gasEstimationPercentile: DEFAULT_GAS_ESTIMATION_PERCENTILE, isMaxGasFeeEnforced: DEFAULT_ENFORCE_MAX_GAS_FEE, maxClaimGasLimit: DEFAULT_MAX_CLAIM_GAS_LIMIT, - maxFeePerGas: DEFAULT_MAX_FEE_PER_GAS, + maxFeePerGasCap: DEFAULT_MAX_FEE_PER_GAS_CAP, maxNonceDiff: DEFAULT_MAX_NONCE_DIFF, maxNumberOfRetries: DEFAULT_MAX_NUMBER_OF_RETRIES, maxTxRetries: DEFAULT_MAX_TX_RETRIES, @@ -179,7 +179,7 @@ describe("Config utils", () => { gasEstimationPercentile: DEFAULT_GAS_ESTIMATION_PERCENTILE, isMaxGasFeeEnforced: DEFAULT_ENFORCE_MAX_GAS_FEE, maxClaimGasLimit: DEFAULT_MAX_CLAIM_GAS_LIMIT, - maxFeePerGas: DEFAULT_MAX_FEE_PER_GAS, + maxFeePerGasCap: DEFAULT_MAX_FEE_PER_GAS_CAP, maxNonceDiff: DEFAULT_MAX_NONCE_DIFF, maxNumberOfRetries: DEFAULT_MAX_NUMBER_OF_RETRIES, maxTxRetries: DEFAULT_MAX_TX_RETRIES, @@ -207,7 +207,7 @@ describe("Config utils", () => { gasEstimationPercentile: DEFAULT_GAS_ESTIMATION_PERCENTILE, isMaxGasFeeEnforced: DEFAULT_ENFORCE_MAX_GAS_FEE, maxClaimGasLimit: DEFAULT_MAX_CLAIM_GAS_LIMIT, - maxFeePerGas: DEFAULT_MAX_FEE_PER_GAS, + maxFeePerGasCap: DEFAULT_MAX_FEE_PER_GAS_CAP, maxNonceDiff: DEFAULT_MAX_NONCE_DIFF, maxNumberOfRetries: DEFAULT_MAX_NUMBER_OF_RETRIES, maxTxRetries: DEFAULT_MAX_TX_RETRIES, diff --git a/sdk/src/application/postman/app/config/config.ts b/postman/src/application/postman/app/config/config.ts similarity index 99% rename from sdk/src/application/postman/app/config/config.ts rename to postman/src/application/postman/app/config/config.ts index c92b89515..4372de974 100644 --- a/sdk/src/application/postman/app/config/config.ts +++ b/postman/src/application/postman/app/config/config.ts @@ -76,7 +76,7 @@ export type ClaimingOptions = { messageSubmissionTimeout?: number; feeRecipientAddress?: string; maxNonceDiff?: number; - maxFeePerGas?: bigint; + maxFeePerGasCap?: bigint; gasEstimationPercentile?: number; isMaxGasFeeEnforced?: boolean; profitMargin?: number; diff --git a/sdk/src/application/postman/app/config/utils.ts b/postman/src/application/postman/app/config/utils.ts similarity index 96% rename from sdk/src/application/postman/app/config/utils.ts rename to postman/src/application/postman/app/config/utils.ts index dca821154..68f863e27 100644 --- a/sdk/src/application/postman/app/config/utils.ts +++ b/postman/src/application/postman/app/config/utils.ts @@ -8,7 +8,7 @@ import { DEFAULT_LISTENER_INTERVAL, DEFAULT_MAX_BLOCKS_TO_FETCH_LOGS, DEFAULT_MAX_CLAIM_GAS_LIMIT, - DEFAULT_MAX_FEE_PER_GAS, + DEFAULT_MAX_FEE_PER_GAS_CAP, DEFAULT_MAX_FETCH_MESSAGES_FROM_DB, DEFAULT_MAX_NONCE_DIFF, DEFAULT_MAX_NUMBER_OF_RETRIES, @@ -54,7 +54,7 @@ export function getConfig(postmanOptions: PostmanOptions): PostmanConfig { messageSubmissionTimeout: l1Options.claiming.messageSubmissionTimeout ?? DEFAULT_MESSAGE_SUBMISSION_TIMEOUT, feeRecipientAddress: l1Options.claiming.feeRecipientAddress, maxNonceDiff: l1Options.claiming.maxNonceDiff ?? DEFAULT_MAX_NONCE_DIFF, - maxFeePerGas: l1Options.claiming.maxFeePerGas ?? DEFAULT_MAX_FEE_PER_GAS, + maxFeePerGasCap: l1Options.claiming.maxFeePerGasCap ?? DEFAULT_MAX_FEE_PER_GAS_CAP, gasEstimationPercentile: l1Options.claiming.gasEstimationPercentile ?? DEFAULT_GAS_ESTIMATION_PERCENTILE, isMaxGasFeeEnforced: l1Options.claiming.isMaxGasFeeEnforced ?? false, profitMargin: l1Options.claiming.profitMargin ?? DEFAULT_PROFIT_MARGIN, @@ -83,7 +83,7 @@ export function getConfig(postmanOptions: PostmanOptions): PostmanConfig { messageSubmissionTimeout: l2Options.claiming.messageSubmissionTimeout ?? DEFAULT_MESSAGE_SUBMISSION_TIMEOUT, feeRecipientAddress: l2Options.claiming.feeRecipientAddress, maxNonceDiff: l2Options.claiming.maxNonceDiff ?? DEFAULT_MAX_NONCE_DIFF, - maxFeePerGas: l2Options.claiming.maxFeePerGas ?? DEFAULT_MAX_FEE_PER_GAS, + maxFeePerGasCap: l2Options.claiming.maxFeePerGasCap ?? DEFAULT_MAX_FEE_PER_GAS_CAP, gasEstimationPercentile: l2Options.claiming.gasEstimationPercentile ?? DEFAULT_GAS_ESTIMATION_PERCENTILE, isMaxGasFeeEnforced: l2Options.claiming.isMaxGasFeeEnforced ?? false, profitMargin: l2Options.claiming.profitMargin ?? DEFAULT_PROFIT_MARGIN, diff --git a/sdk/src/application/postman/persistence/config/types.ts b/postman/src/application/postman/persistence/config/types.ts similarity index 100% rename from sdk/src/application/postman/persistence/config/types.ts rename to postman/src/application/postman/persistence/config/types.ts diff --git a/sdk/src/application/postman/persistence/dataSource.ts b/postman/src/application/postman/persistence/dataSource.ts similarity index 100% rename from sdk/src/application/postman/persistence/dataSource.ts rename to postman/src/application/postman/persistence/dataSource.ts diff --git a/sdk/src/application/postman/persistence/entities/Message.entity.ts b/postman/src/application/postman/persistence/entities/Message.entity.ts similarity index 94% rename from sdk/src/application/postman/persistence/entities/Message.entity.ts rename to postman/src/application/postman/persistence/entities/Message.entity.ts index bc32c3a40..b8c054453 100644 --- a/sdk/src/application/postman/persistence/entities/Message.entity.ts +++ b/postman/src/application/postman/persistence/entities/Message.entity.ts @@ -1,6 +1,7 @@ import { IsDate, IsDecimal, IsEnum, IsNumber, IsString } from "class-validator"; import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn } from "typeorm"; -import { Direction, MessageStatus } from "../../../../core/enums/MessageEnums"; +import { Direction } from "@consensys/linea-sdk"; +import { MessageStatus } from "../../../../core/enums"; @Entity({ name: "message" }) export class MessageEntity { diff --git a/sdk/src/application/postman/persistence/mappers/__tests__/messageMappers.test.ts b/postman/src/application/postman/persistence/mappers/__tests__/messageMappers.test.ts similarity index 96% rename from sdk/src/application/postman/persistence/mappers/__tests__/messageMappers.test.ts rename to postman/src/application/postman/persistence/mappers/__tests__/messageMappers.test.ts index 810630cdf..56a4bde78 100644 --- a/sdk/src/application/postman/persistence/mappers/__tests__/messageMappers.test.ts +++ b/postman/src/application/postman/persistence/mappers/__tests__/messageMappers.test.ts @@ -1,4 +1,5 @@ import { describe, it, expect } from "@jest/globals"; +import { Direction } from "@consensys/linea-sdk"; import { generateMessage, generateMessageEntity } from "../../../../../utils/testing/helpers"; import { mapMessageEntityToMessage, mapMessageToMessageEntity } from "../messageMappers"; import { @@ -7,7 +8,7 @@ import { TEST_CONTRACT_ADDRESS_2, TEST_MESSAGE_HASH, } from "../../../../../utils/testing/constants"; -import { Direction, MessageStatus } from "../../../../../core/enums/MessageEnums"; +import { MessageStatus } from "../../../../../core/enums"; import { Message } from "../../../../../core/entities/Message"; describe("Message Mappers", () => { diff --git a/sdk/src/application/postman/persistence/mappers/messageMappers.ts b/postman/src/application/postman/persistence/mappers/messageMappers.ts similarity index 100% rename from sdk/src/application/postman/persistence/mappers/messageMappers.ts rename to postman/src/application/postman/persistence/mappers/messageMappers.ts diff --git a/sdk/src/application/postman/persistence/migrations/1685985945638-InitialDatabaseSetup.ts b/postman/src/application/postman/persistence/migrations/1685985945638-InitialDatabaseSetup.ts similarity index 100% rename from sdk/src/application/postman/persistence/migrations/1685985945638-InitialDatabaseSetup.ts rename to postman/src/application/postman/persistence/migrations/1685985945638-InitialDatabaseSetup.ts diff --git a/sdk/src/application/postman/persistence/migrations/1687890326970-AddNewColumns.ts b/postman/src/application/postman/persistence/migrations/1687890326970-AddNewColumns.ts similarity index 100% rename from sdk/src/application/postman/persistence/migrations/1687890326970-AddNewColumns.ts rename to postman/src/application/postman/persistence/migrations/1687890326970-AddNewColumns.ts diff --git a/sdk/src/application/postman/persistence/migrations/1687890694496-UpdateStatusColumn.ts b/postman/src/application/postman/persistence/migrations/1687890694496-UpdateStatusColumn.ts similarity index 100% rename from sdk/src/application/postman/persistence/migrations/1687890694496-UpdateStatusColumn.ts rename to postman/src/application/postman/persistence/migrations/1687890694496-UpdateStatusColumn.ts diff --git a/sdk/src/application/postman/persistence/migrations/1689084924789-RemoveUniqueConstraint.ts b/postman/src/application/postman/persistence/migrations/1689084924789-RemoveUniqueConstraint.ts similarity index 100% rename from sdk/src/application/postman/persistence/migrations/1689084924789-RemoveUniqueConstraint.ts rename to postman/src/application/postman/persistence/migrations/1689084924789-RemoveUniqueConstraint.ts diff --git a/sdk/src/application/postman/persistence/migrations/1701265652528-AddNewIndexes.ts b/postman/src/application/postman/persistence/migrations/1701265652528-AddNewIndexes.ts similarity index 100% rename from sdk/src/application/postman/persistence/migrations/1701265652528-AddNewIndexes.ts rename to postman/src/application/postman/persistence/migrations/1701265652528-AddNewIndexes.ts diff --git a/sdk/src/application/postman/persistence/migrations/1709901138056-AddUniqueConstraint.ts b/postman/src/application/postman/persistence/migrations/1709901138056-AddUniqueConstraint.ts similarity index 100% rename from sdk/src/application/postman/persistence/migrations/1709901138056-AddUniqueConstraint.ts rename to postman/src/application/postman/persistence/migrations/1709901138056-AddUniqueConstraint.ts diff --git a/sdk/src/application/postman/persistence/migrations/1718026260629-AddCompressedTxSizeColumn.ts b/postman/src/application/postman/persistence/migrations/1718026260629-AddCompressedTxSizeColumn.ts similarity index 100% rename from sdk/src/application/postman/persistence/migrations/1718026260629-AddCompressedTxSizeColumn.ts rename to postman/src/application/postman/persistence/migrations/1718026260629-AddCompressedTxSizeColumn.ts diff --git a/sdk/src/application/postman/persistence/repositories/TypeOrmMessageRepository.ts b/postman/src/application/postman/persistence/repositories/TypeOrmMessageRepository.ts similarity index 97% rename from sdk/src/application/postman/persistence/repositories/TypeOrmMessageRepository.ts rename to postman/src/application/postman/persistence/repositories/TypeOrmMessageRepository.ts index f2093db88..d4557ced3 100644 --- a/sdk/src/application/postman/persistence/repositories/TypeOrmMessageRepository.ts +++ b/postman/src/application/postman/persistence/repositories/TypeOrmMessageRepository.ts @@ -1,13 +1,13 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { Brackets, DataSource, Repository } from "typeorm"; +import { ContractTransactionResponse } from "ethers"; +import { Direction } from "@consensys/linea-sdk"; import { Message } from "../../../../core/entities/Message"; import { mapMessageEntityToMessage, mapMessageToMessageEntity } from "../mappers/messageMappers"; -import { Direction, MessageStatus } from "../../../../core/enums/MessageEnums"; -import { DatabaseErrorType, DatabaseRepoName } from "../../../../core/enums/DatabaseEnums"; -import { DatabaseAccessError } from "../../../../core/errors/DatabaseErrors"; +import { DatabaseErrorType, DatabaseRepoName, MessageStatus } from "../../../../core/enums"; +import { DatabaseAccessError } from "../../../../core/errors"; import { MessageEntity } from "../entities/Message.entity"; import { subtractSeconds } from "../../../../core/utils/shared"; -import { ContractTransactionResponse } from "ethers"; import { IMessageRepository } from "../../../../core/persistence/IMessageRepository"; export class TypeOrmMessageRepository diff --git a/sdk/src/core/clients/blockchain/IGasProvider.ts b/postman/src/core/clients/blockchain/IGasProvider.ts similarity index 94% rename from sdk/src/core/clients/blockchain/IGasProvider.ts rename to postman/src/core/clients/blockchain/IGasProvider.ts index 414471e76..094d36a7b 100644 --- a/sdk/src/core/clients/blockchain/IGasProvider.ts +++ b/postman/src/core/clients/blockchain/IGasProvider.ts @@ -1,4 +1,4 @@ -import { Direction } from "../../enums/MessageEnums"; +import { Direction } from "@consensys/linea-sdk"; export type GasFees = { maxFeePerGas: bigint; @@ -23,7 +23,7 @@ export type LineaEstimateGasResponse = { }; type BaseGasProviderConfig = { - maxFeePerGas: bigint; + maxFeePerGasCap: bigint; enforceMaxGasFee: boolean; }; diff --git a/sdk/src/core/clients/blockchain/IChainQuerier.ts b/postman/src/core/clients/blockchain/IProvider.ts similarity index 55% rename from sdk/src/core/clients/blockchain/IChainQuerier.ts rename to postman/src/core/clients/blockchain/IProvider.ts index 8d06323fd..1cd458ae1 100644 --- a/sdk/src/core/clients/blockchain/IChainQuerier.ts +++ b/postman/src/core/clients/blockchain/IProvider.ts @@ -1,16 +1,16 @@ import { GasFees } from "./IGasProvider"; -export interface IChainQuerier { - getCurrentNonce(accountAddress?: string): Promise; - getCurrentBlockNumber(): Promise; +export interface IProvider { + getTransactionCount(address: string, blockTag: string | number | bigint): Promise; + getBlockNumber(): Promise; getTransactionReceipt(txHash: string): Promise; getBlock(blockNumber: number | bigint | string): Promise; // eslint-disable-next-line @typescript-eslint/no-explicit-any - sendRequest(methodName: string, params: any[]): Promise; + send(methodName: string, params: Array | Record): Promise; estimateGas(transactionRequest: TransactionRequest): Promise; - getProvider(): JsonRpcProvider; getTransaction(transactionHash: string): Promise; broadcastTransaction(signedTx: string): Promise; - ethCall(transactionRequest: TransactionRequest): Promise; + call(transactionRequest: TransactionRequest): Promise; getFees(): Promise; + get provider(): Provider; } diff --git a/sdk/src/core/clients/blockchain/ethereum/ILineaRollupClient.ts b/postman/src/core/clients/blockchain/ethereum/ILineaRollupClient.ts similarity index 76% rename from sdk/src/core/clients/blockchain/ethereum/ILineaRollupClient.ts rename to postman/src/core/clients/blockchain/ethereum/ILineaRollupClient.ts index 3e36b0e70..2f50c9f64 100644 --- a/sdk/src/core/clients/blockchain/ethereum/ILineaRollupClient.ts +++ b/postman/src/core/clients/blockchain/ethereum/ILineaRollupClient.ts @@ -1,11 +1,21 @@ import { MessageProps } from "../../../entities/Message"; -import { OnChainMessageStatus } from "../../../enums/MessageEnums"; +import { MessageSent, OnChainMessageStatus } from "@consensys/linea-sdk"; import { IMessageServiceContract } from "../../../services/contracts/IMessageServiceContract"; -import { MessageSent } from "../../../types/Events"; import { FinalizationMessagingInfo, Proof } from "./IMerkleTreeService"; -export interface ILineaRollupClient - extends IMessageServiceContract { +export interface ILineaRollupClient< + Overrides, + TransactionReceipt, + TransactionResponse, + ContractTransactionResponse, + ErrorDescription, +> extends IMessageServiceContract< + Overrides, + TransactionReceipt, + TransactionResponse, + ContractTransactionResponse, + ErrorDescription + > { getFinalizationMessagingInfo(transactionHash: string): Promise; getL2MessageHashesInBlockRange(fromBlock: number, toBlock: number): Promise; getMessageSiblings(messageHash: string, messageHashes: string[], treeDepth: number): string[]; diff --git a/sdk/src/core/clients/blockchain/ethereum/ILineaRollupLogClient.ts b/postman/src/core/clients/blockchain/ethereum/ILineaRollupLogClient.ts similarity index 96% rename from sdk/src/core/clients/blockchain/ethereum/ILineaRollupLogClient.ts rename to postman/src/core/clients/blockchain/ethereum/ILineaRollupLogClient.ts index 61e0a5578..9898d9642 100644 --- a/sdk/src/core/clients/blockchain/ethereum/ILineaRollupLogClient.ts +++ b/postman/src/core/clients/blockchain/ethereum/ILineaRollupLogClient.ts @@ -1,4 +1,4 @@ -import { L2MessagingBlockAnchored, MessageClaimed, MessageSent } from "../../../types/Events"; +import { L2MessagingBlockAnchored, MessageClaimed, MessageSent } from "@consensys/linea-sdk"; export type MessageSentEventFilters = { from?: string; diff --git a/sdk/src/core/clients/blockchain/ethereum/IMerkleTreeService.ts b/postman/src/core/clients/blockchain/ethereum/IMerkleTreeService.ts similarity index 100% rename from sdk/src/core/clients/blockchain/ethereum/IMerkleTreeService.ts rename to postman/src/core/clients/blockchain/ethereum/IMerkleTreeService.ts diff --git a/sdk/src/core/clients/blockchain/linea/IL2MessageServiceClient.ts b/postman/src/core/clients/blockchain/linea/IL2MessageServiceClient.ts similarity index 67% rename from sdk/src/core/clients/blockchain/linea/IL2MessageServiceClient.ts rename to postman/src/core/clients/blockchain/linea/IL2MessageServiceClient.ts index ae8014b2b..af07771a4 100644 --- a/sdk/src/core/clients/blockchain/linea/IL2MessageServiceClient.ts +++ b/postman/src/core/clients/blockchain/linea/IL2MessageServiceClient.ts @@ -1,5 +1,5 @@ -import { MessageSent } from "sdk/src/core/types/Events"; -import { MessageProps } from "../../../../core/entities/Message"; +import { MessageSent } from "@consensys/linea-sdk"; +import { MessageProps } from "../../../entities/Message"; import { IMessageServiceContract } from "../../../services/contracts/IMessageServiceContract"; import { LineaGasFees } from "../IGasProvider"; @@ -9,7 +9,14 @@ export interface IL2MessageServiceClient< TransactionResponse, ContractTransactionResponse, Signer, -> extends IMessageServiceContract { + ErrorDescription, +> extends IMessageServiceContract< + Overrides, + TransactionReceipt, + TransactionResponse, + ContractTransactionResponse, + ErrorDescription + > { encodeClaimMessageTransactionData(message: MessageProps & { feeRecipient?: string }): string; estimateClaimGasFees( message: (MessageSent | MessageProps) & { feeRecipient?: string }, diff --git a/sdk/src/core/clients/blockchain/linea/IL2MessageServiceLogClient.ts b/postman/src/core/clients/blockchain/linea/IL2MessageServiceLogClient.ts similarity index 91% rename from sdk/src/core/clients/blockchain/linea/IL2MessageServiceLogClient.ts rename to postman/src/core/clients/blockchain/linea/IL2MessageServiceLogClient.ts index 5a7dcf5b0..7820ecde4 100644 --- a/sdk/src/core/clients/blockchain/linea/IL2MessageServiceLogClient.ts +++ b/postman/src/core/clients/blockchain/linea/IL2MessageServiceLogClient.ts @@ -1,4 +1,4 @@ -import { MessageSent, ServiceVersionMigrated } from "../../../types/Events"; +import { MessageSent, ServiceVersionMigrated } from "@consensys/linea-sdk"; export type MessageSentEventFilters = { from?: string; diff --git a/postman/src/core/clients/blockchain/linea/ILineaProvider.ts b/postman/src/core/clients/blockchain/linea/ILineaProvider.ts new file mode 100644 index 000000000..964ba1aec --- /dev/null +++ b/postman/src/core/clients/blockchain/linea/ILineaProvider.ts @@ -0,0 +1,13 @@ +import { IProvider } from "../IProvider"; + +export type BlockExtraData = { + version: number; + fixedCost: number; + variableCost: number; + ethGasPrice: number; +}; + +export interface ILineaProvider + extends IProvider { + getBlockExtraData(blockNumber: number | bigint | string): Promise; +} diff --git a/postman/src/core/constants/blockchain.ts b/postman/src/core/constants/blockchain.ts new file mode 100644 index 000000000..b2c394627 --- /dev/null +++ b/postman/src/core/constants/blockchain.ts @@ -0,0 +1,4 @@ +export const ZERO_HASH = "0x0000000000000000000000000000000000000000000000000000000000000000"; +export const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"; + +export const MINIMUM_MARGIN = 1.2; diff --git a/postman/src/core/constants/common.ts b/postman/src/core/constants/common.ts new file mode 100644 index 000000000..0a6c79e79 --- /dev/null +++ b/postman/src/core/constants/common.ts @@ -0,0 +1,25 @@ +export const DEFAULT_MESSAGE_SUBMISSION_TIMEOUT = 300000; +export const DEFAULT_LISTENER_INTERVAL = 4000; +export const DEFAULT_DB_CLEANER_ENABLED = false; +export const DEFAULT_DB_CLEANING_INTERVAL = 43200000; +export const DEFAULT_DB_DAYS_BEFORE_NOW_TO_DELETE = 14; +export const DEFAULT_MAX_BLOCKS_TO_FETCH_LOGS = 1000; +export const DEFAULT_MAX_FETCH_MESSAGES_FROM_DB = 1000; +export const DEFAULT_MAX_NONCE_DIFF = 10000; +export const DEFAULT_MAX_FEE_PER_GAS_CAP = 100000000000n; +export const DEFAULT_ENFORCE_MAX_GAS_FEE = false; +export const DEFAULT_GAS_ESTIMATION_PERCENTILE = 20; +export const DEFAULT_GAS_LIMIT = 0; +export const DEFAULT_LISTENER_BLOCK_CONFIRMATIONS = 4; +export const DEFAULT_PROFIT_MARGIN = 1.0; +export const DEFAULT_MAX_NUMBER_OF_RETRIES = 100; +export const DEFAULT_RETRY_DELAY_IN_SECONDS = 30; +export const DEFAULT_EOA_ENABLED = false; +export const DEFAULT_CALLDATA_ENABLED = false; +export const DEFAULT_RATE_LIMIT_MARGIN = 0.95; +export const DEFAULT_MAX_CLAIM_GAS_LIMIT = 100_000n; +export const DEFAULT_MAX_TX_RETRIES = 20; +export const DEFAULT_L2_MESSAGE_TREE_DEPTH = 5; +export const DEFAULT_INITIAL_FROM_BLOCK = -1; + +export const PROFIT_MARGIN_MULTIPLIER = 100; diff --git a/postman/src/core/constants/index.ts b/postman/src/core/constants/index.ts new file mode 100644 index 000000000..1812e8643 --- /dev/null +++ b/postman/src/core/constants/index.ts @@ -0,0 +1,2 @@ +export * from "./common"; +export * from "./blockchain"; diff --git a/sdk/src/core/entities/Message.ts b/postman/src/core/entities/Message.ts similarity index 98% rename from sdk/src/core/entities/Message.ts rename to postman/src/core/entities/Message.ts index ef5243264..45dbab526 100644 --- a/sdk/src/core/entities/Message.ts +++ b/postman/src/core/entities/Message.ts @@ -1,4 +1,5 @@ -import { Direction, MessageStatus } from "../enums/MessageEnums"; +import { Direction } from "@consensys/linea-sdk"; +import { MessageStatus } from "../enums"; export type MessageProps = { id?: number; diff --git a/sdk/src/core/entities/MessageFactory.ts b/postman/src/core/entities/MessageFactory.ts similarity index 100% rename from sdk/src/core/entities/MessageFactory.ts rename to postman/src/core/entities/MessageFactory.ts diff --git a/sdk/src/core/enums/DatabaseEnums.ts b/postman/src/core/enums/DatabaseEnums.ts similarity index 100% rename from sdk/src/core/enums/DatabaseEnums.ts rename to postman/src/core/enums/DatabaseEnums.ts diff --git a/sdk/src/core/enums/MessageEnums.ts b/postman/src/core/enums/MessageEnums.ts similarity index 65% rename from sdk/src/core/enums/MessageEnums.ts rename to postman/src/core/enums/MessageEnums.ts index ed4958f4c..605308f9c 100644 --- a/sdk/src/core/enums/MessageEnums.ts +++ b/postman/src/core/enums/MessageEnums.ts @@ -1,8 +1,3 @@ -export enum Direction { - L1_TO_L2 = "L1_TO_L2", - L2_TO_L1 = "L2_TO_L1", -} - export enum MessageStatus { SENT = "SENT", TRANSACTION_SIZE_COMPUTED = "TRANSACTION_SIZE_COMPUTED", @@ -15,9 +10,3 @@ export enum MessageStatus { FEE_UNDERPRICED = "FEE_UNDERPRICED", EXCLUDED = "EXCLUDED", } - -export enum OnChainMessageStatus { - UNKNOWN = "UNKNOWN", - CLAIMABLE = "CLAIMABLE", - CLAIMED = "CLAIMED", -} diff --git a/postman/src/core/enums/index.ts b/postman/src/core/enums/index.ts new file mode 100644 index 000000000..bd307e529 --- /dev/null +++ b/postman/src/core/enums/index.ts @@ -0,0 +1,2 @@ +export { DatabaseErrorType, DatabaseRepoName } from "./DatabaseEnums"; +export { MessageStatus } from "./MessageEnums"; diff --git a/postman/src/core/errors/BaseError.ts b/postman/src/core/errors/BaseError.ts new file mode 100644 index 000000000..a2fc8afa3 --- /dev/null +++ b/postman/src/core/errors/BaseError.ts @@ -0,0 +1,11 @@ +export class BaseError extends Error { + reason?: BaseError | Error | string; + + override name = "PostmanCoreError"; + + constructor(message?: string) { + super(); + this.message = message || "An error occurred."; + Error.captureStackTrace(this, this.constructor); + } +} diff --git a/sdk/src/core/errors/DatabaseErrors.ts b/postman/src/core/errors/DatabaseErrors.ts similarity index 77% rename from sdk/src/core/errors/DatabaseErrors.ts rename to postman/src/core/errors/DatabaseErrors.ts index ddd799de2..cbad10689 100644 --- a/sdk/src/core/errors/DatabaseErrors.ts +++ b/postman/src/core/errors/DatabaseErrors.ts @@ -1,6 +1,6 @@ +import { BaseError } from "./BaseError"; import { MessageProps } from "../entities/Message"; -import { DatabaseErrorType, DatabaseRepoName } from "../enums/DatabaseEnums"; -import { BaseError } from "./Base"; +import { DatabaseErrorType, DatabaseRepoName } from "../enums"; export class DatabaseAccessError extends BaseError { override name = DatabaseAccessError.name; diff --git a/postman/src/core/errors/__tests__/BaseError.test.ts b/postman/src/core/errors/__tests__/BaseError.test.ts new file mode 100644 index 000000000..4f4fd1a25 --- /dev/null +++ b/postman/src/core/errors/__tests__/BaseError.test.ts @@ -0,0 +1,14 @@ +import { describe, it } from "@jest/globals"; +import { serialize } from "@consensys/linea-sdk"; +import { BaseError } from "../BaseError"; + +describe("BaseError", () => { + it("Should log error message when we only pass a short message", () => { + expect(serialize(new BaseError("An error message."))).toStrictEqual( + serialize({ + name: "PostmanCoreError", + message: "An error message.", + }), + ); + }); +}); diff --git a/sdk/src/core/errors/__tests__/DatabaseError.test.ts b/postman/src/core/errors/__tests__/DatabaseError.test.ts similarity index 89% rename from sdk/src/core/errors/__tests__/DatabaseError.test.ts rename to postman/src/core/errors/__tests__/DatabaseError.test.ts index 6d3cc942d..fa3ee8266 100644 --- a/sdk/src/core/errors/__tests__/DatabaseError.test.ts +++ b/postman/src/core/errors/__tests__/DatabaseError.test.ts @@ -1,9 +1,8 @@ -import { describe, it } from "@jest/globals"; +import { describe, it, expect } from "@jest/globals"; +import { Direction, serialize } from "@consensys/linea-sdk"; import { DatabaseAccessError } from "../DatabaseErrors"; -import { DatabaseErrorType, DatabaseRepoName } from "../../enums/DatabaseEnums"; +import { DatabaseErrorType, DatabaseRepoName, MessageStatus } from "../../enums"; import { MessageProps } from "../../entities/Message"; -import { Direction, MessageStatus } from "../../enums/MessageEnums"; -import { serialize } from "../../utils/serialize"; import { ZERO_ADDRESS, ZERO_HASH } from "../../constants"; describe("DatabaseAccessError", () => { diff --git a/postman/src/core/errors/index.ts b/postman/src/core/errors/index.ts new file mode 100644 index 000000000..35df4723c --- /dev/null +++ b/postman/src/core/errors/index.ts @@ -0,0 +1,2 @@ +export { BaseError } from "./BaseError"; +export { DatabaseAccessError } from "./DatabaseErrors"; diff --git a/sdk/src/core/persistence/IDatabaseCleaner.ts b/postman/src/core/persistence/IDatabaseCleaner.ts similarity index 100% rename from sdk/src/core/persistence/IDatabaseCleaner.ts rename to postman/src/core/persistence/IDatabaseCleaner.ts diff --git a/sdk/src/core/persistence/IMessageDBService.ts b/postman/src/core/persistence/IMessageDBService.ts similarity index 92% rename from sdk/src/core/persistence/IMessageDBService.ts rename to postman/src/core/persistence/IMessageDBService.ts index 1ed9b2446..3b65feb8f 100644 --- a/sdk/src/core/persistence/IMessageDBService.ts +++ b/postman/src/core/persistence/IMessageDBService.ts @@ -1,5 +1,6 @@ +import { Direction } from "@consensys/linea-sdk"; import { Message } from "../entities/Message"; -import { Direction, MessageStatus } from "../enums/MessageEnums"; +import { MessageStatus } from "../enums"; export interface IMessageDBService { insertMessage(message: Message): Promise; diff --git a/sdk/src/core/persistence/IMessageRepository.ts b/postman/src/core/persistence/IMessageRepository.ts similarity index 94% rename from sdk/src/core/persistence/IMessageRepository.ts rename to postman/src/core/persistence/IMessageRepository.ts index 5b088bbd2..174b121b2 100644 --- a/sdk/src/core/persistence/IMessageRepository.ts +++ b/postman/src/core/persistence/IMessageRepository.ts @@ -1,5 +1,6 @@ +import { Direction } from "@consensys/linea-sdk"; import { Message } from "../entities/Message"; -import { Direction, MessageStatus } from "../enums/MessageEnums"; +import { MessageStatus } from "../enums"; export interface IMessageRepository { insertMessage(message: Message): Promise; diff --git a/sdk/src/core/services/ITransactionValidationService.ts b/postman/src/core/services/ITransactionValidationService.ts similarity index 100% rename from sdk/src/core/services/ITransactionValidationService.ts rename to postman/src/core/services/ITransactionValidationService.ts diff --git a/sdk/src/core/services/contracts/IMessageServiceContract.ts b/postman/src/core/services/contracts/IMessageServiceContract.ts similarity index 84% rename from sdk/src/core/services/contracts/IMessageServiceContract.ts rename to postman/src/core/services/contracts/IMessageServiceContract.ts index a61e87945..a1c383369 100644 --- a/sdk/src/core/services/contracts/IMessageServiceContract.ts +++ b/postman/src/core/services/contracts/IMessageServiceContract.ts @@ -1,12 +1,12 @@ -import { OnChainMessageStatus } from "../../../core/enums/MessageEnums"; +import { OnChainMessageStatus, MessageSent } from "@consensys/linea-sdk"; import { MessageProps } from "../../entities/Message"; -import { MessageSent } from "../../types/Events"; export interface IMessageServiceContract< Overrides, TransactionReceipt, TransactionResponse, ContractTransactionResponse, + ErrorDescription, > { getMessageStatus(messageHash: string, overrides?: Overrides): Promise; getMessageByMessageHash(messageHash: string): Promise; @@ -19,4 +19,5 @@ export interface IMessageServiceContract< retryTransactionWithHigherFee(transactionHash: string, priceBumpPercent?: number): Promise; isRateLimitExceeded(messageFee: bigint, messageValue: bigint): Promise; isRateLimitExceededError(transactionHash: string): Promise; + parseTransactionError(transactionHash: string): Promise; } diff --git a/sdk/src/core/services/pollers/IPoller.ts b/postman/src/core/services/pollers/IPoller.ts similarity index 100% rename from sdk/src/core/services/pollers/IPoller.ts rename to postman/src/core/services/pollers/IPoller.ts diff --git a/sdk/src/core/services/processors/IL2ClaimMessageTransactionSizeProcessor.ts b/postman/src/core/services/processors/IL2ClaimMessageTransactionSizeProcessor.ts similarity index 79% rename from sdk/src/core/services/processors/IL2ClaimMessageTransactionSizeProcessor.ts rename to postman/src/core/services/processors/IL2ClaimMessageTransactionSizeProcessor.ts index fdb0e5b28..ed2e8b9ac 100644 --- a/sdk/src/core/services/processors/IL2ClaimMessageTransactionSizeProcessor.ts +++ b/postman/src/core/services/processors/IL2ClaimMessageTransactionSizeProcessor.ts @@ -1,4 +1,4 @@ -import { Direction } from "../../enums/MessageEnums"; +import { Direction } from "@consensys/linea-sdk"; export interface IL2ClaimMessageTransactionSizeProcessor { process(): Promise; diff --git a/sdk/src/core/services/processors/IL2ClaimTransactionSizeCalculator.ts b/postman/src/core/services/processors/IL2ClaimTransactionSizeCalculator.ts similarity index 100% rename from sdk/src/core/services/processors/IL2ClaimTransactionSizeCalculator.ts rename to postman/src/core/services/processors/IL2ClaimTransactionSizeCalculator.ts diff --git a/sdk/src/core/services/processors/IMessageAnchoringProcessor.ts b/postman/src/core/services/processors/IMessageAnchoringProcessor.ts similarity index 100% rename from sdk/src/core/services/processors/IMessageAnchoringProcessor.ts rename to postman/src/core/services/processors/IMessageAnchoringProcessor.ts diff --git a/sdk/src/core/services/processors/IMessageClaimingPersister.ts b/postman/src/core/services/processors/IMessageClaimingPersister.ts similarity index 79% rename from sdk/src/core/services/processors/IMessageClaimingPersister.ts rename to postman/src/core/services/processors/IMessageClaimingPersister.ts index 6a29852da..272a1221d 100644 --- a/sdk/src/core/services/processors/IMessageClaimingPersister.ts +++ b/postman/src/core/services/processors/IMessageClaimingPersister.ts @@ -1,4 +1,4 @@ -import { Direction } from "../../enums/MessageEnums"; +import { Direction } from "@consensys/linea-sdk"; export interface IMessageClaimingPersister { process(): Promise; diff --git a/sdk/src/core/services/processors/IMessageClaimingProcessor.ts b/postman/src/core/services/processors/IMessageClaimingProcessor.ts similarity index 86% rename from sdk/src/core/services/processors/IMessageClaimingProcessor.ts rename to postman/src/core/services/processors/IMessageClaimingProcessor.ts index 55cab8df4..79cf67259 100644 --- a/sdk/src/core/services/processors/IMessageClaimingProcessor.ts +++ b/postman/src/core/services/processors/IMessageClaimingProcessor.ts @@ -1,4 +1,4 @@ -import { Direction } from "../../enums/MessageEnums"; +import { Direction } from "@consensys/linea-sdk"; export interface IMessageClaimingProcessor { process(): Promise; diff --git a/sdk/src/core/services/processors/IMessageSentEventProcessor.ts b/postman/src/core/services/processors/IMessageSentEventProcessor.ts similarity index 87% rename from sdk/src/core/services/processors/IMessageSentEventProcessor.ts rename to postman/src/core/services/processors/IMessageSentEventProcessor.ts index fcdc6579e..2a59ddcf2 100644 --- a/sdk/src/core/services/processors/IMessageSentEventProcessor.ts +++ b/postman/src/core/services/processors/IMessageSentEventProcessor.ts @@ -1,4 +1,4 @@ -import { Direction } from "../../enums/MessageEnums"; +import { Direction } from "@consensys/linea-sdk"; export interface IMessageSentEventProcessor { process( diff --git a/postman/src/core/utils/__tests__/shared.test.ts b/postman/src/core/utils/__tests__/shared.test.ts new file mode 100644 index 000000000..0bf95761e --- /dev/null +++ b/postman/src/core/utils/__tests__/shared.test.ts @@ -0,0 +1,11 @@ +import { describe, it, expect } from "@jest/globals"; +import { subtractSeconds } from "../shared"; + +describe("Shared utils", () => { + describe("subtractSeconds", () => { + it("should substract X seconds to the current date", () => { + const currentDate = new Date("2024-04-08T00:12:10.000Z"); + expect(subtractSeconds(currentDate, 10)).toStrictEqual(new Date("2024-04-08T00:12:00.000Z")); + }); + }); +}); diff --git a/sdk/src/core/utils/logging/ILogger.ts b/postman/src/core/utils/logging/ILogger.ts similarity index 100% rename from sdk/src/core/utils/logging/ILogger.ts rename to postman/src/core/utils/logging/ILogger.ts diff --git a/postman/src/core/utils/shared.ts b/postman/src/core/utils/shared.ts new file mode 100644 index 000000000..5172955a7 --- /dev/null +++ b/postman/src/core/utils/shared.ts @@ -0,0 +1,12 @@ +/** + * Subtracts a specified number of seconds from a given date. + * + * @param {Date} date - The original date. + * @param {number} seconds - The number of seconds to subtract from the date. + * @returns {Date} A new date object representing the time after subtracting the specified seconds. + */ +export const subtractSeconds = (date: Date, seconds: number): Date => { + const dateCopy = new Date(date); + dateCopy.setSeconds(date.getSeconds() - seconds); + return dateCopy; +}; diff --git a/sdk/src/services/EthereumTransactionValidationService.ts b/postman/src/services/EthereumTransactionValidationService.ts similarity index 98% rename from sdk/src/services/EthereumTransactionValidationService.ts rename to postman/src/services/EthereumTransactionValidationService.ts index a645301f2..6b0a6adf5 100644 --- a/sdk/src/services/EthereumTransactionValidationService.ts +++ b/postman/src/services/EthereumTransactionValidationService.ts @@ -1,5 +1,6 @@ import { ContractTransactionResponse, + ErrorDescription, Overrides, TransactionReceipt, TransactionRequest, @@ -27,7 +28,8 @@ export class EthereumTransactionValidationService implements ITransactionValidat Overrides, TransactionReceipt, TransactionResponse, - ContractTransactionResponse + ContractTransactionResponse, + ErrorDescription >, private readonly gasProvider: IEthereumGasProvider, private readonly config: TransactionValidationServiceConfig, diff --git a/sdk/src/services/L2ClaimTransactionSizeCalculator.ts b/postman/src/services/L2ClaimTransactionSizeCalculator.ts similarity index 94% rename from sdk/src/services/L2ClaimTransactionSizeCalculator.ts rename to postman/src/services/L2ClaimTransactionSizeCalculator.ts index e0d3592b0..da4fe7ef2 100644 --- a/sdk/src/services/L2ClaimTransactionSizeCalculator.ts +++ b/postman/src/services/L2ClaimTransactionSizeCalculator.ts @@ -1,5 +1,6 @@ import { ContractTransactionResponse, + ErrorDescription, ethers, Overrides, Signer, @@ -8,11 +9,11 @@ import { TransactionResponse, } from "ethers"; import { GoNativeCompressor } from "@consensys/linea-native-libs"; +import { serialize } from "@consensys/linea-sdk"; +import { BaseError } from "../core/errors"; import { MessageProps } from "../core/entities/Message"; import { IL2MessageServiceClient } from "../core/clients/blockchain/linea/IL2MessageServiceClient"; -import { BaseError } from "../core/errors/Base"; import { LineaGasFees } from "../core/clients/blockchain/IGasProvider"; -import { serialize } from "../core/utils/serialize"; import { IL2ClaimTransactionSizeCalculator } from "../core/services/processors/IL2ClaimTransactionSizeCalculator"; export class L2ClaimTransactionSizeCalculator implements IL2ClaimTransactionSizeCalculator { @@ -29,7 +30,8 @@ export class L2ClaimTransactionSizeCalculator implements IL2ClaimTransactionSize TransactionReceipt, TransactionResponse, ContractTransactionResponse, - Signer + Signer, + ErrorDescription >, ) { this.compressor = new GoNativeCompressor(800_000); diff --git a/sdk/src/services/LineaTransactionValidationService.ts b/postman/src/services/LineaTransactionValidationService.ts similarity index 93% rename from sdk/src/services/LineaTransactionValidationService.ts rename to postman/src/services/LineaTransactionValidationService.ts index 4e4b587a7..846bc3108 100644 --- a/sdk/src/services/LineaTransactionValidationService.ts +++ b/postman/src/services/LineaTransactionValidationService.ts @@ -1,6 +1,7 @@ import { Block, ContractTransactionResponse, + ErrorDescription, JsonRpcProvider, Overrides, Signer, @@ -8,6 +9,7 @@ import { TransactionRequest, TransactionResponse, } from "ethers"; +import { BaseError } from "../core/errors"; import { Message } from "../core/entities/Message"; import { ITransactionValidationService, @@ -15,20 +17,19 @@ import { } from "../core/services/ITransactionValidationService"; import { MINIMUM_MARGIN, PROFIT_MARGIN_MULTIPLIER } from "../core/constants"; import { IL2MessageServiceClient } from "../core/clients/blockchain/linea/IL2MessageServiceClient"; -import { IL2ChainQuerier } from "../core/clients/blockchain/linea/IL2ChainQuerier"; -import { BaseError } from "../core/errors/Base"; +import { ILineaProvider } from "../core/clients/blockchain/linea/ILineaProvider"; export class LineaTransactionValidationService implements ITransactionValidationService { /** * Constructs a new instance of the `LineaTransactionValidationService`. * * @param {TransactionValidationServiceConfig} config - Configuration settings for the transaction validation service, including profit margin and maximum gas limit. - * @param {IL2ChainQuerier} chainQuerier - An instance of a class implementing the `IL2ChainQuerier` interface, used to interact with the blockchain. + * @param {ILineaProvider} provider - An instance of a class implementing the `ILineaProvider` interface, used to interact with the blockchain. * @param {IL2MessageServiceClient} l2MessageServiceClient - An instance of a class implementing the `IL2MessageServiceClient` interface, used to interact with the L2 message service. */ constructor( private readonly config: TransactionValidationServiceConfig, - private readonly chainQuerier: IL2ChainQuerier< + private readonly provider: ILineaProvider< TransactionReceipt, Block, TransactionRequest, @@ -40,7 +41,8 @@ export class LineaTransactionValidationService implements ITransactionValidation TransactionReceipt, TransactionResponse, ContractTransactionResponse, - Signer + Signer, + ErrorDescription >, ) {} @@ -116,7 +118,7 @@ export class LineaTransactionValidationService implements ITransactionValidation messageFee: bigint, messageCompressedTransactionSize: number, ): Promise { - const extraData = await this.chainQuerier.getBlockExtraData("latest"); + const extraData = await this.provider.getBlockExtraData("latest"); if (!extraData) { throw new BaseError("No extra data."); diff --git a/sdk/src/services/persistence/DatabaseCleaner.ts b/postman/src/services/persistence/DatabaseCleaner.ts similarity index 87% rename from sdk/src/services/persistence/DatabaseCleaner.ts rename to postman/src/services/persistence/DatabaseCleaner.ts index a32fe8aed..294d1fc3e 100644 --- a/sdk/src/services/persistence/DatabaseCleaner.ts +++ b/postman/src/services/persistence/DatabaseCleaner.ts @@ -7,7 +7,7 @@ export class DatabaseCleaner implements IDatabaseCleaner { /** * Constructs a new instance of the `DatabaseCleaner`. * - * @param {IMessageRepository} messageRepository - An instance of a message repository that provides access to message storage and operations. + * @param {IMessageDBService} databaseService - An instance of a MessageDBService that provides access to message storage and operations. * @param {ILogger} logger - An instance of a logger for logging information and errors during the cleanup process. */ constructor( diff --git a/sdk/src/services/persistence/EthereumMessageDBService.ts b/postman/src/services/persistence/EthereumMessageDBService.ts similarity index 96% rename from sdk/src/services/persistence/EthereumMessageDBService.ts rename to postman/src/services/persistence/EthereumMessageDBService.ts index 90e311c9b..5e8767513 100644 --- a/sdk/src/services/persistence/EthereumMessageDBService.ts +++ b/postman/src/services/persistence/EthereumMessageDBService.ts @@ -1,6 +1,7 @@ import { ContractTransactionResponse, TransactionRequest } from "ethers"; +import { Direction } from "@consensys/linea-sdk"; import { Message } from "../../core/entities/Message"; -import { Direction, MessageStatus } from "../../core/enums/MessageEnums"; +import { MessageStatus } from "../../core/enums"; import { IMessageRepository } from "../../core/persistence/IMessageRepository"; import { IMessageDBService } from "../../core/persistence/IMessageDBService"; import { IGasProvider } from "../../core/clients/blockchain/IGasProvider"; diff --git a/sdk/src/services/persistence/LineaMessageDBService.ts b/postman/src/services/persistence/LineaMessageDBService.ts similarity index 86% rename from sdk/src/services/persistence/LineaMessageDBService.ts rename to postman/src/services/persistence/LineaMessageDBService.ts index b4ba25b1d..de5edbadf 100644 --- a/sdk/src/services/persistence/LineaMessageDBService.ts +++ b/postman/src/services/persistence/LineaMessageDBService.ts @@ -6,11 +6,12 @@ import { TransactionRequest, TransactionResponse, } from "ethers"; +import { Direction } from "@consensys/linea-sdk"; import { Message } from "../../core/entities/Message"; -import { Direction, MessageStatus } from "../../core/enums/MessageEnums"; +import { MessageStatus } from "../../core/enums"; import { IMessageRepository } from "../../core/persistence/IMessageRepository"; -import { IL2ChainQuerier } from "../../core/clients/blockchain/linea/IL2ChainQuerier"; -import { BaseError } from "../../core/errors/Base"; +import { ILineaProvider } from "../../core/clients/blockchain/linea/ILineaProvider"; +import { BaseError } from "../../core/errors"; import { IMessageDBService } from "../../core/persistence/IMessageDBService"; import { MessageDBService } from "./MessageDBService"; import { MINIMUM_MARGIN } from "../../core/constants"; @@ -19,11 +20,11 @@ export class LineaMessageDBService extends MessageDBService implements IMessageD /** * Creates an instance of `LineaMessageDBService`. * - * @param {IL2ChainQuerier} chainQuerier - The chain querier for interacting with the blockchain. + * @param {ILineaProvider} provider - The provider for interacting with the blockchain. * @param {IMessageRepository} messageRepository - The message repository for interacting with the message database. */ constructor( - private readonly chainQuerier: IL2ChainQuerier< + private readonly provider: ILineaProvider< TransactionReceipt, Block, TransactionRequest, @@ -90,8 +91,8 @@ export class LineaMessageDBService extends MessageDBService implements IMessageD extraDataFixedCost: number; }> { const minimumMargin = MINIMUM_MARGIN; - const blockNumber = await this.chainQuerier.getCurrentBlockNumber(); - const extraData = await this.chainQuerier.getBlockExtraData(blockNumber); + const blockNumber = await this.provider.getBlockNumber(); + const extraData = await this.provider.getBlockExtraData(blockNumber); if (!extraData) { throw new BaseError("no extra data."); diff --git a/sdk/src/services/persistence/MessageDBService.ts b/postman/src/services/persistence/MessageDBService.ts similarity index 97% rename from sdk/src/services/persistence/MessageDBService.ts rename to postman/src/services/persistence/MessageDBService.ts index a6f9664c2..4f351bb23 100644 --- a/sdk/src/services/persistence/MessageDBService.ts +++ b/postman/src/services/persistence/MessageDBService.ts @@ -1,7 +1,8 @@ import { ContractTransactionResponse } from "ethers"; +import { Direction } from "@consensys/linea-sdk"; import { Message } from "../../core/entities/Message"; import { IMessageRepository } from "../../core/persistence/IMessageRepository"; -import { Direction, MessageStatus } from "../../core/enums/MessageEnums"; +import { MessageStatus } from "../../core/enums"; export abstract class MessageDBService { /** diff --git a/sdk/src/services/persistence/__tests__/DatabaseCleaner.test.ts b/postman/src/services/persistence/__tests__/DatabaseCleaner.test.ts similarity index 98% rename from sdk/src/services/persistence/__tests__/DatabaseCleaner.test.ts rename to postman/src/services/persistence/__tests__/DatabaseCleaner.test.ts index 349b660de..eed5391bd 100644 --- a/sdk/src/services/persistence/__tests__/DatabaseCleaner.test.ts +++ b/postman/src/services/persistence/__tests__/DatabaseCleaner.test.ts @@ -4,7 +4,7 @@ import { ContractTransactionResponse } from "ethers"; import { DatabaseCleaner } from "../DatabaseCleaner"; import { ILogger } from "../../../core/utils/logging/ILogger"; import { DatabaseAccessError } from "../../../core/errors/DatabaseErrors"; -import { DatabaseErrorType, DatabaseRepoName } from "../../../core/enums/DatabaseEnums"; +import { DatabaseErrorType, DatabaseRepoName } from "../../../core/enums"; import { IMessageDBService } from "../../../core/persistence/IMessageDBService"; describe("TestDatabaseCleaner", () => { diff --git a/postman/src/services/persistence/index.ts b/postman/src/services/persistence/index.ts new file mode 100644 index 000000000..83539a7d6 --- /dev/null +++ b/postman/src/services/persistence/index.ts @@ -0,0 +1,4 @@ +export { DatabaseCleaner } from "./DatabaseCleaner"; +export { EthereumMessageDBService } from "./EthereumMessageDBService"; +export { LineaMessageDBService } from "./LineaMessageDBService"; +export { MessageDBService } from "./MessageDBService"; diff --git a/sdk/src/services/pollers/DatabaseCleaningPoller.ts b/postman/src/services/pollers/DatabaseCleaningPoller.ts similarity index 97% rename from sdk/src/services/pollers/DatabaseCleaningPoller.ts rename to postman/src/services/pollers/DatabaseCleaningPoller.ts index e5334e71c..33ba38ddb 100644 --- a/sdk/src/services/pollers/DatabaseCleaningPoller.ts +++ b/postman/src/services/pollers/DatabaseCleaningPoller.ts @@ -1,8 +1,8 @@ +import { wait } from "@consensys/linea-sdk"; import { ILogger } from "../../core/utils/logging/ILogger"; import { IPoller } from "../../core/services/pollers/IPoller"; import { IDatabaseCleaner } from "../../core/persistence/IDatabaseCleaner"; import { DBCleanerConfig } from "../../application/postman/persistence/config/types"; -import { wait } from "../../core/utils/shared"; export class DatabaseCleaningPoller implements IPoller { private isPolling = false; diff --git a/sdk/src/services/pollers/L2ClaimMessageTransactionSizePoller.ts b/postman/src/services/pollers/L2ClaimMessageTransactionSizePoller.ts similarity index 94% rename from sdk/src/services/pollers/L2ClaimMessageTransactionSizePoller.ts rename to postman/src/services/pollers/L2ClaimMessageTransactionSizePoller.ts index 12cdd1dfe..cfa059c9b 100644 --- a/sdk/src/services/pollers/L2ClaimMessageTransactionSizePoller.ts +++ b/postman/src/services/pollers/L2ClaimMessageTransactionSizePoller.ts @@ -1,7 +1,6 @@ -import { Direction } from "../../core/enums/MessageEnums"; +import { Direction, wait } from "@consensys/linea-sdk"; import { ILogger } from "../../core/utils/logging/ILogger"; import { IPoller } from "../../core/services/pollers/IPoller"; -import { wait } from "../../core/utils/shared"; import { L2ClaimMessageTransactionSizeProcessor } from "../processors/L2ClaimMessageTransactionSizeProcessor"; type L2ClaimMessageTransactionSizePollerConfig = { diff --git a/sdk/src/services/pollers/MessageAnchoringPoller.ts b/postman/src/services/pollers/MessageAnchoringPoller.ts similarity index 95% rename from sdk/src/services/pollers/MessageAnchoringPoller.ts rename to postman/src/services/pollers/MessageAnchoringPoller.ts index bf71fc5bd..2dec7632f 100644 --- a/sdk/src/services/pollers/MessageAnchoringPoller.ts +++ b/postman/src/services/pollers/MessageAnchoringPoller.ts @@ -1,8 +1,7 @@ -import { Direction } from "../../core/enums/MessageEnums"; +import { Direction, wait } from "@consensys/linea-sdk"; import { ILogger } from "../../core/utils/logging/ILogger"; import { IPoller } from "../../core/services/pollers/IPoller"; import { IMessageAnchoringProcessor } from "../../core/services/processors/IMessageAnchoringProcessor"; -import { wait } from "../../core/utils/shared"; type MessageAnchoringPollerConfig = { direction: Direction; diff --git a/sdk/src/services/pollers/MessageClaimingPoller.ts b/postman/src/services/pollers/MessageClaimingPoller.ts similarity index 95% rename from sdk/src/services/pollers/MessageClaimingPoller.ts rename to postman/src/services/pollers/MessageClaimingPoller.ts index bda3ad700..d95c1bef5 100644 --- a/sdk/src/services/pollers/MessageClaimingPoller.ts +++ b/postman/src/services/pollers/MessageClaimingPoller.ts @@ -1,8 +1,7 @@ -import { Direction } from "../../core/enums/MessageEnums"; +import { Direction, wait } from "@consensys/linea-sdk"; import { ILogger } from "../../core/utils/logging/ILogger"; import { IPoller } from "../../core/services/pollers/IPoller"; import { IMessageClaimingProcessor } from "../../core/services/processors/IMessageClaimingProcessor"; -import { wait } from "../../core/utils/shared"; type MessageClaimingPollerConfig = { direction: Direction; diff --git a/sdk/src/services/pollers/MessagePersistingPoller.ts b/postman/src/services/pollers/MessagePersistingPoller.ts similarity index 95% rename from sdk/src/services/pollers/MessagePersistingPoller.ts rename to postman/src/services/pollers/MessagePersistingPoller.ts index 540faa847..ea0e17087 100644 --- a/sdk/src/services/pollers/MessagePersistingPoller.ts +++ b/postman/src/services/pollers/MessagePersistingPoller.ts @@ -1,7 +1,6 @@ -import { Direction } from "../../core/enums/MessageEnums"; +import { Direction, wait } from "@consensys/linea-sdk"; import { ILogger } from "../../core/utils/logging/ILogger"; import { IPoller } from "../../core/services/pollers/IPoller"; -import { wait } from "../../core/utils/shared"; import { IMessageClaimingPersister } from "../../core/services/processors/IMessageClaimingPersister"; type MessagePersistingPollerConfig = { diff --git a/sdk/src/services/pollers/MessageSentEventPoller.ts b/postman/src/services/pollers/MessageSentEventPoller.ts similarity index 94% rename from sdk/src/services/pollers/MessageSentEventPoller.ts rename to postman/src/services/pollers/MessageSentEventPoller.ts index c48a1d37f..60fb339a6 100644 --- a/sdk/src/services/pollers/MessageSentEventPoller.ts +++ b/postman/src/services/pollers/MessageSentEventPoller.ts @@ -6,15 +6,14 @@ import { TransactionRequest, TransactionResponse, } from "ethers"; -import { Direction } from "../../core/enums/MessageEnums"; +import { Direction, wait } from "@consensys/linea-sdk"; import { ILogger } from "../../core/utils/logging/ILogger"; import { DEFAULT_INITIAL_FROM_BLOCK } from "../../core/constants"; import { IMessageSentEventProcessor } from "../../core/services/processors/IMessageSentEventProcessor"; import { Message } from "../../core/entities/Message"; import { DatabaseAccessError } from "../../core/errors/DatabaseErrors"; -import { IChainQuerier } from "../../core/clients/blockchain/IChainQuerier"; +import { IProvider } from "../../core/clients/blockchain/IProvider"; import { IPoller } from "../../core/services/pollers/IPoller"; -import { wait } from "../../core/utils/shared"; import { IMessageDBService } from "../../core/persistence/IMessageDBService"; type MessageSentEventPollerConfig = { @@ -31,14 +30,14 @@ export class MessageSentEventPoller implements IPoller { * Constructs a new instance of the `MessageSentEventPoller`. * * @param {IMessageSentEventProcessor} eventProcessor - An instance of a class implementing the `IMessageSentEventProcessor` interface, responsible for processing message sent events. - * @param {IChainQuerier} chainQuerier - An instance of a class implementing the `IChainQuerier` interface, used to query blockchain data. + * @param {IProvider} provider - An instance of a class implementing the `IProvider` interface, used to query blockchain data. * @param {IMessageDBService} databaseService - An instance of a class implementing the `IMessageDBService` interface, used for storing and retrieving message data. * @param {MessageSentEventPollerConfig} config - Configuration settings for the poller, including the direction of message flow, the polling interval, and the initial block number to start listening from. * @param {ILogger} logger - An instance of a class implementing the `ILogger` interface, used for logging messages related to the polling process. */ constructor( private readonly eventProcessor: IMessageSentEventProcessor, - private readonly chainQuerier: IChainQuerier< + private readonly provider: IProvider< TransactionReceipt, Block, TransactionRequest, @@ -136,7 +135,7 @@ export class MessageSentEventPoller implements IPoller { * @returns {Promise<{ fromBlock: number; fromBlockLogIndex: number }>} An object containing the determined starting block number and log index. */ private async getInitialFromBlock(): Promise<{ fromBlock: number; fromBlockLogIndex: number }> { - let fromBlock = await this.chainQuerier.getCurrentBlockNumber(); + let fromBlock = await this.provider.getBlockNumber(); const fromBlockLogIndex = 0; diff --git a/sdk/src/services/pollers/__tests__/DatabaseCleaningPoller.test.ts b/postman/src/services/pollers/__tests__/DatabaseCleaningPoller.test.ts similarity index 100% rename from sdk/src/services/pollers/__tests__/DatabaseCleaningPoller.test.ts rename to postman/src/services/pollers/__tests__/DatabaseCleaningPoller.test.ts diff --git a/sdk/src/services/pollers/__tests__/L2ClaimMessageTransactionSizePoller.test.ts b/postman/src/services/pollers/__tests__/L2ClaimMessageTransactionSizePoller.test.ts similarity index 98% rename from sdk/src/services/pollers/__tests__/L2ClaimMessageTransactionSizePoller.test.ts rename to postman/src/services/pollers/__tests__/L2ClaimMessageTransactionSizePoller.test.ts index 2d5ca6f52..a5da6f7cd 100644 --- a/sdk/src/services/pollers/__tests__/L2ClaimMessageTransactionSizePoller.test.ts +++ b/postman/src/services/pollers/__tests__/L2ClaimMessageTransactionSizePoller.test.ts @@ -1,7 +1,7 @@ import { describe, it, beforeEach } from "@jest/globals"; import { MockProxy, mock } from "jest-mock-extended"; +import { Direction } from "@consensys/linea-sdk"; import { TestLogger } from "../../../utils/testing/helpers"; -import { Direction } from "../../../core/enums/MessageEnums"; import { testL2NetworkConfig } from "../../../utils/testing/constants"; import { IPoller } from "../../../core/services/pollers/IPoller"; import { L2ClaimMessageTransactionSizePoller } from "../L2ClaimMessageTransactionSizePoller"; diff --git a/sdk/src/services/pollers/__tests__/MessageAnchoringPoller.test.ts b/postman/src/services/pollers/__tests__/MessageAnchoringPoller.test.ts similarity index 97% rename from sdk/src/services/pollers/__tests__/MessageAnchoringPoller.test.ts rename to postman/src/services/pollers/__tests__/MessageAnchoringPoller.test.ts index 2fde19dbc..f0312e086 100644 --- a/sdk/src/services/pollers/__tests__/MessageAnchoringPoller.test.ts +++ b/postman/src/services/pollers/__tests__/MessageAnchoringPoller.test.ts @@ -1,9 +1,9 @@ import { describe, it, beforeEach } from "@jest/globals"; import { mock } from "jest-mock-extended"; +import { Direction } from "@consensys/linea-sdk"; import { MessageAnchoringPoller } from "../MessageAnchoringPoller"; import { TestLogger } from "../../../utils/testing/helpers"; import { IMessageAnchoringProcessor } from "../../../core/services/processors/IMessageAnchoringProcessor"; -import { Direction } from "../../../core/enums/MessageEnums"; import { testL2NetworkConfig } from "../../../utils/testing/constants"; import { IPoller } from "../../../core/services/pollers/IPoller"; diff --git a/sdk/src/services/pollers/__tests__/MessageClaimingPoller.test.ts b/postman/src/services/pollers/__tests__/MessageClaimingPoller.test.ts similarity index 97% rename from sdk/src/services/pollers/__tests__/MessageClaimingPoller.test.ts rename to postman/src/services/pollers/__tests__/MessageClaimingPoller.test.ts index 149eda64b..71acf1890 100644 --- a/sdk/src/services/pollers/__tests__/MessageClaimingPoller.test.ts +++ b/postman/src/services/pollers/__tests__/MessageClaimingPoller.test.ts @@ -1,9 +1,9 @@ import { describe, it, beforeEach } from "@jest/globals"; import { mock } from "jest-mock-extended"; +import { Direction } from "@consensys/linea-sdk"; import { MessageClaimingPoller } from "../MessageClaimingPoller"; import { TestLogger } from "../../../utils/testing/helpers"; import { IMessageClaimingProcessor } from "../../../core/services/processors/IMessageClaimingProcessor"; -import { Direction } from "../../../core/enums/MessageEnums"; import { testL2NetworkConfig } from "../../../utils/testing/constants"; import { IPoller } from "../../../core/services/pollers/IPoller"; diff --git a/sdk/src/services/pollers/__tests__/MessagePersistingPoller.test.ts b/postman/src/services/pollers/__tests__/MessagePersistingPoller.test.ts similarity index 97% rename from sdk/src/services/pollers/__tests__/MessagePersistingPoller.test.ts rename to postman/src/services/pollers/__tests__/MessagePersistingPoller.test.ts index f59ef3abb..afba1daea 100644 --- a/sdk/src/services/pollers/__tests__/MessagePersistingPoller.test.ts +++ b/postman/src/services/pollers/__tests__/MessagePersistingPoller.test.ts @@ -1,9 +1,9 @@ import { describe, it, beforeEach } from "@jest/globals"; import { mock } from "jest-mock-extended"; +import { Direction } from "@consensys/linea-sdk"; import { MessagePersistingPoller } from "../MessagePersistingPoller"; import { TestLogger } from "../../../utils/testing/helpers"; import { IMessageClaimingPersister } from "../../../core/services/processors/IMessageClaimingPersister"; -import { Direction } from "../../../core/enums/MessageEnums"; import { testL2NetworkConfig } from "../../../utils/testing/constants"; import { IPoller } from "../../../core/services/pollers/IPoller"; diff --git a/sdk/src/services/pollers/__tests__/MessageSentEventPoller.test.ts b/postman/src/services/pollers/__tests__/MessageSentEventPoller.test.ts similarity index 85% rename from sdk/src/services/pollers/__tests__/MessageSentEventPoller.test.ts rename to postman/src/services/pollers/__tests__/MessageSentEventPoller.test.ts index be9ea9722..2c9a1e08f 100644 --- a/sdk/src/services/pollers/__tests__/MessageSentEventPoller.test.ts +++ b/postman/src/services/pollers/__tests__/MessageSentEventPoller.test.ts @@ -1,24 +1,22 @@ import { describe, it, beforeEach } from "@jest/globals"; import { mock } from "jest-mock-extended"; +import { Block, TransactionReceipt, TransactionRequest, TransactionResponse } from "ethers"; +import { Provider, DefaultGasProvider, Direction, wait } from "@consensys/linea-sdk"; import { TestLogger } from "../../../utils/testing/helpers"; -import { Direction } from "../../../core/enums/MessageEnums"; import { rejectedMessageProps, testL1NetworkConfig, testMessage } from "../../../utils/testing/constants"; import { IPoller } from "../../../core/services/pollers/IPoller"; import { MessageSentEventPoller } from "../MessageSentEventPoller"; import { IMessageSentEventProcessor } from "../../../core/services/processors/IMessageSentEventProcessor"; -import { IChainQuerier } from "../../../core/clients/blockchain/IChainQuerier"; +import { IProvider } from "../../../core/clients/blockchain/IProvider"; import { IMessageRepository } from "../../../core/persistence/IMessageRepository"; -import { wait } from "../../../core/utils/shared"; -import { DatabaseAccessError } from "../../../core/errors/DatabaseErrors"; -import { DatabaseErrorType, DatabaseRepoName } from "../../../core/enums/DatabaseEnums"; -import { Block, JsonRpcProvider, TransactionReceipt, TransactionRequest, TransactionResponse } from "ethers"; +import { DatabaseAccessError } from "../../../core/errors"; +import { DatabaseErrorType, DatabaseRepoName } from "../../../core/enums"; import { EthereumMessageDBService } from "../../persistence/EthereumMessageDBService"; -import { DefaultGasProvider } from "../../../clients/blockchain/gas/DefaultGasProvider"; import { DEFAULT_GAS_ESTIMATION_PERCENTILE, DEFAULT_INITIAL_FROM_BLOCK, DEFAULT_LISTENER_INTERVAL, - DEFAULT_MAX_FEE_PER_GAS, + DEFAULT_MAX_FEE_PER_GAS_CAP, } from "../../../core/constants"; describe("TestMessageSentEventPoller", () => { @@ -26,20 +24,19 @@ describe("TestMessageSentEventPoller", () => { let databaseService: EthereumMessageDBService; const eventProcessorMock = mock(); - const l1QuerierMock = - mock>(); + const provider = mock>(); const logger = new TestLogger(MessageSentEventPoller.name); beforeEach(() => { - const gasProvider = new DefaultGasProvider(l1QuerierMock, { - maxFeePerGas: DEFAULT_MAX_FEE_PER_GAS, + const gasProvider = new DefaultGasProvider(provider, { + maxFeePerGasCap: DEFAULT_MAX_FEE_PER_GAS_CAP, gasEstimationPercentile: DEFAULT_GAS_ESTIMATION_PERCENTILE, enforceMaxGasFee: false, }); databaseService = new EthereumMessageDBService(gasProvider, mock>()); testMessageSentEventPoller = new MessageSentEventPoller( eventProcessorMock, - l1QuerierMock, + provider, databaseService, { direction: Direction.L1_TO_L2, @@ -58,7 +55,7 @@ describe("TestMessageSentEventPoller", () => { describe("start", () => { it("Should return and log as warning if it has been started", async () => { const loggerWarnSpy = jest.spyOn(logger, "warn"); - jest.spyOn(l1QuerierMock, "getCurrentBlockNumber").mockResolvedValue(10); + jest.spyOn(provider, "getBlockNumber").mockResolvedValue(10); jest.spyOn(databaseService, "getLatestMessageSent").mockResolvedValue(null); jest.spyOn(eventProcessorMock, "process").mockResolvedValue({ nextFromBlock: 20, @@ -76,7 +73,7 @@ describe("TestMessageSentEventPoller", () => { }); it("Should call process and log as info if it started successfully", async () => { - const l1QuerierMockSpy = jest.spyOn(l1QuerierMock, "getCurrentBlockNumber").mockResolvedValue(10); + const l1QuerierMockSpy = jest.spyOn(provider, "getBlockNumber").mockResolvedValue(10); const messageRepositoryMockSpy = jest .spyOn(databaseService, "getLatestMessageSent") .mockResolvedValue(testMessage); @@ -105,7 +102,7 @@ describe("TestMessageSentEventPoller", () => { it("Should log as warning if getCurrentBlockNumber throws error", async () => { const error = new Error("Other error for testing"); - const l1QuerierMockSpy = jest.spyOn(l1QuerierMock, "getCurrentBlockNumber").mockRejectedValue(error); + const l1QuerierMockSpy = jest.spyOn(provider, "getBlockNumber").mockRejectedValue(error); const loggerErrorSpy = jest.spyOn(logger, "error"); await testMessageSentEventPoller.start(); @@ -119,7 +116,7 @@ describe("TestMessageSentEventPoller", () => { }); it("Should log as warning if process throws DatabaseAccessError", async () => { - const l1QuerierMockSpy = jest.spyOn(l1QuerierMock, "getCurrentBlockNumber").mockResolvedValue(10); + const l1QuerierMockSpy = jest.spyOn(provider, "getBlockNumber").mockResolvedValue(10); const messageRepositoryMockSpy = jest .spyOn(databaseService, "getLatestMessageSent") .mockResolvedValue(testMessage); @@ -162,7 +159,7 @@ describe("TestMessageSentEventPoller", () => { }); it("Should log as warning or error if process throws Error", async () => { - const l1QuerierMockSpy = jest.spyOn(l1QuerierMock, "getCurrentBlockNumber").mockResolvedValue(10); + const l1QuerierMockSpy = jest.spyOn(provider, "getBlockNumber").mockResolvedValue(10); const messageRepositoryMockSpy = jest .spyOn(databaseService, "getLatestMessageSent") .mockResolvedValue(testMessage); @@ -193,7 +190,7 @@ describe("TestMessageSentEventPoller", () => { const loggerInfoSpy = jest.spyOn(logger, "info"); testMessageSentEventPoller = new MessageSentEventPoller( eventProcessorMock, - l1QuerierMock, + provider, databaseService, { direction: Direction.L1_TO_L2, diff --git a/postman/src/services/pollers/index.ts b/postman/src/services/pollers/index.ts new file mode 100644 index 000000000..f528ecb3a --- /dev/null +++ b/postman/src/services/pollers/index.ts @@ -0,0 +1,6 @@ +export { DatabaseCleaningPoller } from "./DatabaseCleaningPoller"; +export { L2ClaimMessageTransactionSizePoller } from "./L2ClaimMessageTransactionSizePoller"; +export { MessageAnchoringPoller } from "./MessageAnchoringPoller"; +export { MessageClaimingPoller } from "./MessageClaimingPoller"; +export { MessagePersistingPoller } from "./MessagePersistingPoller"; +export { MessageSentEventPoller } from "./MessageSentEventPoller"; diff --git a/sdk/src/services/processors/L2ClaimMessageTransactionSizeProcessor.ts b/postman/src/services/processors/L2ClaimMessageTransactionSizeProcessor.ts similarity index 93% rename from sdk/src/services/processors/L2ClaimMessageTransactionSizeProcessor.ts rename to postman/src/services/processors/L2ClaimMessageTransactionSizeProcessor.ts index 05e9101bf..6a7cd1718 100644 --- a/sdk/src/services/processors/L2ClaimMessageTransactionSizeProcessor.ts +++ b/postman/src/services/processors/L2ClaimMessageTransactionSizeProcessor.ts @@ -1,5 +1,12 @@ -import { ContractTransactionResponse, Overrides, Signer, TransactionReceipt, TransactionResponse } from "ethers"; -import { MessageStatus } from "../../core/enums/MessageEnums"; +import { + ContractTransactionResponse, + ErrorDescription, + Overrides, + Signer, + TransactionReceipt, + TransactionResponse, +} from "ethers"; +import { MessageStatus } from "../../core/enums"; import { ILogger } from "../../core/utils/logging/ILogger"; import { IMessageDBService } from "../../core/persistence/IMessageDBService"; import { IL2MessageServiceClient } from "../../core/clients/blockchain/linea/IL2MessageServiceClient"; @@ -26,7 +33,8 @@ export class L2ClaimMessageTransactionSizeProcessor implements IL2ClaimMessageTr TransactionReceipt, TransactionResponse, ContractTransactionResponse, - Signer + Signer, + ErrorDescription >, private readonly transactionSizeCalculator: IL2ClaimTransactionSizeCalculator, private readonly config: L2ClaimMessageTransactionSizeProcessorConfig, diff --git a/sdk/src/services/processors/MessageAnchoringProcessor.ts b/postman/src/services/processors/MessageAnchoringProcessor.ts similarity index 85% rename from sdk/src/services/processors/MessageAnchoringProcessor.ts rename to postman/src/services/processors/MessageAnchoringProcessor.ts index a58f01a89..709a3675d 100644 --- a/sdk/src/services/processors/MessageAnchoringProcessor.ts +++ b/postman/src/services/processors/MessageAnchoringProcessor.ts @@ -6,13 +6,15 @@ import { Block, TransactionRequest, JsonRpcProvider, + ErrorDescription, } from "ethers"; +import { OnChainMessageStatus } from "@consensys/linea-sdk"; import { IMessageAnchoringProcessor, MessageAnchoringProcessorConfig, } from "../../core/services/processors/IMessageAnchoringProcessor"; -import { IChainQuerier } from "../../core/clients/blockchain/IChainQuerier"; -import { MessageStatus, OnChainMessageStatus } from "../../core/enums/MessageEnums"; +import { IProvider } from "../../core/clients/blockchain/IProvider"; +import { MessageStatus } from "../../core/enums"; import { ILogger } from "../../core/utils/logging/ILogger"; import { IMessageServiceContract } from "../../core/services/contracts/IMessageServiceContract"; import { IMessageDBService } from "../../core/persistence/IMessageDBService"; @@ -24,7 +26,7 @@ export class MessageAnchoringProcessor implements IMessageAnchoringProcessor { * Constructs a new instance of the `MessageAnchoringProcessor`. * * @param {IMessageServiceContract} contractClient - An instance of a class implementing the `IMessageServiceContract` interface, used to interact with the blockchain contract. - * @param {IChainQuerier} chainQuerier - An instance of a class implementing the `IChainQuerier` interface, used to query blockchain data. + * @param {IProvider} provider - An instance of a class implementing the `IProvider` interface, used to query blockchain data. * @param {IMessageDBService} databaseService - An instance of a class implementing the `IMessageDBService` interface, used for storing and retrieving message data. * @param {MessageAnchoringProcessorConfig} config - Configuration settings for the processor, including the maximum number of messages to fetch from the database for processing. * @param {ILogger} logger - An instance of a class implementing the `ILogger` interface, used for logging messages. @@ -34,9 +36,10 @@ export class MessageAnchoringProcessor implements IMessageAnchoringProcessor { Overrides, TransactionReceipt, TransactionResponse, - ContractTransactionResponse + ContractTransactionResponse, + ErrorDescription >, - private readonly chainQuerier: IChainQuerier< + private readonly provider: IProvider< TransactionReceipt, Block, TransactionRequest, @@ -70,7 +73,7 @@ export class MessageAnchoringProcessor implements IMessageAnchoringProcessor { return; } - const latestBlockNumber = await this.chainQuerier.getCurrentBlockNumber(); + const latestBlockNumber = await this.provider.getBlockNumber(); for (const message of messages) { const messageStatus = await this.contractClient.getMessageStatus(message.messageHash, { diff --git a/sdk/src/services/processors/MessageClaimingPersister.ts b/postman/src/services/processors/MessageClaimingPersister.ts similarity index 92% rename from sdk/src/services/processors/MessageClaimingPersister.ts rename to postman/src/services/processors/MessageClaimingPersister.ts index 70c85359d..9f8f16959 100644 --- a/sdk/src/services/processors/MessageClaimingPersister.ts +++ b/postman/src/services/processors/MessageClaimingPersister.ts @@ -6,17 +6,19 @@ import { TransactionRequest, Block, JsonRpcProvider, + ErrorDescription, } from "ethers"; -import { MessageStatus, OnChainMessageStatus } from "../../core/enums/MessageEnums"; +import { OnChainMessageStatus } from "@consensys/linea-sdk"; +import { BaseError } from "../../core/errors"; +import { MessageStatus } from "../../core/enums"; import { ILogger } from "../../core/utils/logging/ILogger"; import { IMessageServiceContract } from "../../core/services/contracts/IMessageServiceContract"; -import { IChainQuerier } from "../../core/clients/blockchain/IChainQuerier"; +import { IProvider } from "../../core/clients/blockchain/IProvider"; import { Message } from "../../core/entities/Message"; import { IMessageClaimingPersister, MessageClaimingPersisterConfig, } from "../../core/services/processors/IMessageClaimingPersister"; -import { BaseError } from "../../core/errors/Base"; import { IMessageDBService } from "../../core/persistence/IMessageDBService"; export class MessageClaimingPersister implements IMessageClaimingPersister { @@ -27,7 +29,7 @@ export class MessageClaimingPersister implements IMessageClaimingPersister { * * @param {IMessageDBService} databaseService - An instance of a class implementing the `IMessageDBService` interface, used for storing and retrieving message data. * @param {IMessageServiceContract} messageServiceContract - An instance of a class implementing the `IMessageServiceContract` interface, used to interact with the blockchain contract. - * @param {IChainQuerier} chainQuerier - An instance of a class implementing the `IChainQuerier` interface, used to query blockchain data. + * @param {IProvider} provider - An instance of a class implementing the `IProvider` interface, used to query blockchain data. * @param {MessageClaimingPersisterConfig} config - Configuration for network-specific settings, including transaction submission timeout and maximum transaction retries. * @param {ILogger} logger - An instance of a class implementing the `ILogger` interface, used for logging messages. */ @@ -37,9 +39,10 @@ export class MessageClaimingPersister implements IMessageClaimingPersister { Overrides, TransactionReceipt, TransactionResponse, - ContractTransactionResponse + ContractTransactionResponse, + ErrorDescription >, - private readonly chainQuerier: IChainQuerier< + private readonly provider: IProvider< TransactionReceipt, Block, TransactionRequest, @@ -79,7 +82,7 @@ export class MessageClaimingPersister implements IMessageClaimingPersister { return; } - const receipt = await this.chainQuerier.getTransactionReceipt(firstPendingMessage.claimTxHash); + const receipt = await this.provider.getTransactionReceipt(firstPendingMessage.claimTxHash); if (!receipt) { if (this.isMessageExceededSubmissionTimeout(firstPendingMessage)) { this.logger.warn("Retrying to claim message: messageHash=%s", firstPendingMessage.messageHash); @@ -126,7 +129,7 @@ export class MessageClaimingPersister implements IMessageClaimingPersister { }); if (messageStatus === OnChainMessageStatus.CLAIMED) { - const receipt = await this.chainQuerier.getTransactionReceipt(transactionHash); + const receipt = await this.provider.getTransactionReceipt(transactionHash); if (!receipt) { this.logger.warn( "Calling retryTransaction again as message was claimed but transaction receipt is not available yet: messageHash=%s transactionHash=%s", diff --git a/sdk/src/services/processors/MessageClaimingProcessor.ts b/postman/src/services/processors/MessageClaimingProcessor.ts similarity index 94% rename from sdk/src/services/processors/MessageClaimingProcessor.ts rename to postman/src/services/processors/MessageClaimingProcessor.ts index 29b8d9dc4..515bde0c6 100644 --- a/sdk/src/services/processors/MessageClaimingProcessor.ts +++ b/postman/src/services/processors/MessageClaimingProcessor.ts @@ -5,18 +5,17 @@ import { ContractTransactionResponse, EthersError, TransactionReceipt, - TransactionRequest, - Block, - JsonRpcProvider, + Signer, + ErrorDescription, } from "ethers"; -import { MessageStatus, OnChainMessageStatus } from "../../core/enums/MessageEnums"; +import { OnChainMessageStatus } from "@consensys/linea-sdk"; +import { MessageStatus } from "../../core/enums"; import { IMessageClaimingProcessor, MessageClaimingProcessorConfig, } from "../../core/services/processors/IMessageClaimingProcessor"; import { ILogger } from "../../core/utils/logging/ILogger"; import { IMessageServiceContract } from "../../core/services/contracts/IMessageServiceContract"; -import { IChainQuerier } from "../../core/clients/blockchain/IChainQuerier"; import { Message } from "../../core/entities/Message"; import { IMessageDBService } from "../../core/persistence/IMessageDBService"; import { ITransactionValidationService } from "../../core/services/ITransactionValidationService"; @@ -28,7 +27,7 @@ export class MessageClaimingProcessor implements IMessageClaimingProcessor { * Initializes a new instance of the `MessageClaimingProcessor`. * * @param {IMessageServiceContract} messageServiceContract - An instance of a class implementing the `IMessageServiceContract` interface, used to interact with the blockchain contract. - * @param {IChainQuerier} chainQuerier - An instance of a class implementing the `IChainQuerier` interface, used to query blockchain data. + * @param {Signer} signer - An instance of a class implementing the `Signer` interface, used to query blockchain data. * @param {IMessageDBService} databaseService - An instance of a class implementing the `IMessageDBService` interface, used for storing and retrieving message data. * @param {ITransactionValidationService} transactionValidationService - An instance of a class implementing the `ITransactionValidationService` interface, used for validating transactions. * @param {MessageClaimingProcessorConfig} config - Configuration for network-specific settings, including transaction submission timeout, maximum transaction retries, and gas limit. @@ -39,15 +38,10 @@ export class MessageClaimingProcessor implements IMessageClaimingProcessor { Overrides, TransactionReceipt, TransactionResponse, - ContractTransactionResponse - >, - private readonly chainQuerier: IChainQuerier< - TransactionReceipt, - Block, - TransactionRequest, - TransactionResponse, - JsonRpcProvider + ContractTransactionResponse, + ErrorDescription >, + private readonly signer: Signer, private readonly databaseService: IMessageDBService, private readonly transactionValidationService: ITransactionValidationService, private readonly config: MessageClaimingProcessorConfig, @@ -129,7 +123,7 @@ export class MessageClaimingProcessor implements IMessageClaimingProcessor { private async getNonce(): Promise { const lastTxNonce = await this.databaseService.getLastClaimTxNonce(this.config.direction); - let nonce = await this.chainQuerier.getCurrentNonce(); + let nonce = await this.signer.getNonce(); if (lastTxNonce) { if (lastTxNonce - nonce > this.maxNonceDiff) { this.logger.warn( diff --git a/sdk/src/services/processors/MessageSentEventProcessor.ts b/postman/src/services/processors/MessageSentEventProcessor.ts similarity index 89% rename from sdk/src/services/processors/MessageSentEventProcessor.ts rename to postman/src/services/processors/MessageSentEventProcessor.ts index 857bb8507..b046e8e00 100644 --- a/sdk/src/services/processors/MessageSentEventProcessor.ts +++ b/postman/src/services/processors/MessageSentEventProcessor.ts @@ -1,15 +1,3 @@ -import { ILineaRollupLogClient } from "../../core/clients/blockchain/ethereum/ILineaRollupLogClient"; -import { IChainQuerier } from "../../core/clients/blockchain/IChainQuerier"; -import { MessageFactory } from "../../core/entities/MessageFactory"; -import { ILogger } from "../../core/utils/logging/ILogger"; -import { MessageStatus } from "../../core/enums/MessageEnums"; -import { IL2MessageServiceLogClient } from "../../core/clients/blockchain/linea/IL2MessageServiceLogClient"; -import { - IMessageSentEventProcessor, - MessageSentEventProcessorConfig, -} from "../../core/services/processors/IMessageSentEventProcessor"; -import { isEmptyBytes } from "../../core/utils/shared"; -import { serialize } from "../../core/utils/serialize"; import { Block, ContractTransactionResponse, @@ -18,6 +6,17 @@ import { TransactionRequest, TransactionResponse, } from "ethers"; +import { serialize, isEmptyBytes } from "@consensys/linea-sdk"; +import { ILineaRollupLogClient } from "../../core/clients/blockchain/ethereum/ILineaRollupLogClient"; +import { IProvider } from "../../core/clients/blockchain/IProvider"; +import { MessageFactory } from "../../core/entities/MessageFactory"; +import { ILogger } from "../../core/utils/logging/ILogger"; +import { MessageStatus } from "../../core/enums"; +import { IL2MessageServiceLogClient } from "../../core/clients/blockchain/linea/IL2MessageServiceLogClient"; +import { + IMessageSentEventProcessor, + MessageSentEventProcessorConfig, +} from "../../core/services/processors/IMessageSentEventProcessor"; import { IMessageDBService } from "../../core/persistence/IMessageDBService"; export class MessageSentEventProcessor implements IMessageSentEventProcessor { @@ -28,14 +27,14 @@ export class MessageSentEventProcessor implements IMessageSentEventProcessor { * * @param {IMessageDBService} databaseService - An instance of a class implementing the `IMessageDBService` interface, used for storing and retrieving message data. * @param {ILineaRollupLogClient | IL2MessageServiceLogClient} logClient - An instance of a class implementing the `ILineaRollupLogClient` or the `IL2MessageServiceLogClient` interface for fetching message sent events from the blockchain. - * @param {IChainQuerier} chainQuerier - An instance of a class implementing the `IChainQuerier` interface, used to query blockchain data. + * @param {IProvider} provider - An instance of a class implementing the `IProvider` interface, used to query blockchain data. * @param {MessageSentEventProcessorConfig} config - Configuration for network-specific settings, including listener parameters and feature flags. * @param {ILogger} logger - An instance of a class implementing the `ILogger` interface, used for logging messages. */ constructor( private readonly databaseService: IMessageDBService, private readonly logClient: ILineaRollupLogClient | IL2MessageServiceLogClient, - private readonly chainQuerier: IChainQuerier< + private readonly provider: IProvider< TransactionReceipt, Block, TransactionRequest, @@ -73,10 +72,7 @@ export class MessageSentEventProcessor implements IMessageSentEventProcessor { fromBlock: number, fromBlockLogIndex: number, ): Promise<{ nextFromBlock: number; nextFromBlockLogIndex: number }> { - const latestBlockNumber = Math.max( - (await this.chainQuerier.getCurrentBlockNumber()) - this.config.blockConfirmation, - 0, - ); + const latestBlockNumber = Math.max((await this.provider.getBlockNumber()) - this.config.blockConfirmation, 0); const toBlock = Math.min(latestBlockNumber, fromBlock + this.maxBlocksToFetchLogs); fromBlock = this.calculateFromBlockNumber(fromBlock, toBlock); diff --git a/sdk/src/services/processors/__tests__/EthereumTransactionValidationService.test.ts b/postman/src/services/processors/__tests__/EthereumTransactionValidationService.test.ts similarity index 93% rename from sdk/src/services/processors/__tests__/EthereumTransactionValidationService.test.ts rename to postman/src/services/processors/__tests__/EthereumTransactionValidationService.test.ts index 75133703f..b36f8bd5a 100644 --- a/sdk/src/services/processors/__tests__/EthereumTransactionValidationService.test.ts +++ b/postman/src/services/processors/__tests__/EthereumTransactionValidationService.test.ts @@ -2,13 +2,15 @@ import { describe, it, beforeEach } from "@jest/globals"; import { mock } from "jest-mock-extended"; import { ContractTransactionResponse, - JsonRpcProvider, + ErrorDescription, Overrides, TransactionReceipt, TransactionResponse, Wallet, } from "ethers"; +import { DefaultGasProvider, LineaProvider, Provider, testingHelpers } from "@consensys/linea-sdk"; import { + DEFAULT_MAX_FEE_PER_GAS, TEST_CONTRACT_ADDRESS_1, TEST_CONTRACT_ADDRESS_2, TEST_L1_SIGNER_PRIVATE_KEY, @@ -17,13 +19,11 @@ import { import { DEFAULT_GAS_ESTIMATION_PERCENTILE, DEFAULT_MAX_CLAIM_GAS_LIMIT, - DEFAULT_MAX_FEE_PER_GAS, + DEFAULT_MAX_FEE_PER_GAS_CAP, DEFAULT_PROFIT_MARGIN, } from "../../../core/constants"; import { EthereumTransactionValidationService } from "../../EthereumTransactionValidationService"; -import { DefaultGasProvider } from "../../../clients/blockchain/gas/DefaultGasProvider"; import { ILineaRollupClient } from "../../../core/clients/blockchain/ethereum/ILineaRollupClient"; -import { generateLineaRollupClient } from "../../../utils/testing/helpers"; describe("EthereumTransactionValidationService", () => { let lineaTransactionValidationService: EthereumTransactionValidationService; @@ -33,20 +33,21 @@ describe("EthereumTransactionValidationService", () => { Overrides, TransactionReceipt, TransactionResponse, - ContractTransactionResponse + ContractTransactionResponse, + ErrorDescription >; beforeEach(() => { - const clients = generateLineaRollupClient( - mock(), - mock(), + const clients = testingHelpers.generateLineaRollupClient( + mock(), + mock(), TEST_CONTRACT_ADDRESS_1, TEST_CONTRACT_ADDRESS_2, "read-write", new Wallet(TEST_L1_SIGNER_PRIVATE_KEY), { gasEstimationPercentile: DEFAULT_GAS_ESTIMATION_PERCENTILE, - maxFeePerGas: DEFAULT_MAX_FEE_PER_GAS, + maxFeePerGasCap: DEFAULT_MAX_FEE_PER_GAS_CAP, enforceMaxGasFee: false, }, ); diff --git a/sdk/src/services/processors/__tests__/L2ClaimMessageTransactionSizeProcessor.test.ts b/postman/src/services/processors/__tests__/L2ClaimMessageTransactionSizeProcessor.test.ts similarity index 88% rename from sdk/src/services/processors/__tests__/L2ClaimMessageTransactionSizeProcessor.test.ts rename to postman/src/services/processors/__tests__/L2ClaimMessageTransactionSizeProcessor.test.ts index 4bbcd8100..080fd536f 100644 --- a/sdk/src/services/processors/__tests__/L2ClaimMessageTransactionSizeProcessor.test.ts +++ b/postman/src/services/processors/__tests__/L2ClaimMessageTransactionSizeProcessor.test.ts @@ -1,13 +1,20 @@ import { describe, it, beforeEach } from "@jest/globals"; import { mock } from "jest-mock-extended"; -import { ContractTransactionResponse, Overrides, Signer, TransactionReceipt, TransactionResponse } from "ethers"; +import { + ContractTransactionResponse, + ErrorDescription, + Overrides, + Signer, + TransactionReceipt, + TransactionResponse, +} from "ethers"; +import { Direction } from "@consensys/linea-sdk"; import { TestLogger } from "../../../utils/testing/helpers"; -import { Direction, MessageStatus } from "../../../core/enums/MessageEnums"; -import { testL1NetworkConfig, testMessage } from "../../../utils/testing/constants"; +import { MessageStatus } from "../../../core/enums"; +import { testL1NetworkConfig, testMessage, DEFAULT_MAX_FEE_PER_GAS } from "../../../utils/testing/constants"; import { EthereumMessageDBService } from "../../persistence/EthereumMessageDBService"; import { L2ClaimMessageTransactionSizeProcessor } from "../L2ClaimMessageTransactionSizeProcessor"; import { L2ClaimTransactionSizeCalculator } from "../../L2ClaimTransactionSizeCalculator"; -import { DEFAULT_MAX_FEE_PER_GAS } from "../../../core/constants"; import { IL2MessageServiceClient } from "../../../core/clients/blockchain/linea/IL2MessageServiceClient"; describe("L2ClaimMessageTransactionSizeProcessor", () => { @@ -17,7 +24,14 @@ describe("L2ClaimMessageTransactionSizeProcessor", () => { const databaseService = mock(); const l2ContractClientMock = mock< - IL2MessageServiceClient + IL2MessageServiceClient< + Overrides, + TransactionReceipt, + TransactionResponse, + ContractTransactionResponse, + Signer, + ErrorDescription + > >(); const logger = new TestLogger(L2ClaimMessageTransactionSizeProcessor.name); diff --git a/sdk/src/services/processors/__tests__/L2ClaimTransactionSizeCalculator.test.ts b/postman/src/services/processors/__tests__/L2ClaimTransactionSizeCalculator.test.ts similarity index 80% rename from sdk/src/services/processors/__tests__/L2ClaimTransactionSizeCalculator.test.ts rename to postman/src/services/processors/__tests__/L2ClaimTransactionSizeCalculator.test.ts index c41717e42..da6dd945c 100644 --- a/sdk/src/services/processors/__tests__/L2ClaimTransactionSizeCalculator.test.ts +++ b/postman/src/services/processors/__tests__/L2ClaimTransactionSizeCalculator.test.ts @@ -2,21 +2,25 @@ import { describe, it, beforeEach } from "@jest/globals"; import { mock } from "jest-mock-extended"; import { ContractTransactionResponse, - JsonRpcProvider, + ErrorDescription, Overrides, Signer, TransactionReceipt, TransactionResponse, Wallet, } from "ethers"; -import { TEST_CONTRACT_ADDRESS_2, TEST_L2_SIGNER_PRIVATE_KEY, testMessage } from "../../../utils/testing/constants"; +import { LineaProvider, serialize, testingHelpers } from "@consensys/linea-sdk"; +import { + DEFAULT_MAX_FEE_PER_GAS, + TEST_CONTRACT_ADDRESS_2, + TEST_L2_SIGNER_PRIVATE_KEY, + testMessage, +} from "../../../utils/testing/constants"; import { EthereumMessageDBService } from "../../persistence/EthereumMessageDBService"; import { L2ClaimTransactionSizeCalculator } from "../../L2ClaimTransactionSizeCalculator"; -import { DEFAULT_MAX_FEE_PER_GAS } from "../../../core/constants"; +import { DEFAULT_MAX_FEE_PER_GAS_CAP } from "../../../core/constants"; +import { BaseError } from "../../../core/errors"; import { IL2MessageServiceClient } from "../../../core/clients/blockchain/linea/IL2MessageServiceClient"; -import { serialize } from "../../../core/utils/serialize"; -import { BaseError } from "../../../core/errors/Base"; -import { generateL2MessageServiceClient } from "../../../utils/testing/helpers"; describe("L2ClaimTransactionSizeCalculator", () => { let transactionSizeCalculator: L2ClaimTransactionSizeCalculator; @@ -27,17 +31,18 @@ describe("L2ClaimTransactionSizeCalculator", () => { TransactionReceipt, TransactionResponse, ContractTransactionResponse, - Signer + Signer, + ErrorDescription >; beforeEach(() => { - const clients = generateL2MessageServiceClient( - mock(), + const clients = testingHelpers.generateL2MessageServiceClient( + mock(), TEST_CONTRACT_ADDRESS_2, "read-only", undefined, { - maxFeePerGas: DEFAULT_MAX_FEE_PER_GAS, + maxFeePerGasCap: DEFAULT_MAX_FEE_PER_GAS_CAP, enforceMaxGasFee: false, }, ); diff --git a/sdk/src/services/processors/__tests__/LineaTransactionValidationService.test.ts b/postman/src/services/processors/__tests__/LineaTransactionValidationService.test.ts similarity index 82% rename from sdk/src/services/processors/__tests__/LineaTransactionValidationService.test.ts rename to postman/src/services/processors/__tests__/LineaTransactionValidationService.test.ts index f5cd9163b..0bf9fc781 100644 --- a/sdk/src/services/processors/__tests__/LineaTransactionValidationService.test.ts +++ b/postman/src/services/processors/__tests__/LineaTransactionValidationService.test.ts @@ -1,56 +1,64 @@ import { describe, it, beforeEach } from "@jest/globals"; -import { mock } from "jest-mock-extended"; +import { mock, MockProxy } from "jest-mock-extended"; import { ContractTransactionResponse, - JsonRpcProvider, + ErrorDescription, Overrides, Signer, TransactionReceipt, TransactionResponse, Wallet, } from "ethers"; -import { TEST_CONTRACT_ADDRESS_2, TEST_L2_SIGNER_PRIVATE_KEY, testMessage } from "../../../utils/testing/constants"; -import { LineaGasProvider } from "../../../clients/blockchain/gas/LineaGasProvider"; -import { DEFAULT_MAX_CLAIM_GAS_LIMIT, DEFAULT_MAX_FEE_PER_GAS, DEFAULT_PROFIT_MARGIN } from "../../../core/constants"; +import { GasProvider, LineaProvider, testingHelpers } from "@consensys/linea-sdk"; +import { + DEFAULT_MAX_FEE_PER_GAS, + TEST_CONTRACT_ADDRESS_2, + TEST_L2_SIGNER_PRIVATE_KEY, + testMessage, +} from "../../../utils/testing/constants"; +import { + DEFAULT_MAX_CLAIM_GAS_LIMIT, + DEFAULT_MAX_FEE_PER_GAS_CAP, + DEFAULT_PROFIT_MARGIN, +} from "../../../core/constants"; import { IL2MessageServiceClient } from "../../../core/clients/blockchain/linea/IL2MessageServiceClient"; import { LineaTransactionValidationService } from "../../LineaTransactionValidationService"; -import { generateL2MessageServiceClient } from "../../../utils/testing/helpers"; -import { L2ChainQuerier } from "../../../clients/blockchain/linea/L2ChainQuerier"; describe("LineaTransactionValidationService", () => { let lineaTransactionValidationService: LineaTransactionValidationService; - let gasProvider: LineaGasProvider; - let l2ChainQuerier: L2ChainQuerier; + let gasProvider: GasProvider; let l2ContractClient: IL2MessageServiceClient< Overrides, TransactionReceipt, TransactionResponse, ContractTransactionResponse, - Signer + Signer, + ErrorDescription >; + let provider: MockProxy; beforeEach(() => { - const clients = generateL2MessageServiceClient( - mock(), + provider = mock(); + const clients = testingHelpers.generateL2MessageServiceClient( + provider, TEST_CONTRACT_ADDRESS_2, "read-write", new Wallet(TEST_L2_SIGNER_PRIVATE_KEY), { - maxFeePerGas: DEFAULT_MAX_FEE_PER_GAS, + maxFeePerGasCap: DEFAULT_MAX_FEE_PER_GAS_CAP, enforceMaxGasFee: false, }, ); l2ContractClient = clients.l2MessageServiceClient; gasProvider = clients.gasProvider; - l2ChainQuerier = clients.l2ChainQuerier; lineaTransactionValidationService = new LineaTransactionValidationService( { profitMargin: DEFAULT_PROFIT_MARGIN, maxClaimGasLimit: DEFAULT_MAX_CLAIM_GAS_LIMIT, }, - l2ChainQuerier, + provider, l2ContractClient, ); }); @@ -68,7 +76,7 @@ describe("LineaTransactionValidationService", () => { maxPriorityFeePerGas: DEFAULT_MAX_FEE_PER_GAS, maxFeePerGas: DEFAULT_MAX_FEE_PER_GAS, }); - jest.spyOn(l2ChainQuerier, "getBlockExtraData").mockResolvedValueOnce(null); + jest.spyOn(provider, "getBlockExtraData").mockResolvedValueOnce(null); await expect(lineaTransactionValidationService.evaluateTransaction(testMessage)).rejects.toThrow("No extra data"); }); @@ -81,7 +89,7 @@ describe("LineaTransactionValidationService", () => { maxPriorityFeePerGas: DEFAULT_MAX_FEE_PER_GAS, maxFeePerGas: DEFAULT_MAX_FEE_PER_GAS, }); - jest.spyOn(l2ChainQuerier, "getBlockExtraData").mockResolvedValueOnce({ + jest.spyOn(provider, "getBlockExtraData").mockResolvedValueOnce({ version: 1, variableCost: 1_000_000, fixedCost: 1_000_000, @@ -110,7 +118,7 @@ describe("LineaTransactionValidationService", () => { maxPriorityFeePerGas: DEFAULT_MAX_FEE_PER_GAS, maxFeePerGas: DEFAULT_MAX_FEE_PER_GAS, }); - jest.spyOn(l2ChainQuerier, "getBlockExtraData").mockResolvedValueOnce({ + jest.spyOn(provider, "getBlockExtraData").mockResolvedValueOnce({ version: 1, variableCost: 1_000_000, fixedCost: 1_000_000, @@ -138,7 +146,7 @@ describe("LineaTransactionValidationService", () => { maxPriorityFeePerGas: DEFAULT_MAX_FEE_PER_GAS, maxFeePerGas: DEFAULT_MAX_FEE_PER_GAS, }); - jest.spyOn(l2ChainQuerier, "getBlockExtraData").mockResolvedValueOnce({ + jest.spyOn(provider, "getBlockExtraData").mockResolvedValueOnce({ version: 1, variableCost: 1_000_000, fixedCost: 1_000_000, @@ -166,7 +174,7 @@ describe("LineaTransactionValidationService", () => { maxPriorityFeePerGas: DEFAULT_MAX_FEE_PER_GAS, maxFeePerGas: DEFAULT_MAX_FEE_PER_GAS, }); - jest.spyOn(l2ChainQuerier, "getBlockExtraData").mockResolvedValueOnce({ + jest.spyOn(provider, "getBlockExtraData").mockResolvedValueOnce({ version: 1, variableCost: 1_000_000, fixedCost: 1_000_000, diff --git a/sdk/src/services/processors/__tests__/MessageAnchoringProcessor.test.ts b/postman/src/services/processors/__tests__/MessageAnchoringProcessor.test.ts similarity index 87% rename from sdk/src/services/processors/__tests__/MessageAnchoringProcessor.test.ts rename to postman/src/services/processors/__tests__/MessageAnchoringProcessor.test.ts index 93de3c711..4897ee932 100644 --- a/sdk/src/services/processors/__tests__/MessageAnchoringProcessor.test.ts +++ b/postman/src/services/processors/__tests__/MessageAnchoringProcessor.test.ts @@ -3,34 +3,44 @@ import { mock } from "jest-mock-extended"; import { Block, ContractTransactionResponse, + ErrorDescription, JsonRpcProvider, Overrides, TransactionReceipt, TransactionRequest, TransactionResponse, } from "ethers"; +import { OnChainMessageStatus } from "@consensys/linea-sdk"; import { TestLogger } from "../../../utils/testing/helpers"; import { IMessageAnchoringProcessor } from "../../../core/services/processors/IMessageAnchoringProcessor"; -import { MessageStatus, OnChainMessageStatus } from "../../../core/enums/MessageEnums"; +import { MessageStatus } from "../../../core/enums"; import { testL1NetworkConfig, testL2NetworkConfig, testMessage } from "../../../utils/testing/constants"; import { MessageAnchoringProcessor } from "../MessageAnchoringProcessor"; import { IMessageServiceContract } from "../../../core/services/contracts/IMessageServiceContract"; -import { IChainQuerier } from "../../../core/clients/blockchain/IChainQuerier"; import { EthereumMessageDBService } from "../../persistence/EthereumMessageDBService"; +import { IProvider } from "../../../core/clients/blockchain/IProvider"; describe("TestMessageAnchoringProcessor", () => { let anchoringProcessor: IMessageAnchoringProcessor; const databaseService = mock(); const l2ContractClientMock = - mock>(); - const l2QuerierMock = - mock>(); + mock< + IMessageServiceContract< + Overrides, + TransactionReceipt, + TransactionResponse, + ContractTransactionResponse, + ErrorDescription + > + >(); + const provider = + mock>(); const logger = new TestLogger(MessageAnchoringProcessor.name); beforeEach(() => { anchoringProcessor = new MessageAnchoringProcessor( l2ContractClientMock, - l2QuerierMock, + provider, databaseService, { maxFetchMessagesFromDb: testL2NetworkConfig.listener.maxFetchMessagesFromDb, @@ -73,7 +83,7 @@ describe("TestMessageAnchoringProcessor", () => { it("Should log as info and call saveMessages if returned messageStatus is CLAIMABLE", async () => { const loggerInfoSpy = jest.spyOn(logger, "info"); jest.spyOn(databaseService, "getNFirstMessagesSent").mockResolvedValue([testMessage]); - jest.spyOn(l2QuerierMock, "getCurrentBlockNumber").mockResolvedValue(10); + jest.spyOn(provider, "getBlockNumber").mockResolvedValue(10); jest.spyOn(l2ContractClientMock, "getMessageStatus").mockResolvedValue(OnChainMessageStatus.CLAIMABLE); const testMessageEditSpy = jest.spyOn(testMessage, "edit"); const messageRepositoryMockSaveSpy = jest.spyOn(databaseService, "saveMessages"); @@ -91,7 +101,7 @@ describe("TestMessageAnchoringProcessor", () => { it("Should log as info and call saveMessages if returned messageStatus is CLAIMED", async () => { const loggerInfoSpy = jest.spyOn(logger, "info"); jest.spyOn(databaseService, "getNFirstMessagesSent").mockResolvedValue([testMessage]); - jest.spyOn(l2QuerierMock, "getCurrentBlockNumber").mockResolvedValue(10); + jest.spyOn(provider, "getBlockNumber").mockResolvedValue(10); jest.spyOn(l2ContractClientMock, "getMessageStatus").mockResolvedValue(OnChainMessageStatus.CLAIMED); const testMessageEditSpy = jest.spyOn(testMessage, "edit"); const messageRepositoryMockSaveSpy = jest.spyOn(databaseService, "saveMessages"); @@ -113,7 +123,7 @@ describe("TestMessageAnchoringProcessor", () => { const loggerErrorSpy = jest.spyOn(logger, "error"); const error = new Error("Error for testing"); jest.spyOn(databaseService, "getNFirstMessagesSent").mockResolvedValue([testMessage]); - jest.spyOn(l2QuerierMock, "getCurrentBlockNumber").mockRejectedValue(error); + jest.spyOn(provider, "getBlockNumber").mockRejectedValue(error); const messageRepositoryMockSaveSpy = jest.spyOn(databaseService, "saveMessages"); await anchoringProcessor.process(); diff --git a/sdk/src/services/processors/__tests__/MessageClaimingPersister.test.ts b/postman/src/services/processors/__tests__/MessageClaimingPersister.test.ts similarity index 84% rename from sdk/src/services/processors/__tests__/MessageClaimingPersister.test.ts rename to postman/src/services/processors/__tests__/MessageClaimingPersister.test.ts index 91298e677..be19c62e9 100644 --- a/sdk/src/services/processors/__tests__/MessageClaimingPersister.test.ts +++ b/postman/src/services/processors/__tests__/MessageClaimingPersister.test.ts @@ -1,13 +1,14 @@ import { describe, it, beforeEach } from "@jest/globals"; import { mock } from "jest-mock-extended"; -import { TestLogger, generateTransactionReceipt, generateTransactionResponse } from "../../../utils/testing/helpers"; -import { Direction, MessageStatus, OnChainMessageStatus } from "../../../core/enums/MessageEnums"; +import { Direction, OnChainMessageStatus, testingHelpers } from "@consensys/linea-sdk"; +import { TestLogger } from "../../../utils/testing/helpers"; +import { MessageStatus } from "../../../core/enums"; import { testL2NetworkConfig, testPendingMessage, testPendingMessage2 } from "../../../utils/testing/constants"; -import { IChainQuerier } from "../../../core/clients/blockchain/IChainQuerier"; import { IMessageServiceContract } from "../../../core/services/contracts/IMessageServiceContract"; import { Block, ContractTransactionResponse, + ErrorDescription, JsonRpcProvider, Overrides, TransactionReceipt, @@ -15,28 +16,35 @@ import { TransactionResponse, } from "ethers"; import { IGasProvider } from "../../../core/clients/blockchain/IGasProvider"; -import { Message } from "../../.."; +import { Message } from "../../../core/entities/Message"; import { IMessageClaimingPersister } from "../../../core/services/processors/IMessageClaimingPersister"; import { MessageClaimingPersister } from "../MessageClaimingPersister"; import { EthereumMessageDBService } from "../../persistence/EthereumMessageDBService"; +import { IProvider } from "../../../core/clients/blockchain/IProvider"; describe("TestMessageClaimingPersister ", () => { let messageClaimingPersister: IMessageClaimingPersister; let mockedDate: Date; const databaseService = mock(); const l2MessageServiceContractMock = mock< - IMessageServiceContract & + IMessageServiceContract< + Overrides, + TransactionReceipt, + TransactionResponse, + ContractTransactionResponse, + ErrorDescription + > & IGasProvider >(); - const l2QuerierMock = - mock>(); + const provider = + mock>(); const logger = new TestLogger(MessageClaimingPersister.name); beforeEach(() => { messageClaimingPersister = new MessageClaimingPersister( databaseService, l2MessageServiceContractMock, - l2QuerierMock, + provider, { direction: Direction.L1_TO_L2, messageSubmissionTimeout: testL2NetworkConfig.claiming.messageSubmissionTimeout, @@ -56,7 +64,7 @@ describe("TestMessageClaimingPersister ", () => { describe("process", () => { it("Should return if getTransactionReceipt return null", async () => { - const l2QuerierGetReceiptSpy = jest.spyOn(l2QuerierMock, "getTransactionReceipt"); + const l2QuerierGetReceiptSpy = jest.spyOn(provider, "getTransactionReceipt"); jest.spyOn(databaseService, "getFirstPendingMessage").mockResolvedValue(null); await messageClaimingPersister.process(); @@ -69,7 +77,7 @@ describe("TestMessageClaimingPersister ", () => { const getTxReceiptError = new Error("error for testing"); const loggerErrorSpy = jest.spyOn(logger, "error"); jest.spyOn(databaseService, "getFirstPendingMessage").mockResolvedValue(testPendingMessageLocal); - jest.spyOn(l2QuerierMock, "getTransactionReceipt").mockRejectedValue(getTxReceiptError); + jest.spyOn(provider, "getTransactionReceipt").mockRejectedValue(getTxReceiptError); await messageClaimingPersister.process(); @@ -78,9 +86,9 @@ describe("TestMessageClaimingPersister ", () => { }); it("Should log as info and update message as claimed success if successful", async () => { - const txReceipt = generateTransactionReceipt({ status: 1 }); + const txReceipt = testingHelpers.generateTransactionReceipt({ status: 1 }); const loggerInfoSpy = jest.spyOn(logger, "info"); - const l2QuerierGetReceiptSpy = jest.spyOn(l2QuerierMock, "getTransactionReceipt").mockResolvedValue(txReceipt); + const l2QuerierGetReceiptSpy = jest.spyOn(provider, "getTransactionReceipt").mockResolvedValue(txReceipt); const messageRepositorySaveSpy = jest.spyOn(databaseService, "updateMessage"); const testPendingMessageLocal = new Message(testPendingMessage); jest.spyOn(databaseService, "getFirstPendingMessage").mockResolvedValue(testPendingMessageLocal); @@ -104,8 +112,8 @@ describe("TestMessageClaimingPersister ", () => { }); it("Should return and update message as sent if receipt status is 0 and rate limit exceeded", async () => { - const txReceipt = generateTransactionReceipt({ status: 0 }); - const l2QuerierGetReceiptSpy = jest.spyOn(l2QuerierMock, "getTransactionReceipt").mockResolvedValue(txReceipt); + const txReceipt = testingHelpers.generateTransactionReceipt({ status: 0 }); + const l2QuerierGetReceiptSpy = jest.spyOn(provider, "getTransactionReceipt").mockResolvedValue(txReceipt); const messageRepositorySaveSpy = jest.spyOn(databaseService, "updateMessage"); const testPendingMessageLocal = new Message(testPendingMessage); jest.spyOn(databaseService, "getFirstPendingMessage").mockResolvedValue(testPendingMessageLocal); @@ -125,8 +133,8 @@ describe("TestMessageClaimingPersister ", () => { it("Should log as warning and update message as claimed reverted if receipt status is 0", async () => { const loggerWarnSpy = jest.spyOn(logger, "warn"); - const txReceipt = generateTransactionReceipt({ status: 0 }); - const l2QuerierGetReceiptSpy = jest.spyOn(l2QuerierMock, "getTransactionReceipt").mockResolvedValue(txReceipt); + const txReceipt = testingHelpers.generateTransactionReceipt({ status: 0 }); + const l2QuerierGetReceiptSpy = jest.spyOn(provider, "getTransactionReceipt").mockResolvedValue(txReceipt); const messageRepositorySaveSpy = jest.spyOn(databaseService, "updateMessage"); const testPendingMessageLocal = new Message(testPendingMessage); jest.spyOn(databaseService, "getFirstPendingMessage").mockResolvedValue(testPendingMessageLocal); @@ -152,15 +160,15 @@ describe("TestMessageClaimingPersister ", () => { it("Should return and log as warning if message is claimed and receipt was retrieved successfully", async () => { const loggerWarnSpy = jest.spyOn(logger, "warn"); - const txReceipt = generateTransactionReceipt({ status: 1 }); + const txReceipt = testingHelpers.generateTransactionReceipt({ status: 1 }); const l2QuerierGetReceiptSpy = jest - .spyOn(l2QuerierMock, "getTransactionReceipt") + .spyOn(provider, "getTransactionReceipt") .mockResolvedValueOnce(null) .mockResolvedValueOnce(txReceipt); const messageRepositorySaveSpy = jest.spyOn(databaseService, "saveMessages"); const testPendingMessageLocal = new Message(testPendingMessage); jest.spyOn(databaseService, "getFirstPendingMessage").mockResolvedValue(testPendingMessageLocal); - jest.spyOn(l2QuerierMock, "getCurrentBlockNumber").mockResolvedValue(100); + jest.spyOn(provider, "getBlockNumber").mockResolvedValue(100); jest.spyOn(l2MessageServiceContractMock, "isRateLimitExceededError").mockResolvedValue(false); jest.spyOn(l2MessageServiceContractMock, "getMessageStatus").mockResolvedValue(OnChainMessageStatus.CLAIMED); @@ -184,11 +192,11 @@ describe("TestMessageClaimingPersister ", () => { it("Should return and log as warning if message is claimed but receipt returned as null", async () => { const loggerWarnSpy = jest.spyOn(logger, "warn"); - const l2QuerierGetReceiptSpy = jest.spyOn(l2QuerierMock, "getTransactionReceipt").mockResolvedValue(null); + const l2QuerierGetReceiptSpy = jest.spyOn(provider, "getTransactionReceipt").mockResolvedValue(null); const messageRepositorySaveSpy = jest.spyOn(databaseService, "saveMessages"); const testPendingMessageLocal = new Message(testPendingMessage); jest.spyOn(databaseService, "getFirstPendingMessage").mockResolvedValue(testPendingMessageLocal); - jest.spyOn(l2QuerierMock, "getCurrentBlockNumber").mockResolvedValue(100); + jest.spyOn(provider, "getBlockNumber").mockResolvedValue(100); jest.spyOn(l2MessageServiceContractMock, "isRateLimitExceededError").mockResolvedValue(false); jest.spyOn(l2MessageServiceContractMock, "getMessageStatus").mockResolvedValue(OnChainMessageStatus.CLAIMED); @@ -212,14 +220,17 @@ describe("TestMessageClaimingPersister ", () => { it("Should return and log as warning if message is claimable and retry tx was sent successfully", async () => { const loggerWarnSpy = jest.spyOn(logger, "warn"); - const txReceipt = generateTransactionReceipt({ status: 1 }); - const txResponse = generateTransactionResponse({ maxPriorityFeePerGas: undefined, maxFeePerGas: undefined }); - const l2QuerierGetReceiptSpy = jest.spyOn(l2QuerierMock, "getTransactionReceipt").mockResolvedValue(null); + const txReceipt = testingHelpers.generateTransactionReceipt({ status: 1 }); + const txResponse = testingHelpers.generateTransactionResponse({ + maxPriorityFeePerGas: undefined, + maxFeePerGas: undefined, + }); + const l2QuerierGetReceiptSpy = jest.spyOn(provider, "getTransactionReceipt").mockResolvedValue(null); const messageRepositorySaveSpy = jest.spyOn(databaseService, "updateMessage"); const testPendingMessageLocal = new Message(testPendingMessage); jest.spyOn(databaseService, "getFirstPendingMessage").mockResolvedValue(testPendingMessageLocal); - jest.spyOn(l2QuerierMock, "getCurrentBlockNumber").mockResolvedValue(100); + jest.spyOn(provider, "getBlockNumber").mockResolvedValue(100); jest.spyOn(l2MessageServiceContractMock, "isRateLimitExceededError").mockResolvedValue(false); jest .spyOn(l2MessageServiceContractMock, "getMessageStatus") @@ -254,9 +265,12 @@ describe("TestMessageClaimingPersister ", () => { it("Should return and log as warning if message is claimable and retry tx was sent successfully", async () => { const loggerWarnSpy = jest.spyOn(logger, "warn"); - const txReceipt = generateTransactionReceipt({ status: 1 }); - const txResponse = generateTransactionResponse({ maxPriorityFeePerGas: undefined, maxFeePerGas: undefined }); - const l2QuerierGetReceiptSpy = jest.spyOn(l2QuerierMock, "getTransactionReceipt").mockResolvedValue(null); + const txReceipt = testingHelpers.generateTransactionReceipt({ status: 1 }); + const txResponse = testingHelpers.generateTransactionResponse({ + maxPriorityFeePerGas: undefined, + maxFeePerGas: undefined, + }); + const l2QuerierGetReceiptSpy = jest.spyOn(provider, "getTransactionReceipt").mockResolvedValue(null); const messageRepositorySaveSpy = jest.spyOn(databaseService, "updateMessage"); const testPendingMessageLocal = new Message(testPendingMessage); const testPendingMessageLocal2 = new Message(testPendingMessage2); @@ -264,7 +278,7 @@ describe("TestMessageClaimingPersister ", () => { .spyOn(databaseService, "getFirstPendingMessage") .mockResolvedValueOnce(testPendingMessageLocal) .mockResolvedValueOnce(testPendingMessageLocal2); - jest.spyOn(l2QuerierMock, "getCurrentBlockNumber").mockResolvedValue(100); + jest.spyOn(provider, "getBlockNumber").mockResolvedValue(100); jest.spyOn(l2MessageServiceContractMock, "isRateLimitExceededError").mockResolvedValue(false); jest .spyOn(l2MessageServiceContractMock, "getMessageStatus") @@ -303,7 +317,7 @@ describe("TestMessageClaimingPersister ", () => { messageClaimingPersister = new MessageClaimingPersister( databaseService, l2MessageServiceContractMock, - l2QuerierMock, + provider, { direction: Direction.L1_TO_L2, messageSubmissionTimeout: 0, @@ -313,12 +327,12 @@ describe("TestMessageClaimingPersister ", () => { ); const loggerWarnSpy = jest.spyOn(logger, "warn"); const loggerErrorSpy = jest.spyOn(logger, "error"); - const l2QuerierGetReceiptSpy = jest.spyOn(l2QuerierMock, "getTransactionReceipt").mockResolvedValue(null); + const l2QuerierGetReceiptSpy = jest.spyOn(provider, "getTransactionReceipt").mockResolvedValue(null); const messageRepositorySaveSpy = jest.spyOn(databaseService, "saveMessages"); const testPendingMessageLocal = new Message(testPendingMessage); const retryError = new Error("error for testing"); jest.spyOn(databaseService, "getFirstPendingMessage").mockResolvedValue(testPendingMessageLocal); - jest.spyOn(l2QuerierMock, "getCurrentBlockNumber").mockResolvedValue(100); + jest.spyOn(provider, "getBlockNumber").mockResolvedValue(100); jest.spyOn(l2MessageServiceContractMock, "isRateLimitExceededError").mockResolvedValue(false); jest.spyOn(l2MessageServiceContractMock, "getMessageStatus").mockResolvedValue(OnChainMessageStatus.CLAIMABLE); jest.spyOn(l2MessageServiceContractMock, "retryTransactionWithHigherFee").mockRejectedValue(retryError); @@ -356,12 +370,12 @@ describe("TestMessageClaimingPersister ", () => { it("Should return and log as error if message is claimable but tx response wait returns null", async () => { const loggerWarnSpy = jest.spyOn(logger, "warn"); const loggerErrorSpy = jest.spyOn(logger, "error"); - const txResponse = generateTransactionResponse(); - const l2QuerierGetReceiptSpy = jest.spyOn(l2QuerierMock, "getTransactionReceipt").mockResolvedValue(null); + const txResponse = testingHelpers.generateTransactionResponse(); + const l2QuerierGetReceiptSpy = jest.spyOn(provider, "getTransactionReceipt").mockResolvedValue(null); const messageRepositorySaveSpy = jest.spyOn(databaseService, "saveMessages"); const testPendingMessageLocal = new Message(testPendingMessage); jest.spyOn(databaseService, "getFirstPendingMessage").mockResolvedValue(testPendingMessageLocal); - jest.spyOn(l2QuerierMock, "getCurrentBlockNumber").mockResolvedValue(100); + jest.spyOn(provider, "getBlockNumber").mockResolvedValue(100); jest.spyOn(l2MessageServiceContractMock, "isRateLimitExceededError").mockResolvedValue(false); jest.spyOn(l2MessageServiceContractMock, "getMessageStatus").mockResolvedValue(OnChainMessageStatus.CLAIMABLE); jest.spyOn(l2MessageServiceContractMock, "retryTransactionWithHigherFee").mockResolvedValue(txResponse); diff --git a/sdk/src/services/processors/__tests__/MessageClaimingProcessor.test.ts b/postman/src/services/processors/__tests__/MessageClaimingProcessor.test.ts similarity index 89% rename from sdk/src/services/processors/__tests__/MessageClaimingProcessor.test.ts rename to postman/src/services/processors/__tests__/MessageClaimingProcessor.test.ts index 05d01506a..0af999d9c 100644 --- a/sdk/src/services/processors/__tests__/MessageClaimingProcessor.test.ts +++ b/postman/src/services/processors/__tests__/MessageClaimingProcessor.test.ts @@ -1,8 +1,21 @@ import { describe, it, beforeEach } from "@jest/globals"; import { mock } from "jest-mock-extended"; +import { DefaultGasProvider, Provider, Direction, OnChainMessageStatus } from "@consensys/linea-sdk"; +import { + Block, + ContractTransactionResponse, + ErrorDescription, + EthersError, + Overrides, + Signer, + TransactionReceipt, + TransactionRequest, + TransactionResponse, +} from "ethers"; import { TestLogger } from "../../../utils/testing/helpers"; -import { Direction, MessageStatus, OnChainMessageStatus } from "../../../core/enums/MessageEnums"; +import { MessageStatus } from "../../../core/enums"; import { + DEFAULT_MAX_FEE_PER_GAS, TEST_CONTRACT_ADDRESS_2, testAnchoredMessage, testClaimedMessage, @@ -13,31 +26,20 @@ import { import { IMessageRepository } from "../../../core/persistence/IMessageRepository"; import { IMessageClaimingProcessor } from "../../../core/services/processors/IMessageClaimingProcessor"; import { MessageClaimingProcessor } from "../MessageClaimingProcessor"; -import { - Block, - ContractTransactionResponse, - EthersError, - JsonRpcProvider, - Overrides, - TransactionReceipt, - TransactionRequest, - TransactionResponse, -} from "ethers"; -import { Message } from "../../.."; +import { Message } from "../../../core/entities/Message"; import { ErrorParser } from "../../../utils/ErrorParser"; -import { IChainQuerier } from "../../../core/clients/blockchain/IChainQuerier"; import { EthereumMessageDBService } from "../../persistence/EthereumMessageDBService"; -import { DefaultGasProvider } from "../../../clients/blockchain/gas/DefaultGasProvider"; import { DEFAULT_GAS_ESTIMATION_PERCENTILE, DEFAULT_MAX_CLAIM_GAS_LIMIT, - DEFAULT_MAX_FEE_PER_GAS, + DEFAULT_MAX_FEE_PER_GAS_CAP, DEFAULT_MAX_NUMBER_OF_RETRIES, DEFAULT_PROFIT_MARGIN, DEFAULT_RETRY_DELAY_IN_SECONDS, } from "../../../core/constants"; import { EthereumTransactionValidationService } from "../../EthereumTransactionValidationService"; import { ILineaRollupClient } from "../../../core/clients/blockchain/ethereum/ILineaRollupClient"; +import { IProvider } from "../../../core/clients/blockchain/IProvider"; describe("TestMessageClaimingProcessor", () => { let messageClaimingProcessor: IMessageClaimingProcessor; @@ -46,14 +48,23 @@ describe("TestMessageClaimingProcessor", () => { let transactionValidationService: EthereumTransactionValidationService; let mockedDate: Date; const lineaRollupContractMock = - mock>(); - const l1QuerierMock = - mock>(); + mock< + ILineaRollupClient< + Overrides, + TransactionReceipt, + TransactionResponse, + ContractTransactionResponse, + ErrorDescription + > + >(); + const provider = mock>(); + const signer = mock(); + const logger = new TestLogger(MessageClaimingProcessor.name); beforeEach(() => { - gasProvider = new DefaultGasProvider(l1QuerierMock, { - maxFeePerGas: DEFAULT_MAX_FEE_PER_GAS, + gasProvider = new DefaultGasProvider(provider, { + maxFeePerGasCap: DEFAULT_MAX_FEE_PER_GAS_CAP, gasEstimationPercentile: DEFAULT_GAS_ESTIMATION_PERCENTILE, enforceMaxGasFee: false, }); @@ -64,7 +75,7 @@ describe("TestMessageClaimingProcessor", () => { }); messageClaimingProcessor = new MessageClaimingProcessor( lineaRollupContractMock, - l1QuerierMock, + signer, databaseService, transactionValidationService, { @@ -92,7 +103,7 @@ describe("TestMessageClaimingProcessor", () => { it("Should return and log as error if claim tx nonce is higher than the max diff", async () => { const loggerErrorSpy = jest.spyOn(logger, "error"); jest.spyOn(databaseService, "getLastClaimTxNonce").mockResolvedValue(100); - jest.spyOn(l1QuerierMock, "getCurrentNonce").mockResolvedValue(80); + jest.spyOn(signer, "getNonce").mockResolvedValue(80); await messageClaimingProcessor.process(); @@ -105,7 +116,7 @@ describe("TestMessageClaimingProcessor", () => { it("Should return without calling any get message status if getFirstMessageToClaim return null", async () => { const lineaRollupContractMsgStatusSpy = jest.spyOn(lineaRollupContractMock, "getMessageStatus"); jest.spyOn(databaseService, "getLastClaimTxNonce").mockResolvedValue(100); - jest.spyOn(l1QuerierMock, "getCurrentNonce").mockResolvedValue(99); + jest.spyOn(signer, "getNonce").mockResolvedValue(99); jest .spyOn(gasProvider, "getGasFees") .mockResolvedValue({ maxFeePerGas: 1000000000n, maxPriorityFeePerGas: 1000000000n }); @@ -121,7 +132,7 @@ describe("TestMessageClaimingProcessor", () => { const lineaRollupContractMsgStatusSpy = jest.spyOn(lineaRollupContractMock, "getMessageStatus"); const messageRepositorySaveSpy = jest.spyOn(databaseService, "updateMessage"); jest.spyOn(databaseService, "getLastClaimTxNonce").mockResolvedValue(100); - jest.spyOn(l1QuerierMock, "getCurrentNonce").mockResolvedValue(99); + jest.spyOn(signer, "getNonce").mockResolvedValue(99); jest .spyOn(gasProvider, "getGasFees") .mockResolvedValue({ maxFeePerGas: 1000000000n, maxPriorityFeePerGas: 1000000000n }); @@ -160,7 +171,7 @@ describe("TestMessageClaimingProcessor", () => { const lineaRollupContractMsgStatusSpy = jest.spyOn(lineaRollupContractMock, "getMessageStatus"); const messageRepositorySaveSpy = jest.spyOn(databaseService, "updateMessage"); jest.spyOn(databaseService, "getLastClaimTxNonce").mockResolvedValue(100); - jest.spyOn(l1QuerierMock, "getCurrentNonce").mockResolvedValue(99); + jest.spyOn(signer, "getNonce").mockResolvedValue(99); jest .spyOn(gasProvider, "getGasFees") .mockResolvedValue({ maxFeePerGas: 1000000000n, maxPriorityFeePerGas: 1000000000n }); @@ -186,7 +197,7 @@ describe("TestMessageClaimingProcessor", () => { const lineaRollupContractMsgStatusSpy = jest.spyOn(lineaRollupContractMock, "getMessageStatus"); const messageRepositorySaveSpy = jest.spyOn(databaseService, "updateMessage"); jest.spyOn(databaseService, "getLastClaimTxNonce").mockResolvedValue(100); - jest.spyOn(l1QuerierMock, "getCurrentNonce").mockResolvedValue(99); + jest.spyOn(signer, "getNonce").mockResolvedValue(99); jest .spyOn(gasProvider, "getGasFees") .mockResolvedValue({ maxFeePerGas: 1000000000n, maxPriorityFeePerGas: 1000000000n }); @@ -220,7 +231,7 @@ describe("TestMessageClaimingProcessor", () => { const lineaRollupContractMsgStatusSpy = jest.spyOn(lineaRollupContractMock, "getMessageStatus"); const messageRepositorySaveSpy = jest.spyOn(databaseService, "updateMessage"); jest.spyOn(databaseService, "getLastClaimTxNonce").mockResolvedValue(100); - jest.spyOn(l1QuerierMock, "getCurrentNonce").mockResolvedValue(99); + jest.spyOn(signer, "getNonce").mockResolvedValue(99); jest .spyOn(gasProvider, "getGasFees") .mockResolvedValue({ maxFeePerGas: 1000000000n, maxPriorityFeePerGas: 1000000000n }); @@ -260,7 +271,7 @@ describe("TestMessageClaimingProcessor", () => { const lineaRollupContractMsgStatusSpy = jest.spyOn(lineaRollupContractMock, "getMessageStatus"); const messageRepositorySaveSpy = jest.spyOn(databaseService, "updateMessage"); jest.spyOn(databaseService, "getLastClaimTxNonce").mockResolvedValue(100); - jest.spyOn(l1QuerierMock, "getCurrentNonce").mockResolvedValue(99); + jest.spyOn(signer, "getNonce").mockResolvedValue(99); jest .spyOn(gasProvider, "getGasFees") .mockResolvedValue({ maxFeePerGas: 1000000000n, maxPriorityFeePerGas: 1000000000n }); @@ -287,31 +298,12 @@ describe("TestMessageClaimingProcessor", () => { }); it("Should update message if successful", async () => { - // messageClaimingProcessor = new MessageClaimingProcessor( - // lineaRollupContractMock, - // l1QuerierMock, - // databaseService, - // new EthereumTransactionValidationService(lineaRollupContractMock, gasProvider, { - // profitMargin: DEFAULT_PROFIT_MARGIN, - // maxClaimGasLimit: DEFAULT_MAX_CLAIM_GAS_LIMIT, - // }), - // { - // ...testL2NetworkConfig, - // claiming: { - // signerPrivateKey: TEST_L2_SIGNER_PRIVATE_KEY, - // messageSubmissionTimeout: 300_000, - // }, - // }, - // Direction.L1_TO_L2, - // testL1NetworkConfig.messageServiceContractAddress, - // logger, - // ); const lineaRollupContractMsgStatusSpy = jest.spyOn(lineaRollupContractMock, "getMessageStatus"); const l2MessageServiceContractClaimSpy = jest.spyOn(lineaRollupContractMock, "claim"); const messageRepositorySaveSpy = jest.spyOn(databaseService, "updateMessage"); const messageRepositoryUpdateAtomicSpy = jest.spyOn(databaseService, "updateMessageWithClaimTxAtomic"); jest.spyOn(databaseService, "getLastClaimTxNonce").mockResolvedValue(100); - jest.spyOn(l1QuerierMock, "getCurrentNonce").mockResolvedValue(99); + jest.spyOn(signer, "getNonce").mockResolvedValue(99); jest .spyOn(gasProvider, "getGasFees") .mockResolvedValue({ maxFeePerGas: 1000000000n, maxPriorityFeePerGas: 1000000000n }); @@ -347,7 +339,7 @@ describe("TestMessageClaimingProcessor", () => { .spyOn(databaseService, "updateMessageWithClaimTxAtomic") .mockRejectedValue(actionRejectedError); jest.spyOn(databaseService, "getLastClaimTxNonce").mockResolvedValue(100); - jest.spyOn(l1QuerierMock, "getCurrentNonce").mockResolvedValue(99); + jest.spyOn(signer, "getNonce").mockResolvedValue(99); jest .spyOn(gasProvider, "getGasFees") .mockResolvedValue({ maxFeePerGas: 1000000000n, maxPriorityFeePerGas: 1000000000n }); diff --git a/sdk/src/services/processors/__tests__/MessageSentEventProcessor.test.ts b/postman/src/services/processors/__tests__/MessageSentEventProcessor.test.ts similarity index 90% rename from sdk/src/services/processors/__tests__/MessageSentEventProcessor.test.ts rename to postman/src/services/processors/__tests__/MessageSentEventProcessor.test.ts index bbf242457..5fc1d5a86 100644 --- a/sdk/src/services/processors/__tests__/MessageSentEventProcessor.test.ts +++ b/postman/src/services/processors/__tests__/MessageSentEventProcessor.test.ts @@ -1,13 +1,14 @@ import { describe, it, beforeEach } from "@jest/globals"; import { mock } from "jest-mock-extended"; import { TestLogger } from "../../../utils/testing/helpers"; -import { Direction, MessageStatus } from "../../../core/enums/MessageEnums"; +import { Direction } from "@consensys/linea-sdk"; +import { MessageStatus } from "../../../core/enums"; import { testL1NetworkConfig, testMessageSentEvent, testMessageSentEventWithCallData, } from "../../../utils/testing/constants"; -import { IChainQuerier } from "../../../core/clients/blockchain/IChainQuerier"; +import { IProvider } from "../../../core/clients/blockchain/IProvider"; import { IMessageSentEventProcessor } from "../../../core/services/processors/IMessageSentEventProcessor"; import { MessageSentEventProcessor } from "../MessageSentEventProcessor"; import { ILineaRollupLogClient } from "../../../core/clients/blockchain/ethereum/ILineaRollupLogClient"; @@ -19,15 +20,15 @@ describe("TestMessageSentEventProcessor", () => { let messageSentEventProcessor: IMessageSentEventProcessor; const databaseService = mock(); const l1LogClientMock = mock(); - const l1QuerierMock = - mock>(); + const provider = + mock>(); const logger = new TestLogger(MessageSentEventProcessor.name); beforeEach(() => { messageSentEventProcessor = new MessageSentEventProcessor( databaseService, l1LogClientMock, - l1QuerierMock, + provider, { direction: Direction.L1_TO_L2, maxBlocksToFetchLogs: testL1NetworkConfig.listener.maxBlocksToFetchLogs, @@ -47,7 +48,7 @@ describe("TestMessageSentEventProcessor", () => { it("Should insert message with status as sent into repository if the message is not excluded", async () => { const loggerInfoSpy = jest.spyOn(logger, "info"); const messageRepositoryInsertSpy = jest.spyOn(databaseService, "insertMessage"); - jest.spyOn(l1QuerierMock, "getCurrentBlockNumber").mockResolvedValue(100); + jest.spyOn(provider, "getBlockNumber").mockResolvedValue(100); jest.spyOn(l1LogClientMock, "getMessageSentEvents").mockResolvedValue([testMessageSentEvent]); const expectedMessageToInsert = MessageFactory.createMessage({ ...testMessageSentEvent, @@ -68,7 +69,7 @@ describe("TestMessageSentEventProcessor", () => { messageSentEventProcessor = new MessageSentEventProcessor( databaseService, l1LogClientMock, - l1QuerierMock, + provider, { direction: Direction.L1_TO_L2, maxBlocksToFetchLogs: testL1NetworkConfig.listener.maxBlocksToFetchLogs, @@ -80,7 +81,7 @@ describe("TestMessageSentEventProcessor", () => { ); const loggerInfoSpy = jest.spyOn(logger, "info"); const messageRepositoryInsertSpy = jest.spyOn(databaseService, "insertMessage"); - jest.spyOn(l1QuerierMock, "getCurrentBlockNumber").mockResolvedValue(100); + jest.spyOn(provider, "getBlockNumber").mockResolvedValue(100); jest.spyOn(l1LogClientMock, "getMessageSentEvents").mockResolvedValue([testMessageSentEvent]); const expectedMessageToInsert = MessageFactory.createMessage({ ...testMessageSentEvent, @@ -101,7 +102,7 @@ describe("TestMessageSentEventProcessor", () => { messageSentEventProcessor = new MessageSentEventProcessor( databaseService, l1LogClientMock, - l1QuerierMock, + provider, { direction: Direction.L1_TO_L2, maxBlocksToFetchLogs: testL1NetworkConfig.listener.maxBlocksToFetchLogs, @@ -113,7 +114,7 @@ describe("TestMessageSentEventProcessor", () => { ); const loggerInfoSpy = jest.spyOn(logger, "info"); const messageRepositoryInsertSpy = jest.spyOn(databaseService, "insertMessage"); - jest.spyOn(l1QuerierMock, "getCurrentBlockNumber").mockResolvedValue(100); + jest.spyOn(provider, "getBlockNumber").mockResolvedValue(100); jest.spyOn(l1LogClientMock, "getMessageSentEvents").mockResolvedValue([testMessageSentEventWithCallData]); const expectedMessageToInsert = MessageFactory.createMessage({ ...testMessageSentEventWithCallData, diff --git a/postman/src/services/processors/index.ts b/postman/src/services/processors/index.ts new file mode 100644 index 000000000..29b708249 --- /dev/null +++ b/postman/src/services/processors/index.ts @@ -0,0 +1,5 @@ +export { L2ClaimMessageTransactionSizeProcessor } from "./L2ClaimMessageTransactionSizeProcessor"; +export { MessageAnchoringProcessor } from "./MessageAnchoringProcessor"; +export { MessageClaimingPersister } from "./MessageClaimingPersister"; +export { MessageClaimingProcessor } from "./MessageClaimingProcessor"; +export { MessageSentEventProcessor } from "./MessageSentEventProcessor"; diff --git a/sdk/src/utils/ErrorParser.ts b/postman/src/utils/ErrorParser.ts similarity index 98% rename from sdk/src/utils/ErrorParser.ts rename to postman/src/utils/ErrorParser.ts index c4034822f..d24bfbf8b 100644 --- a/sdk/src/utils/ErrorParser.ts +++ b/postman/src/utils/ErrorParser.ts @@ -1,5 +1,5 @@ import { EthersError, ErrorCode } from "ethers"; -import { GasEstimationError } from "../core/errors/GasFeeErrors"; +import { GasEstimationError } from "@consensys/linea-sdk"; import { DatabaseAccessError } from "../core/errors/DatabaseErrors"; import { MessageProps } from "../core/entities/Message"; diff --git a/sdk/src/utils/WinstonLogger.ts b/postman/src/utils/WinstonLogger.ts similarity index 98% rename from sdk/src/utils/WinstonLogger.ts rename to postman/src/utils/WinstonLogger.ts index 28c0e9f8c..a7a3f3540 100644 --- a/sdk/src/utils/WinstonLogger.ts +++ b/postman/src/utils/WinstonLogger.ts @@ -1,9 +1,8 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { Logger as LoggerClass, LoggerOptions, createLogger, format, transports } from "winston"; import { EthersError } from "ethers"; +import { serialize, isString } from "@consensys/linea-sdk"; import { ILogger } from "../core/utils/logging/ILogger"; -import { isString } from "../core/utils/shared"; -import { serialize } from "../core/utils/serialize"; export class WinstonLogger implements ILogger { private logger: LoggerClass; diff --git a/sdk/src/utils/__tests__/ErrorParser.test.ts b/postman/src/utils/__tests__/ErrorParser.test.ts similarity index 98% rename from sdk/src/utils/__tests__/ErrorParser.test.ts rename to postman/src/utils/__tests__/ErrorParser.test.ts index f4f2fed0d..263c92af6 100644 --- a/sdk/src/utils/__tests__/ErrorParser.test.ts +++ b/postman/src/utils/__tests__/ErrorParser.test.ts @@ -1,9 +1,9 @@ import { describe, it, expect } from "@jest/globals"; -import { ErrorParser } from "../ErrorParser"; import { ErrorCode, EthersError } from "ethers"; -import { GasEstimationError } from "../../core/errors/GasFeeErrors"; -import { DatabaseAccessError } from "../../core/errors/DatabaseErrors"; -import { DatabaseErrorType, DatabaseRepoName } from "../../core/enums/DatabaseEnums"; +import { GasEstimationError } from "@consensys/linea-sdk"; +import { ErrorParser } from "../ErrorParser"; +import { DatabaseAccessError } from "../../core/errors"; +import { DatabaseErrorType, DatabaseRepoName } from "../../core/enums"; import { generateMessage } from "../testing/helpers"; describe("ErrorParser", () => { diff --git a/sdk/src/utils/testing/constants.ts b/postman/src/utils/testing/constants.ts similarity index 51% rename from sdk/src/utils/testing/constants.ts rename to postman/src/utils/testing/constants.ts index acd1b1dd3..e44be8d09 100644 --- a/sdk/src/utils/testing/constants.ts +++ b/postman/src/utils/testing/constants.ts @@ -1,12 +1,7 @@ +import { Direction, MessageSent } from "@consensys/linea-sdk"; import { L1NetworkConfig, L2NetworkConfig } from "../../application/postman/app/config/config"; import { Message, MessageProps } from "../../core/entities/Message"; -import { Direction, MessageStatus } from "../../core/enums/MessageEnums"; -import { L2MessagingBlockAnchored, MessageClaimed, MessageSent, ServiceVersionMigrated } from "../../core/types/Events"; -import { - L2MerkleRootAddedEvent, - L2MessagingBlockAnchoredEvent, - MessageSentEvent, -} from "../../clients/blockchain/typechain/LineaRollup"; +import { MessageStatus } from "../../core/enums"; import { DEFAULT_INITIAL_FROM_BLOCK, DEFAULT_L2_MESSAGE_TREE_DEPTH, @@ -18,13 +13,9 @@ import { DEFAULT_MAX_TX_RETRIES, DEFAULT_PROFIT_MARGIN, DEFAULT_RETRY_DELAY_IN_SECONDS, - L2_MERKLE_TREE_ADDED_EVENT_SIGNATURE, - L2_MESSAGING_BLOCK_ANCHORED_EVENT_SIGNATURE, - MESSAGE_SENT_EVENT_SIGNATURE, ZERO_ADDRESS, ZERO_HASH, } from "../../core/constants"; -import { MessageClaimedEvent, ServiceVersionMigratedEvent } from "../../clients/blockchain/typechain/L2MessageService"; export const TEST_L1_SIGNER_PRIVATE_KEY = "0x0000000000000000000000000000000000000000000000000000000000000001"; export const TEST_L2_SIGNER_PRIVATE_KEY = "0x0000000000000000000000000000000000000000000000000000000000000002"; @@ -39,13 +30,11 @@ export const TEST_MESSAGE_HASH = "0x10101010101010101010101010101010101010101010 export const TEST_MESSAGE_HASH_2 = "0x1010101010101010101010101010101010101010101010101010101010101020"; export const TEST_TRANSACTION_HASH = "0x2020202020202020202020202020202020202020202020202020202020202020"; -export const TEST_BLOCK_HASH = "0x1000000000000000000000000000000000000000000000000000000000000000"; - -export const TEST_MERKLE_ROOT = "0xfc3dfe7470d41465e77e7c929170578b14a066a2272c2469b60162c5282e05a6"; -export const TEST_MERKLE_ROOT_2 = "0x7777777777777777777777777777777777777777777777777777777777777777"; export const TEST_RPC_URL = "http://localhost:8545"; +export const DEFAULT_MAX_FEE_PER_GAS = 100000000000n; + export const testMessage = new Message({ messageSender: TEST_ADDRESS_1, destination: TEST_CONTRACT_ADDRESS_1, @@ -199,35 +188,11 @@ export const testMessageSentEventWithCallData: MessageSent = { messageHash: TEST_MESSAGE_HASH, }; -export const testL2MessagingBlockAnchoredEvent: L2MessagingBlockAnchored = { - blockNumber: 51, - logIndex: 0, - contractAddress: TEST_CONTRACT_ADDRESS_1, - transactionHash: TEST_TRANSACTION_HASH, - l2Block: 51n, -}; - -export const testMessageClaimedEvent: MessageClaimed = { - blockNumber: 100_000, - logIndex: 0, - contractAddress: TEST_CONTRACT_ADDRESS_1, - transactionHash: TEST_TRANSACTION_HASH, - messageHash: TEST_MESSAGE_HASH, -}; - -export const testServiceVersionMigratedEvent: ServiceVersionMigrated = { - blockNumber: 51, - logIndex: 0, - contractAddress: TEST_CONTRACT_ADDRESS_1, - transactionHash: TEST_TRANSACTION_HASH, - version: 2n, -}; - export const testL1NetworkConfig: L1NetworkConfig = { claiming: { signerPrivateKey: TEST_L1_SIGNER_PRIVATE_KEY, messageSubmissionTimeout: 300_000, - maxFeePerGas: 100_000_000n, + maxFeePerGasCap: 100_000_000n, gasEstimationPercentile: 15, maxNonceDiff: DEFAULT_MAX_NONCE_DIFF, isMaxGasFeeEnforced: false, @@ -254,7 +219,7 @@ export const testL2NetworkConfig: L2NetworkConfig = { claiming: { signerPrivateKey: TEST_L2_SIGNER_PRIVATE_KEY, messageSubmissionTimeout: 300_000, - maxFeePerGas: 100_000_000n, + maxFeePerGasCap: 100_000_000n, gasEstimationPercentile: 15, maxNonceDiff: 10, maxClaimGasLimit: DEFAULT_MAX_CLAIM_GAS_LIMIT, @@ -278,146 +243,3 @@ export const testL2NetworkConfig: L2NetworkConfig = { l2MessageTreeDepth: DEFAULT_L2_MESSAGE_TREE_DEPTH, enableLineaEstimateGas: false, }; - -export const testMessageSentEventLog: MessageSentEvent.Log = { - blockNumber: 51, - blockHash: TEST_BLOCK_HASH, - transactionIndex: 0, - removed: false, - address: TEST_CONTRACT_ADDRESS_1, - data: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000", - topics: [ - MESSAGE_SENT_EVENT_SIGNATURE, - `0x000000000000000000000000${TEST_ADDRESS_1.slice(2)}`, - `0x000000000000000000000000${TEST_ADDRESS_2.slice(2)}`, - TEST_MESSAGE_HASH, - ], - transactionHash: TEST_TRANSACTION_HASH, - index: 1, - removeListener: jest.fn(), - getBlock: jest.fn(), - getTransaction: jest.fn(), - getTransactionReceipt: jest.fn(), - event: "MessageSent", - eventSignature: "MessageSent(address,address,uint256,uint256,uint256,bytes,bytes32)", - decode: jest.fn(), - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - args: { - _from: TEST_ADDRESS_1, - _to: TEST_ADDRESS_2, - _fee: 0n, - _value: 0n, - _nonce: 1n, - _calldata: "0x", - _messageHash: TEST_MESSAGE_HASH, - }, -}; - -export const testMessageClaimedEventLog: MessageClaimedEvent.Log = { - blockNumber: 100_000, - blockHash: TEST_BLOCK_HASH, - transactionIndex: 0, - removed: false, - address: TEST_CONTRACT_ADDRESS_1, - data: "0x", - topics: ["0xa4c827e719e911e8f19393ccdb85b5102f08f0910604d340ba38390b7ff2ab0e", TEST_MESSAGE_HASH], - transactionHash: TEST_TRANSACTION_HASH, - index: 0, - removeListener: jest.fn(), - getBlock: jest.fn(), - getTransaction: jest.fn(), - getTransactionReceipt: jest.fn(), - event: "MessageClaimed", - eventSignature: "MessageClaimed(bytes32)", - decode: jest.fn(), - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - args: { - _messageHash: TEST_MESSAGE_HASH, - }, -}; - -export const testServiceVersionMigratedEventLog: ServiceVersionMigratedEvent.Log = { - blockNumber: 51, - blockHash: TEST_BLOCK_HASH, - transactionIndex: 0, - removed: false, - address: TEST_CONTRACT_ADDRESS_1, - data: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000", - topics: [ - "0x6f4cd2683fd248db2513412cb2f25f767694689d6f083941f7437c8fe1f87964", - `0x000000000000000000000000${TEST_ADDRESS_1.slice(2)}`, - "0x0000000000000000000000000000000000000000000000000000000000000002", - ], - transactionHash: TEST_TRANSACTION_HASH, - index: 0, - removeListener: jest.fn(), - getBlock: jest.fn(), - getTransaction: jest.fn(), - getTransactionReceipt: jest.fn(), - event: "ServiceVersionMigrated", - eventSignature: "ServiceVersionMigrated(uint256)", - decode: jest.fn(), - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - args: { - version: 2n, - }, -}; - -export const testL2MessagingBlockAnchoredEventLog: L2MessagingBlockAnchoredEvent.Log = { - blockNumber: 51, - blockHash: TEST_BLOCK_HASH, - transactionIndex: 0, - removed: false, - address: TEST_CONTRACT_ADDRESS_1, - data: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000", - topics: [ - L2_MESSAGING_BLOCK_ANCHORED_EVENT_SIGNATURE, - "0x0000000000000000000000000000000000000000000000000000000000000033", - ], - transactionHash: TEST_TRANSACTION_HASH, - index: 0, - removeListener: jest.fn(), - getBlock: jest.fn(), - getTransaction: jest.fn(), - getTransactionReceipt: jest.fn(), - event: "L2MessagingBlockAnchored", - eventSignature: "L2MessagingBlockAnchored(uint256)", - decode: jest.fn(), - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - args: { - l2Block: 51n, - }, -}; - -export const testL2MerkleRootAddedEventLog: L2MerkleRootAddedEvent.Log = { - blockNumber: 51, - blockHash: TEST_BLOCK_HASH, - transactionIndex: 0, - removed: false, - address: TEST_CONTRACT_ADDRESS_1, - data: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000", - topics: [ - L2_MERKLE_TREE_ADDED_EVENT_SIGNATURE, - TEST_MERKLE_ROOT, - "0x0000000000000000000000000000000000000000000000000000000000000005", - ], - transactionHash: TEST_TRANSACTION_HASH, - index: 0, - removeListener: jest.fn(), - getBlock: jest.fn(), - getTransaction: jest.fn(), - getTransactionReceipt: jest.fn(), - event: "L2MerkleRootAddedEvent", - eventSignature: "L2MerkleRootAddedEvent(bytes32,uint256)", - decode: jest.fn(), - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - args: { - l2MerkleRoot: TEST_MERKLE_ROOT, - treeDepth: 5n, - }, -}; diff --git a/postman/src/utils/testing/helpers.ts b/postman/src/utils/testing/helpers.ts new file mode 100644 index 000000000..9aa664aff --- /dev/null +++ b/postman/src/utils/testing/helpers.ts @@ -0,0 +1,72 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +import { Direction } from "@consensys/linea-sdk"; +import { ILogger } from "../../core/utils/logging/ILogger"; +import { TEST_ADDRESS_1, TEST_CONTRACT_ADDRESS_1, TEST_CONTRACT_ADDRESS_2, TEST_MESSAGE_HASH } from "./constants"; +import { MessageStatus } from "../../core/enums"; +import { Message, MessageProps } from "../../core/entities/Message"; +import { MessageEntity } from "../../application/postman/persistence/entities/Message.entity"; + +export class TestLogger implements ILogger { + public readonly name: string; + + constructor(loggerName: string) { + this.name = loggerName; + } + + // eslint-disable-next-line @typescript-eslint/no-unused-vars + public info(error: any): void {} + + // eslint-disable-next-line @typescript-eslint/no-unused-vars + public error(error: any): void {} + + // eslint-disable-next-line @typescript-eslint/no-unused-vars + public warn(error: any): void {} + + // eslint-disable-next-line @typescript-eslint/no-unused-vars + public debug(error: any): void {} + + // eslint-disable-next-line @typescript-eslint/no-unused-vars + public warnOrError(error: any): void {} +} + +export const generateMessage = (overrides?: Partial): Message => { + return new Message({ + id: 1, + messageSender: TEST_ADDRESS_1, + destination: TEST_CONTRACT_ADDRESS_1, + fee: 10n, + value: 2n, + messageNonce: 1n, + calldata: "0x", + messageHash: TEST_MESSAGE_HASH, + contractAddress: TEST_CONTRACT_ADDRESS_2, + sentBlockNumber: 100_000, + direction: Direction.L1_TO_L2, + status: MessageStatus.SENT, + claimNumberOfRetry: 0, + createdAt: new Date("2023-08-04"), + updatedAt: new Date("2023-08-04"), + ...overrides, + }); +}; + +export const generateMessageEntity = (overrides?: Partial): MessageEntity => { + return { + id: 1, + messageSender: TEST_ADDRESS_1, + destination: TEST_CONTRACT_ADDRESS_1, + fee: "10", + value: "2", + messageNonce: 1, + calldata: "0x", + messageHash: TEST_MESSAGE_HASH, + messageContractAddress: TEST_CONTRACT_ADDRESS_2, + sentBlockNumber: 100_000, + direction: Direction.L1_TO_L2, + status: MessageStatus.SENT, + claimNumberOfRetry: 0, + createdAt: new Date("2023-08-04"), + updatedAt: new Date("2023-08-04"), + ...overrides, + }; +}; diff --git a/postman/tsconfig.build.json b/postman/tsconfig.build.json new file mode 100644 index 000000000..296676915 --- /dev/null +++ b/postman/tsconfig.build.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "inlineSources": true, + "noEmit": false, + "outDir": "dist", + "rootDir": ".", + "sourceMap": true + }, + "include": ["./src/**/*.ts", "scripts/**/runPostman.ts"], + "exclude": ["src/**/*.test.ts"] +} diff --git a/postman/tsconfig.json b/postman/tsconfig.json new file mode 100644 index 000000000..3f5f5fecf --- /dev/null +++ b/postman/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "lib": ["ES2021", "DOM"], + "noEmit": false, + "skipLibCheck": true, + "strictPropertyInitialization": false, + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + }, + "references": [ + { + "path": "../ts-libs/linea-native-libs" + }, + { + "path": "../sdk" + } + ], + "exclude": ["./dist", "**/node_modules"] +} diff --git a/sdk/.env.sample b/sdk/.env.sample deleted file mode 100644 index 88441a6b6..000000000 --- a/sdk/.env.sample +++ /dev/null @@ -1,41 +0,0 @@ -L1_RPC_URL=http://localhost:8445 -L1_CONTRACT_ADDRESS=0x378041D4A8C8392cF26d5D86eB1E84A880b0E0F2 -L1_SIGNER_PRIVATE_KEY= -L1_LISTENER_INTERVAL=4000 -L1_LISTENER_INITIAL_FROM_BLOCK=0 -L1_LISTENER_BLOCK_CONFIRMATION=4 -L1_MAX_BLOCKS_TO_FETCH_LOGS=1000 -L1_MAX_GAS_FEE_ENFORCED=false -L2_RPC_URL=http://localhost:8545 -L2_CONTRACT_ADDRESS=0x5767aB2Ed64666bFE27e52D4675EDd60Ec7D6EDF -L2_SIGNER_PRIVATE_KEY= -L2_LISTENER_INTERVAL=4000 -L2_LISTENER_INITIAL_FROM_BLOCK=0 -L2_LISTENER_BLOCK_CONFIRMATION=0 -L2_MAX_BLOCKS_TO_FETCH_LOGS=1000 -L2_MESSAGE_TREE_DEPTH=5 -L2_MAX_GAS_FEE_ENFORCED=false -MESSAGE_SUBMISSION_TIMEOUT=300000 -MAX_FETCH_MESSAGES_FROM_DB=1000 -MAX_NONCE_DIFF=10000 -MAX_FEE_PER_GAS=100000000000 -GAS_ESTIMATION_PERCENTILE=50 -PROFIT_MARGIN=1.0 -MAX_NUMBER_OF_RETRIES=100 -RETRY_DELAY_IN_SECONDS=30 -MAX_CLAIM_GAS_LIMIT=100000 -MAX_TX_RETRIES=20 -L1_L2_EOA_ENABLED=true -L1_L2_CALLDATA_ENABLED=false -L1_L2_AUTO_CLAIM_ENABLED=true -L2_L1_EOA_ENABLED=true -L2_L1_CALLDATA_ENABLED=false -L2_L1_AUTO_CLAIM_ENABLED=true -POSTGRES_HOST=127.0.0.1 -POSTGRES_PORT=5432 -POSTGRES_USER=postgres -POSTGRES_PASSWORD=postgres -POSTGRES_DB=postman_db -DB_CLEANER_ENABLED=true -DB_CLEANING_INTERVAL=10000 -DB_DAYS_BEFORE_NOW_TO_DELETE=1 \ No newline at end of file diff --git a/sdk/README.md b/sdk/README.md index 70da88bc1..1fb685c25 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -1,42 +1,233 @@ -# Linea SDK +# Linea Bridge SDK ## Description - -The Linea SDK package is a comprehensive solution consisting of two distinct parts that facilitate message delivery between Ethereum and Linea networks. It provides functionality for interacting with contracts and retrieving; message status and information. - -## Part 1: SDK - -The Linea SDK is the first component of the package. It focuses on interacting with smart contracts on both Ethereum and Linea networks and provides custom functions to obtain message information. Notable features of the Linea SDK include: - -- Feature 1: Getting contract instances and addresses -- Feature 2: Getting message information by message hash -- Feature 3: Getting messages by transaction hash -- Feature 4: Getting a message status by message hash -- Feature 5: Claiming messages - -## Part 2: Postman - -The Postman component is the second part of the package and enables the delivery of messages between Ethereum and Linea networks. It offers the following key features: - -- Feature 1: Listening for message sent events on Ethereum -- Feature 2: Listening for message hash anchoring events to check if a message is ready to be claimed -- Feature 3: Automatic claiming of messages with a configurable retry mechanism -- Feature 4: Checking receipt status for each transaction - -All messages are stored in a configurable Postgres DB. +The Linea SDK package a TypeScript library for seamless bridging operations between Ethereum (L1) and Linea (L2) networks. It provides functionality for interacting with contracts and retrieving message status and information. + +## Features + +- 🌉 **Bridge Operations** + - Claim bridged assets on L1 and L2 + - Get message proof to claim on L1 + - Track message status across chains + +- 🔍 **Message Tracking** + - Query message status + - Monitor bridge events + +- ⚡ **Gas Management** + - Automatic gas estimation + - Custom fee strategies ## Installation -To install this package, execute the following command: - -`npm install @consensys/linea-sdk` - -## Usage - -This package exposes two main classes for usage: -- The `PostmanServiceClient` class is used to run a Postman service for delivering messages. -- The `LineaSDK` class is used to interact with smart contracts on Ethereum and Linea (both Sepolia and Mainnet). +```bash +npm install @consensys/linea-sdk +# or +yarn add @consensys/linea-sdk +# or +pnpm add @consensys/linea-sdk +``` + +## Quick Start + +```typescript +import { LineaSDK } from '@consensys/linea-sdk'; + +// Initialize SDK +const sdk = new LineaSDK({ + network: 'linea-mainnet', // or 'linea-sepolia' or 'custom' + mode: 'read-write', + l1RpcUrlOrProvider: 'YOUR_L1_RPC_URL', + l2RpcUrlOrProvider: 'YOUR_L2_RPC_URL', + l1SignerPrivateKeyOrWallet: 'YOUR_L1_PRIVATE_KEY', + l2SignerPrivateKeyOrWallet: 'YOUR_L2_PRIVATE_KEY' +}); + +// Get L1 and L2 contract instances +const l1Contract = sdk.getL1Contract(); +const l2Contract = sdk.getL2Contract(); +``` + +## SDK Configuration + +### LineaSDKOptions + +The SDK can be initialized in two modes: `read-only` or `read-write`. The configuration options differ based on the mode: + +#### Read-Only Mode +```typescript +interface ReadOnlyModeOptions { + network: "linea-mainnet" | "linea-sepolia" | "custom"; + mode: "read-only"; + l1RpcUrlOrProvider: string | Eip1193Provider; + l2RpcUrlOrProvider: string | Eip1193Provider; + l2MessageTreeDepth?: number; + l1FeeEstimatorOptions?: { + maxFeePerGasCap?: bigint; + gasFeeEstimationPercentile?: number; + enforceMaxGasFee?: boolean; + }; + l2FeeEstimatorOptions?: { + maxFeePerGasCap?: bigint; + gasFeeEstimationPercentile?: number; + enforceMaxGasFee?: boolean; + }; +} +``` + +#### Read-Write Mode +```typescript +interface WriteModeOptions extends ReadOnlyModeOptions { + mode: "read-write"; + l1SignerPrivateKeyOrWallet: string | Wallet; + l2SignerPrivateKeyOrWallet: string | Wallet; +} +``` + +#### Field Explanations +- `network`: `"linea-mainnet"` | `"linea-sepolia"` | `"custom"` + - Description: Specifies the blockchain network to connect to. + - Possible Values: + - `"linea-mainnet"`: Connects to the Linea Mainnet contracts. + - `"linea-sepolia"`: Connects to the Linea Sepolia testnet contracts. + - `"custom"`: Allows for a custom contracts addresses, requiring custom RPC URLs for L1 and L2. +- `mode`: `"read-only"` | `"read-write"` + - Description: Determines the operation mode of the client. + - Possible Values: + - `"read-only"`: The client operates without the ability to send transactions; it can only read data from the blockchain. + - `"read-write"`: The client can read data and also send transactions, requiring signing credentials. +- `l1RpcUrlOrProvider`: `string | Eip1193Provider` + - Description: The RPC URL or provider for connecting to Layer 1 (L1) of the blockchain. + - Options: + - `string`: A URL pointing to the L1 RPC endpoint. + - `Eip1193Provider`: An EIP-1193 compliant provider instance. +- `l2RpcUrlOrProvider`: `string | Eip1193Provider` + - Description: The RPC URL or provider for connecting to Layer 2 (L2) of the blockchain. + - Options: + - `string`: A URL pointing to the L2 RPC endpoint. + - `Eip1193Provider`: An EIP-1193 compliant provider instance. +- `l2MessageTreeDepth?`: `number` (Optional) + - Description: Specifies the depth of the L2 message tree used in cryptographic operations or data structures. + - Default: If not provided, a default value of `5` is used which is the value used in Mainnet and Sepolia. +- `l1FeeEstimatorOptions?`: (Optional) + - Description: Configuration options for estimating transaction fees on Layer 1. + - Fields: + - `maxFeePerGasCap?`: `bigint` (Optional) + - Description: The maximum gas price (in wei) you're willing to pay per unit of gas on L1. + - Default: If not provided, a default value of `100000000000n` is used. + - `gasFeeEstimationPercentile?`: `number` (Optional) + - Description: The percentile of recent gas prices to use for fee estimation (used in `eth_feeHistory`). + - Default: If not provided, a default value of `20` is used. + - `enforceMaxGasFee?`: `boolean` (Optional) + - Description: If true, ensures the gas fee does not exceed maxFeePerGasCap. + - Default: `false` +- `l2FeeEstimatorOptions?`: (Optional) + - Description: Configuration options for estimating transaction fees on Layer 2. + - Fields: + - `maxFeePerGasCap?`: `bigint` (Optional) + - Description: The maximum gas price (in wei) you're willing to pay per unit of gas on L2. + - Default: If not provided, a default value of `100000000000n` is used. + - `gasFeeEstimationPercentile?`: `number` (Optional) + - Description: The percentile of recent gas prices to use for fee estimation (used in `eth_feeHistory`). + - Default: If not provided, a default value of `20` is used. + - `enforceMaxGasFee?`: `boolean` (Optional) + - Description: If true, ensures the gas fee does not exceed maxFeePerGasCap. + - Default: `false` +- `l1SignerPrivateKeyOrWallet`: `string | Wallet` (Required in "read-write" mode) + - Description: Credentials used to sign transactions on Layer 1. + - Options: + - `string`: A hexadecimal string representing the private key. + - `Wallet`: A wallet instance (e.g., from ethers.js) containing the private key and signing functionality. +- `l2SignerPrivateKeyOrWallet`: `string | Wallet` (Required in "read-write" mode) + - Description: Credentials used to sign transactions on Layer 2. + - Options: + - `string`: A hexadecimal string representing the private key. + - `Wallet`: A wallet instance for signing L2 transactions. + +#### Additional Notes + +- Common Fields: The fields `network`, `mode`, `l1RpcUrlOrProvider`, `l2RpcUrlOrProvider`, `l2MessageTreeDepth`, `l1FeeEstimatorOptions`, and `l2FeeEstimatorOptions` are common to both `read-only` and `read-write` modes. +- Mode-Specific Fields: + - In `read-only` mode: + - Only the common fields are required. + - The client can interact with the blockchain to read data but cannot send transactions. + - In `read-write` mode: + - All common fields are required. + - Additional Required Fields: l1SignerPrivateKeyOrWallet and l2SignerPrivateKeyOrWallet are necessary to enable transaction signing and sending capabilities. +- Fee Estimator Options: + - `maxFeePerGasCap`: Sets an upper limit on the gas price you're willing to pay. + - `gasFeeEstimationPercentile`: Helps in choosing a gas price based on recent network activity (used in `eth_feeHistory`). + - `enforceMaxGasFee`: Ensures that the gas fee does not exceed the maxFeePerGasCap value, providing cost control. + +#### Usage Summary + +- To read data only from the blockchain: + - Set `mode` to `read-only`. + - Provide the necessary network and RPC configurations. +- To read and write data (send transactions): + - Set `mode` to `read-write`. + - Provide all the common fields plus the signing credentials (`l1SignerPrivateKeyOrWallet` and `l2SignerPrivateKeyOrWallet`). + +## Main Components + +### L1 Contract (LineaRollupClient) + +The L1 contract handles operations on the Ethereum side. + +#### Message Operations +```typescript +// Get message by hash +const message = await l1Contract.getMessageByMessageHash(messageHash); + +// Get messages by transaction hash +const messages = await l1Contract.getMessagesByTransactionHash(txHash); + +// Get message status +const status = await l1Contract.getMessageStatus(messageHash); + +// Get transaction receipt by message hash +const receipt = await l1Contract.getTransactionReceiptByMessageHash(messageHash); +``` + +#### Claiming Operations +```typescript +// Estimate claim gas +const gas = await l1Contract.estimateClaimGas(message); + +// Claim message +const tx = await l1Contract.claim(message); +``` + +### L2 Contract (L2MessageServiceClient) + +The L2 contract handles operations on the Linea side. + +#### Message Operations +```typescript +// Get message by hash +const message = await l2Contract.getMessageByMessageHash(messageHash); + +// Get messages by transaction hash +const messages = await l2Contract.getMessagesByTransactionHash(txHash); + +// Get message status +const status = await l2Contract.getMessageStatus(messageHash); + +// Get transaction receipt by message hash +const receipt = await l2Contract.getTransactionReceiptByMessageHash(messageHash); +``` + +#### Claiming and Transaction Operations +```typescript + +// Estimate claim gas and fees +const gasFees = await l2Contract.estimateClaimGasFees(message) + +// Claim message on L2 +const tx = await l2Contract.claim(message); + +``` ## License -This package is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for more information. +This package is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details. diff --git a/sdk/jest.config.js b/sdk/jest.config.js index f4837d563..10a7bb1c1 100644 --- a/sdk/jest.config.js +++ b/sdk/jest.config.js @@ -7,19 +7,6 @@ module.exports = { collectCoverage: true, collectCoverageFrom: ["src/**/*.ts"], coverageReporters: ["html", "lcov", "text"], - testPathIgnorePatterns: [ - "src/clients/blockchain/typechain", - "src/application/postman/persistence/migrations/", - "src/application/postman/persistence/repositories/", - "src/index.ts", - "src/utils/WinstonLogger.ts", - ], - coveragePathIgnorePatterns: [ - "src/clients/blockchain/typechain", - "src/application/postman/persistence/migrations/", - "src/application/postman/persistence/repositories/", - "src/index.ts", - "src/utils/WinstonLogger.ts", - "src/utils/testing/", - ], + testPathIgnorePatterns: ["src/contracts/typechain", "src/index.ts"], + coveragePathIgnorePatterns: ["src/contracts/typechain", "src/index.ts", "src/utils/testing/"], }; diff --git a/sdk/package.json b/sdk/package.json index 650077b1e..4c3d196c1 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -4,46 +4,34 @@ "author": "Consensys Software Inc.", "license": "Apache-2.0", "description": "", - "main": "dist/lib/index.js", - "types": "dist/lib/index.d.ts", + "main": "dist/index.js", + "types": "dist/index.d.ts", "scripts": { "lint:ts": "npx eslint '**/*.ts'", "lint:ts:fix": "npx eslint --fix '**/*.ts'", "prettier": "prettier -c '**/*.ts'", "prettier:fix": "prettier -w '**/*.ts'", + "lint:fix": "pnpm run lint:ts:fix && pnpm run prettier:fix", "clean": "rimraf dist src/typechain node_modules coverage tsconfig.build.tsbuildinfo", "build:pre": "pnpm run typechain", "build": "pnpm run build:pre && tsc -p tsconfig.build.json", - "build:runSdk": "tsc ./scripts/runSdk.ts", - "typechain": "typechain --target ethers-v6 --out-dir ./src/clients/blockchain/typechain './src/clients/blockchain/abis/*.json'", - "test": "npx jest --bail --detectOpenHandles --forceExit", - "test:run": "ts-node ./scripts/runSdk.ts", - "lint:fix": "pnpm run lint:ts:fix && pnpm run prettier:fix" + "typechain": "typechain --target ethers-v6 --out-dir ./src/contracts/typechain './src/contracts/abis/*.abi'", + "test": "npx jest --bail --detectOpenHandles --forceExit" }, "dependencies": { - "@consensys/linea-native-libs": "workspace:*", - "better-sqlite3": "9.6.0", - "class-validator": "0.14.1", - "dotenv": "16.4.5", - "ethers": "6.12.0", - "lru-cache": "10.2.2", - "pg": "8.11.3", - "typeorm": "0.3.20", - "typeorm-naming-strategies": "4.1.0", - "winston": "3.13.0" + "ethers": "6.13.4", + "lru-cache": "11.0.2" }, "devDependencies": { "@jest/globals": "29.7.0", "@typechain/ethers-v6": "0.5.1", - "@types/jest": "29.5.12", - "@types/yargs": "17.0.32", + "@types/jest": "29.5.14", "jest": "29.7.0", "jest-mock-extended": "3.0.5", - "ts-jest": "29.1.2", - "typechain": "8.3.2", - "yargs": "17.7.2" + "ts-jest": "29.2.5", + "typechain": "8.3.2" }, "files": [ - "dist/**/*" + "dist" ] } diff --git a/sdk/scripts/deployContracts.ts b/sdk/scripts/deployContracts.ts deleted file mode 100644 index b3fab8cdb..000000000 --- a/sdk/scripts/deployContracts.ts +++ /dev/null @@ -1,156 +0,0 @@ -import { BaseContract, ContractFactory, JsonRpcProvider, Wallet, ethers } from "ethers"; -import { config } from "dotenv"; -import fs from "fs"; -import yargs from "yargs"; -import { hideBin } from "yargs/helpers"; -import { - ZkEvmV2__factory, - TransparentUpgradeableProxy__factory, - ProxyAdmin__factory, - PlonkVerifier__factory, - L2MessageService__factory, -} from "../src/clients/blockchain/typechain/factories"; -import { ProxyAdmin } from "../src/clients/blockchain/typechain/ProxyAdmin"; -import { sanitizePrivKey } from "./cli"; - -config(); - -const argv = yargs(hideBin(process.argv)) - .option("l1-rpc-url", { - describe: "L1 rpc url", - type: "string", - demandOption: true, - }) - .option("l2-rpc-url", { - describe: "L2 rpc url", - type: "string", - demandOption: true, - }) - .option("l1-deployer-priv-key", { - describe: "L1 deployer private key", - type: "string", - demandOption: true, - coerce: sanitizePrivKey("priv-key"), - }) - .option("l2-deployer-priv-key", { - describe: "L2 deployer private key", - type: "string", - demandOption: true, - coerce: sanitizePrivKey("priv-key"), - }) - .parseSync(); - -const getInitializerData = (contractInterface: ethers.Interface, args: unknown[]) => { - const initializer = "initialize"; - const fragment = contractInterface.getFunction(initializer); - return contractInterface.encodeFunctionData(fragment!, args); -}; - -const deployUpgradableContract = async ( - contractFactory: T, - deployer: Wallet, - admin: ProxyAdmin, - initializerData = "0x", -): Promise => { - const instance = await contractFactory.connect(deployer).deploy(); - await instance.waitForDeployment(); - - const proxy = await new TransparentUpgradeableProxy__factory() - .connect(deployer) - .deploy(await instance.getAddress(), await admin.getAddress(), initializerData); - await proxy.waitForDeployment(); - - return instance.attach(await proxy.getAddress()); -}; - -const deployLineaRollup = async (deployer: Wallet): Promise<{ zkevmV2ContractAddress: string }> => { - const proxyFactory = new ProxyAdmin__factory(deployer); - const proxyAdmin = await proxyFactory.connect(deployer).deploy(); - await proxyAdmin.waitForDeployment(); - console.log(`ProxyAdmin contract deployed at address: ${await proxyAdmin.getAddress()}`); - - const plonkVerifierFactory = new PlonkVerifier__factory(deployer); - const plonkVerifier = await plonkVerifierFactory.deploy(); - await plonkVerifier.waitForDeployment(); - console.log(`PlonkVerifier contract deployed at address: ${await plonkVerifier.getAddress()}`); - - const zkevmV2Contract = await deployUpgradableContract( - new ZkEvmV2__factory(deployer), - deployer, - proxyAdmin, - getInitializerData(ZkEvmV2__factory.createInterface(), [ - ethers.ZeroHash, - 0, - await plonkVerifier.getAddress(), - deployer.address, - [deployer.address], - 86400, - ethers.parseEther("5"), - ]), - ); - const zkEvmV2Address = await zkevmV2Contract.getAddress(); - console.log(`ZkEvmV2 contract deployed at address: ${zkEvmV2Address}`); - return { zkevmV2ContractAddress: zkEvmV2Address }; -}; - -const deployL2MessageService = async (deployer: Wallet): Promise => { - const proxyFactory = new ProxyAdmin__factory(deployer); - const proxyAdmin = await proxyFactory.connect(deployer).deploy(); - await proxyAdmin.waitForDeployment(); - console.log(`L2 ProxyAdmin contract deployed at address: ${await proxyAdmin.getAddress()}`); - - const l2MessageService = await deployUpgradableContract( - new L2MessageService__factory(deployer), - deployer, - proxyAdmin, - getInitializerData(L2MessageService__factory.createInterface(), [ - deployer.address, - deployer.address, - 86400, - ethers.parseEther("5"), - ]), - ); - const l2MessageServiceAddress = await l2MessageService.getAddress(); - console.log(`L2MessageService contract deployed at address: ${l2MessageServiceAddress}`); - return l2MessageServiceAddress; -}; - -const main = async (args: typeof argv) => { - const l1Provider = new JsonRpcProvider(args.l1RpcUrl); - const l2Provider = new JsonRpcProvider(args.l2RpcUrl); - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const l1Deployer = new Wallet(args.l1DeployerPrivKey, l1Provider); - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const l2Deployer = new Wallet(args.l2DeployerPrivKey, l2Provider); - - const { zkevmV2ContractAddress } = await deployLineaRollup(l1Deployer); - const l2MessageServiceAddress = await deployL2MessageService(l2Deployer); - - const tx = await l2Deployer.sendTransaction({ - to: l2MessageServiceAddress, - value: ethers.parseEther("1000"), - data: "0x", - }); - - await tx.wait(); - - const tx2 = await l1Deployer.sendTransaction({ - to: zkevmV2ContractAddress, - value: ethers.parseEther("1000"), - data: "0x", - }); - - await tx2.wait(); - - fs.writeFileSync( - "./scripts/contractAddresses.json", - JSON.stringify({ zkevmV2ContractAddress, l2MessageServiceAddress }, null, 2), - ); -}; - -main(argv) - .then(() => process.exit(0)) - .catch((error) => { - console.error(error); - process.exit(1); - }); diff --git a/sdk/scripts/runSdk.ts b/sdk/scripts/runSdk.ts deleted file mode 100644 index 90b4b34fe..000000000 --- a/sdk/scripts/runSdk.ts +++ /dev/null @@ -1,42 +0,0 @@ -import * as dotenv from "dotenv"; -import { LineaSDK } from "../src"; -import { ZERO_ADDRESS } from "../src/core/constants"; -import { Direction, MessageStatus } from "../src/core/enums/MessageEnums"; - -dotenv.config(); - -async function main() { - const sdk = new LineaSDK({ - l1RpcUrlOrProvider: process.env.L1_RPC_URL ?? "", - l2RpcUrlOrProvider: process.env.L2_RPC_URL ?? "", - network: "linea-sepolia", - mode: "read-only", - }); - - const l2Contract = sdk.getL2Contract(); - const data = l2Contract.encodeClaimMessageTransactionData({ - messageSender: "0x5eEeA0e70FFE4F5419477056023c4b0acA016562", - destination: "0x5eEeA0e70FFE4F5419477056023c4b0acA016562", - fee: 0n, - value: 100000000000000000n, - feeRecipient: ZERO_ADDRESS, - calldata: "0x", - messageNonce: 3105n, - messageHash: "", - contractAddress: "", - sentBlockNumber: 0, - direction: Direction.L1_TO_L2, - status: MessageStatus.SENT, - claimNumberOfRetry: 0, - }); - console.log(data); -} - -main() - .then(() => { - process.exit(0); - }) - .catch((error) => { - console.error(error); - process.exit(1); - }); diff --git a/sdk/src/sdk/__tests__/LineaSDK.test.ts b/sdk/src/LineaSDK.test.ts similarity index 83% rename from sdk/src/sdk/__tests__/LineaSDK.test.ts rename to sdk/src/LineaSDK.test.ts index c1bdc1f25..bbf41384e 100644 --- a/sdk/src/sdk/__tests__/LineaSDK.test.ts +++ b/sdk/src/LineaSDK.test.ts @@ -1,13 +1,13 @@ import { describe, it, expect } from "@jest/globals"; import { JsonRpcProvider, Wallet } from "ethers"; -import ProviderService from "../ProviderService"; -import { LineaSDK } from "../LineaSDK"; -import { L1ClaimingService } from "../claiming/L1ClaimingService"; -import { TEST_L1_SIGNER_PRIVATE_KEY, TEST_L2_SIGNER_PRIVATE_KEY, TEST_RPC_URL } from "../../utils/testing/constants"; -import { NETWORKS } from "../networks"; -import { EthersL2MessageServiceLogClient } from "../../clients/blockchain/linea/EthersL2MessageServiceLogClient"; -import { serialize } from "../../core/utils/serialize"; -import { generateL2MessageServiceClient, generateLineaRollupClient } from "../../utils/testing/helpers"; +import { LineaSDK } from "./LineaSDK"; +import { L1ClaimingService } from "./clients/ethereum"; +import { LineaProvider, Provider } from "./clients/providers"; +import { EthersL2MessageServiceLogClient } from "./clients/linea"; +import { NETWORKS } from "./core/constants"; +import { serialize } from "./core/utils"; +import { TEST_L1_SIGNER_PRIVATE_KEY, TEST_L2_SIGNER_PRIVATE_KEY, TEST_RPC_URL } from "./utils/testing/constants/common"; +import { generateL2MessageServiceClient, generateLineaRollupClient } from "./utils/testing/helpers"; describe("LineaSDK", () => { describe("getL1Contract", () => { @@ -23,8 +23,8 @@ describe("LineaSDK", () => { expect(serialize(lineaRollupClient)).toStrictEqual( serialize( generateLineaRollupClient( - new JsonRpcProvider(TEST_RPC_URL), - new JsonRpcProvider(TEST_RPC_URL), + new Provider(TEST_RPC_URL), + new LineaProvider(TEST_RPC_URL), NETWORKS["linea-sepolia"].l1ContractAddress, NETWORKS["linea-sepolia"].l2ContractAddress, "read-only", @@ -47,12 +47,12 @@ describe("LineaSDK", () => { expect(serialize(lineaRollupClient)).toStrictEqual( serialize( generateLineaRollupClient( - new JsonRpcProvider(TEST_RPC_URL), - new JsonRpcProvider(TEST_RPC_URL), + new Provider(TEST_RPC_URL), + new LineaProvider(TEST_RPC_URL), NETWORKS["linea-sepolia"].l1ContractAddress, NETWORKS["linea-sepolia"].l2ContractAddress, "read-write", - new ProviderService(TEST_RPC_URL).getSigner(TEST_L1_SIGNER_PRIVATE_KEY), + new Wallet(TEST_L1_SIGNER_PRIVATE_KEY).connect(new JsonRpcProvider(TEST_RPC_URL)), ).lineaRollupClient, ), ); @@ -64,7 +64,7 @@ describe("LineaSDK", () => { network: "linea-sepolia", l1SignerPrivateKeyOrWallet: TEST_L1_SIGNER_PRIVATE_KEY, l2SignerPrivateKeyOrWallet: TEST_L2_SIGNER_PRIVATE_KEY, - l1RpcUrlOrProvider: new JsonRpcProvider(TEST_RPC_URL), + l1RpcUrlOrProvider: TEST_RPC_URL, l2RpcUrlOrProvider: TEST_RPC_URL, }); @@ -72,12 +72,12 @@ describe("LineaSDK", () => { expect(serialize(lineaRollupClient)).toStrictEqual( serialize( generateLineaRollupClient( - new JsonRpcProvider(TEST_RPC_URL), - new JsonRpcProvider(TEST_RPC_URL), + new Provider(TEST_RPC_URL), + new LineaProvider(TEST_RPC_URL), NETWORKS["linea-sepolia"].l1ContractAddress, NETWORKS["linea-sepolia"].l2ContractAddress, "read-write", - new ProviderService(TEST_RPC_URL).getSigner(TEST_L1_SIGNER_PRIVATE_KEY), + new Wallet(TEST_L1_SIGNER_PRIVATE_KEY).connect(new Provider(TEST_RPC_URL)), ).lineaRollupClient, ), ); @@ -98,8 +98,8 @@ describe("LineaSDK", () => { expect(serialize(lineaRollupClient)).toStrictEqual( serialize( generateLineaRollupClient( - new JsonRpcProvider(TEST_RPC_URL), - new JsonRpcProvider(TEST_RPC_URL), + new Provider(TEST_RPC_URL), + new LineaProvider(TEST_RPC_URL), NETWORKS["linea-sepolia"].l1ContractAddress, NETWORKS["linea-sepolia"].l2ContractAddress, "read-write", @@ -119,7 +119,7 @@ describe("LineaSDK", () => { l2RpcUrlOrProvider: TEST_RPC_URL, }); - expect(() => sdk.getL1Contract()).toThrow("You need to provide both L1 and L2 contract addresses."); + expect(() => sdk.getL1Contract()).toThrow("You need to provide a L1 contract address."); }); it("should return LineaRollupClient with custom contract address when the network option is set to 'custom'", () => { @@ -140,12 +140,12 @@ describe("LineaSDK", () => { expect(serialize(l1MessageService)).toStrictEqual( serialize( generateLineaRollupClient( - new JsonRpcProvider(TEST_RPC_URL), - new JsonRpcProvider(TEST_RPC_URL), + new Provider(TEST_RPC_URL), + new LineaProvider(TEST_RPC_URL), localL1ContractAddress, localL2ContractAddress, "read-write", - new ProviderService(TEST_RPC_URL).getSigner(TEST_L1_SIGNER_PRIVATE_KEY), + new Wallet(TEST_L1_SIGNER_PRIVATE_KEY).connect(new Provider(TEST_RPC_URL)), ).lineaRollupClient, ), ); @@ -165,7 +165,7 @@ describe("LineaSDK", () => { expect(serialize(l2MessageService)).toStrictEqual( serialize( generateL2MessageServiceClient( - new JsonRpcProvider(TEST_RPC_URL), + new LineaProvider(TEST_RPC_URL), NETWORKS["linea-sepolia"].l2ContractAddress, "read-only", ).l2MessageServiceClient, @@ -187,10 +187,10 @@ describe("LineaSDK", () => { expect(serialize(l2MessageService)).toStrictEqual( serialize( generateL2MessageServiceClient( - new JsonRpcProvider(TEST_RPC_URL), + new LineaProvider(TEST_RPC_URL), NETWORKS["linea-sepolia"].l2ContractAddress, "read-write", - new ProviderService(TEST_RPC_URL).getSigner(TEST_L2_SIGNER_PRIVATE_KEY), + new Wallet(TEST_L2_SIGNER_PRIVATE_KEY).connect(new LineaProvider(TEST_RPC_URL)), ).l2MessageServiceClient, ), ); @@ -203,17 +203,17 @@ describe("LineaSDK", () => { l1SignerPrivateKeyOrWallet: TEST_L1_SIGNER_PRIVATE_KEY, l2SignerPrivateKeyOrWallet: TEST_L2_SIGNER_PRIVATE_KEY, l1RpcUrlOrProvider: TEST_RPC_URL, - l2RpcUrlOrProvider: new JsonRpcProvider(TEST_RPC_URL), + l2RpcUrlOrProvider: TEST_RPC_URL, }); const l2MessageService = sdk.getL2Contract(); expect(serialize(l2MessageService)).toStrictEqual( serialize( generateL2MessageServiceClient( - new JsonRpcProvider(TEST_RPC_URL), + new LineaProvider(TEST_RPC_URL), NETWORKS["linea-sepolia"].l2ContractAddress, "read-write", - new ProviderService(TEST_RPC_URL).getSigner(TEST_L2_SIGNER_PRIVATE_KEY), + new Wallet(TEST_L2_SIGNER_PRIVATE_KEY).connect(new LineaProvider(TEST_RPC_URL)), ).l2MessageServiceClient, ), ); @@ -234,7 +234,7 @@ describe("LineaSDK", () => { expect(serialize(l2MessageService)).toStrictEqual( serialize( generateL2MessageServiceClient( - new JsonRpcProvider(TEST_RPC_URL), + new LineaProvider(TEST_RPC_URL), NETWORKS["linea-sepolia"].l2ContractAddress, "read-write", wallet, @@ -272,10 +272,10 @@ describe("LineaSDK", () => { expect(serialize(l2MessageService)).toStrictEqual( serialize( generateL2MessageServiceClient( - new JsonRpcProvider(TEST_RPC_URL), + new LineaProvider(TEST_RPC_URL), localContractAddress, "read-write", - new ProviderService(TEST_RPC_URL).getSigner(TEST_L2_SIGNER_PRIVATE_KEY), + new Wallet(TEST_L2_SIGNER_PRIVATE_KEY).connect(new LineaProvider(TEST_RPC_URL)), ).l2MessageServiceClient, ), ); @@ -292,23 +292,24 @@ describe("LineaSDK", () => { }); const l1ClaimingService = sdk.getL1ClaimingService(); + expect(serialize(l1ClaimingService)).toStrictEqual( serialize( new L1ClaimingService( generateLineaRollupClient( - new JsonRpcProvider(TEST_RPC_URL), - new JsonRpcProvider(TEST_RPC_URL), + new Provider(TEST_RPC_URL), + new LineaProvider(TEST_RPC_URL), NETWORKS["linea-sepolia"].l1ContractAddress, NETWORKS["linea-sepolia"].l2ContractAddress, "read-only", ).lineaRollupClient, generateL2MessageServiceClient( - new JsonRpcProvider(TEST_RPC_URL), + new LineaProvider(TEST_RPC_URL), NETWORKS["linea-sepolia"].l2ContractAddress, "read-only", ).l2MessageServiceClient, new EthersL2MessageServiceLogClient( - new ProviderService(TEST_RPC_URL).provider, + new LineaProvider(TEST_RPC_URL).provider, NETWORKS["linea-sepolia"].l2ContractAddress, ), "linea-sepolia", diff --git a/sdk/src/LineaSDK.ts b/sdk/src/LineaSDK.ts new file mode 100644 index 000000000..9c425ff8f --- /dev/null +++ b/sdk/src/LineaSDK.ts @@ -0,0 +1,327 @@ +import { Eip1193Provider, Signer, Wallet } from "ethers"; +import { + LineaRollupClient, + EthersLineaRollupLogClient, + L1ClaimingService, + LineaRollupMessageRetriever, + MerkleTreeService, +} from "./clients/ethereum"; +import { + L2MessageServiceClient, + EthersL2MessageServiceLogClient, + L2MessageServiceMessageRetriever, +} from "./clients/linea"; +import { DefaultGasProvider, GasProvider } from "./clients/gas"; +import { Provider, LineaProvider, BrowserProvider, LineaBrowserProvider } from "./clients/providers"; +import { + DEFAULT_ENABLE_LINEA_ESTIMATE_GAS, + DEFAULT_ENFORCE_MAX_GAS_FEE, + DEFAULT_GAS_ESTIMATION_PERCENTILE, + DEFAULT_L2_MESSAGE_TREE_DEPTH, + DEFAULT_MAX_FEE_PER_GAS_CAP, +} from "./core/constants"; +import { BaseError } from "./core/errors"; +import { L1FeeEstimatorOptions, L2FeeEstimatorOptions, LineaSDKOptions, Network, SDKMode } from "./core/types"; +import { NETWORKS } from "./core/constants"; +import { isString } from "./core/utils"; +import { Direction } from "./core/enums"; + +export class LineaSDK { + private network: Network; + private l1Signer?: Signer; + private l2Signer?: Signer; + private l1Provider: Provider | BrowserProvider; + private l2Provider: LineaProvider | LineaBrowserProvider; + private l1FeeEstimatorOptions: Required; + private l2FeeEstimatorOptions: Required; + private mode: SDKMode; + private l2MessageTreeDepth: number; + + /** + * Initializes a new instance of the LineaSDK with the specified options. + * + * @param {LineaSDKOptions} options - Configuration options for the SDK, including network details, operational mode, and optional settings for L2 message tree depth and fee estimation. + */ + constructor(options: LineaSDKOptions) { + const { + network, + mode, + l2MessageTreeDepth = DEFAULT_L2_MESSAGE_TREE_DEPTH, + l1RpcUrlOrProvider, + l2RpcUrlOrProvider, + l1FeeEstimatorOptions = {}, + l2FeeEstimatorOptions = {}, + } = options; + + this.network = network; + this.mode = mode; + this.l2MessageTreeDepth = l2MessageTreeDepth; + + this.l1Provider = this.getL1Provider(l1RpcUrlOrProvider); + this.l2Provider = this.getL2Provider(l2RpcUrlOrProvider); + + if (mode === "read-write") { + const { l1SignerPrivateKeyOrWallet, l2SignerPrivateKeyOrWallet } = options; + + if (!l1SignerPrivateKeyOrWallet || !l2SignerPrivateKeyOrWallet) { + throw new BaseError("You need to provide both L1 and L2 signer private keys or wallets."); + } + + this.l1Signer = this.getWallet(l1SignerPrivateKeyOrWallet).connect(this.l1Provider); + this.l2Signer = this.getWallet(l2SignerPrivateKeyOrWallet).connect(this.l2Provider); + } + + const { maxFeePerGasCap, gasFeeEstimationPercentile, enforceMaxGasFee } = l1FeeEstimatorOptions; + const { + maxFeePerGasCap: l2MaxFeePerGasCap, + gasFeeEstimationPercentile: l2GasFeeEstimationPercentile, + enableLineaEstimateGas: l2EnableLineaEstimateGas, + enforceMaxGasFee: l2EnforceMaxGasFee, + } = l2FeeEstimatorOptions; + + this.l1FeeEstimatorOptions = { + maxFeePerGasCap: maxFeePerGasCap || DEFAULT_MAX_FEE_PER_GAS_CAP, + gasFeeEstimationPercentile: gasFeeEstimationPercentile || DEFAULT_GAS_ESTIMATION_PERCENTILE, + enforceMaxGasFee: enforceMaxGasFee || DEFAULT_ENFORCE_MAX_GAS_FEE, + }; + + this.l2FeeEstimatorOptions = { + maxFeePerGasCap: l2MaxFeePerGasCap || DEFAULT_MAX_FEE_PER_GAS_CAP, + gasFeeEstimationPercentile: l2GasFeeEstimationPercentile || DEFAULT_GAS_ESTIMATION_PERCENTILE, + enforceMaxGasFee: l2EnforceMaxGasFee || DEFAULT_ENFORCE_MAX_GAS_FEE, + enableLineaEstimateGas: l2EnableLineaEstimateGas || DEFAULT_ENABLE_LINEA_ESTIMATE_GAS, + }; + } + + /** + * Gets the L1 provider instance based on the provided RPC URL or provider. + * @param {string | Eip1193Provider} l1RpcUrlOrProvider - The L1 RPC URL or EIP-1193 provider + * @returns {Provider | BrowserProvider} The configured L1 provider + * @throws {BaseError} If the provided argument is invalid + */ + public getL1Provider(l1RpcUrlOrProvider: string | Eip1193Provider): Provider | BrowserProvider { + if (isString(l1RpcUrlOrProvider)) { + return new Provider(l1RpcUrlOrProvider); + } + + if (this.isEip1193Provider(l1RpcUrlOrProvider)) { + return new BrowserProvider(l1RpcUrlOrProvider); + } + + throw new BaseError("Invalid argument: l1RpcUrlOrProvider must be a string or Eip1193Provider"); + } + + /** + * Gets the L1 signer instance. + * @returns {Signer} The L1 signer + * @throws {BaseError} If the signer is not available in read-only mode + */ + public getL1Signer(): Signer { + if (!this.l1Signer) { + throw new BaseError("L1 signer is not available in read-only mode."); + } + return this.l1Signer; + } + + /** + * Gets the L2 signer instance. + * @returns {Signer} The L2 signer + * @throws {BaseError} If the signer is not available in read-only mode + */ + public getL2Signer(): Signer { + if (!this.l2Signer) { + throw new BaseError("L2 signer is not available in read-only mode."); + } + return this.l2Signer; + } + + /** + * Gets the L1 gas provider configured with the SDK's fee estimation options. + * @returns {DefaultGasProvider} The configured L1 gas provider + */ + public getL1GasProvider(): DefaultGasProvider { + return new DefaultGasProvider(this.l1Provider, { + maxFeePerGasCap: this.l1FeeEstimatorOptions.maxFeePerGasCap, + gasEstimationPercentile: this.l1FeeEstimatorOptions.gasFeeEstimationPercentile, + enforceMaxGasFee: this.l1FeeEstimatorOptions.enforceMaxGasFee, + }); + } + + /** + * Gets the L2 gas provider configured with the SDK's fee estimation options. + * @returns {GasProvider} The configured L2 gas provider + */ + public getL2GasProvider(): GasProvider { + return new GasProvider(this.l2Provider, { + maxFeePerGasCap: this.l2FeeEstimatorOptions.maxFeePerGasCap, + enforceMaxGasFee: this.l2FeeEstimatorOptions.enforceMaxGasFee, + gasEstimationPercentile: this.l2FeeEstimatorOptions.gasFeeEstimationPercentile, + direction: Direction.L1_TO_L2, + enableLineaEstimateGas: this.l2FeeEstimatorOptions.enableLineaEstimateGas, + }); + } + + /** + * Gets the L2 provider instance based on the provided RPC URL or provider. + * @param {string | Eip1193Provider} l2RpcUrlOrProvider - The L2 RPC URL or EIP-1193 provider + * @returns {LineaProvider | LineaBrowserProvider} The configured L2 provider + * @throws {Error} If the provided argument is invalid + */ + public getL2Provider(l2RpcUrlOrProvider: string | Eip1193Provider): LineaProvider | LineaBrowserProvider { + if (isString(l2RpcUrlOrProvider)) { + return new LineaProvider(l2RpcUrlOrProvider); + } + + if (this.isEip1193Provider(l2RpcUrlOrProvider)) { + return new LineaBrowserProvider(l2RpcUrlOrProvider); + } + + throw new Error("Invalid argument: l2RpcUrlOrProvider must be a string or Eip1193Provider"); + } + + /** + * Creates an instance of the `EthersLineaRollupLogClient` for interacting with L1 contract event logs. + * + * @param {string} [localL1ContractAddress] - Optional custom L1 contract address. Required if the network is set to 'custom'. + * @returns {EthersLineaRollupLogClient} An instance of the L1 message service log client. + */ + public getL1ContractEventLogClient(localL1ContractAddress?: string): EthersLineaRollupLogClient { + const l1ContractAddress = this.getContractAddress("l1", localL1ContractAddress); + return new EthersLineaRollupLogClient(this.l1Provider, l1ContractAddress); + } + + /** + * Creates an instance of the `EthersL2MessageServiceLogClient` for interacting with L2 contract event logs. + * + * @param {string} [localL2ContractAddress] - Optional custom L2 contract address. Required if the network is set to 'custom'. + * @returns {EthersL2MessageServiceLogClient} An instance of the L2 message service log client. + */ + public getL2ContractEventLogClient(localL2ContractAddress?: string): EthersL2MessageServiceLogClient { + const l2ContractAddress = this.getContractAddress("l2", localL2ContractAddress); + return new EthersL2MessageServiceLogClient(this.l2Provider, l2ContractAddress); + } + + /** + * Retrieves an instance of the `LineaRollupClient` for interacting with the L1 contract. + * + * @param {string} [localL1ContractAddress] - Optional custom L1 contract address. Required if the network is set to 'custom'. + * @param {string} [localL2ContractAddress] - Optional custom L2 contract address. Required if the network is set to 'custom'. + * @returns {LineaRollupClient} An instance of the `LineaRollupClient` configured for the specified L1 contract. + */ + public getL1Contract(localL1ContractAddress?: string, localL2ContractAddress?: string): LineaRollupClient { + const l1ContractAddress = this.getContractAddress("l1", localL1ContractAddress); + const l2ContractAddress = this.getContractAddress("l2", localL2ContractAddress); + + const lineaRollupLogClient = new EthersLineaRollupLogClient(this.l1Provider, l1ContractAddress); + const l2MessageServiceLogClient = this.getL2ContractEventLogClient(l2ContractAddress); + + return new LineaRollupClient( + this.l1Provider, + l1ContractAddress, + lineaRollupLogClient, + l2MessageServiceLogClient, + this.getL1GasProvider(), + new LineaRollupMessageRetriever(this.l1Provider, lineaRollupLogClient, l1ContractAddress), + new MerkleTreeService( + this.l1Provider, + l1ContractAddress, + lineaRollupLogClient, + l2MessageServiceLogClient, + this.l2MessageTreeDepth, + ), + this.mode, + this.l1Signer, + ); + } + + /** + * Retrieves an instance of the `L2MessageServiceClient` for interacting with the L2 contract. + * + * @param {string} [localContractAddress] - Optional custom L2 contract address. Required if the network is set to 'custom'. + * @returns {L2MessageServiceClient} An instance of the `L2MessageServiceClient` configured for the specified L2 contract. + */ + public getL2Contract(localContractAddress?: string): L2MessageServiceClient { + const l2ContractAddress = this.getContractAddress("l2", localContractAddress); + + const l2MessageServiceContract = new L2MessageServiceClient( + this.l2Provider, + l2ContractAddress, + new L2MessageServiceMessageRetriever( + this.l2Provider, + this.getL2ContractEventLogClient(l2ContractAddress), + l2ContractAddress, + ), + this.getL2GasProvider(), + this.mode, + this.l2Signer, + ); + + return l2MessageServiceContract; + } + + /** + * Creates an instance of the `L1ClaimingService` for managing message claiming on L1. + * + * @param {string} [localL1ContractAddress] - Optional custom L1 contract address. Required if the network is set to 'custom'. + * @param {string} [localL2ContractAddress] - Optional custom L2 contract address. Required if the network is set to 'custom'. + * @returns {L1ClaimingService} An instance of the `L1ClaimingService` configured for the specified contract addresses. + */ + public getL1ClaimingService(localL1ContractAddress?: string, localL2ContractAddress?: string): L1ClaimingService { + return new L1ClaimingService( + this.getL1Contract(localL1ContractAddress, localL2ContractAddress), + this.getL2Contract(localL2ContractAddress), + this.getL2ContractEventLogClient(localL2ContractAddress), + this.network, + ); + } + + /** + * Retrieves the contract address for the specified contract type. + * @param contractType The type of contract to retrieve the address for. + * @param localContractAddress Optional custom contract address. + * @returns The contract address for the specified contract type. + */ + private getContractAddress(contractType: "l1" | "l2", localContractAddress?: string): string { + if (this.network === "custom") { + if (!localContractAddress) { + throw new BaseError(`You need to provide a ${contractType.toUpperCase()} contract address.`); + } + return localContractAddress; + } else { + const contractAddress = NETWORKS[this.network][`${contractType}ContractAddress`]; + if (!contractAddress) { + throw new BaseError(`Contract address for ${contractType.toUpperCase()} not found in network ${this.network}.`); + } + return contractAddress; + } + } + + /** + * Creates a wallet instance from a private key or existing wallet. + * @param {string | Wallet} privateKeyOrWallet - The private key or wallet instance + * @returns {Signer} The configured signer + * @throws {BaseError} If the private key is invalid + * @private + */ + private getWallet(privateKeyOrWallet: string | Wallet): Signer { + try { + return privateKeyOrWallet instanceof Wallet ? privateKeyOrWallet : new Wallet(privateKeyOrWallet); + } catch (e) { + if (e instanceof Error && e.message.includes("invalid private key")) { + throw new BaseError("Something went wrong when trying to generate Wallet. Please check your private key."); + } + throw e; + } + } + + /** + * Type guard to check if an object implements the EIP-1193 provider interface. + * @param {any} obj - The object to check + * @returns {boolean} True if the object is an EIP-1193 provider + * @private + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + private isEip1193Provider(obj: any): obj is Eip1193Provider { + return obj && typeof obj.request === "function"; + } +} diff --git a/sdk/src/clients/blockchain/ChainQuerier.ts b/sdk/src/clients/blockchain/ChainQuerier.ts deleted file mode 100644 index d63495933..000000000 --- a/sdk/src/clients/blockchain/ChainQuerier.ts +++ /dev/null @@ -1,152 +0,0 @@ -import { - Block, - BlockTag, - JsonRpcProvider, - Signer, - TransactionReceipt, - TransactionRequest, - TransactionResponse, -} from "ethers"; -import { BaseError } from "../../core/errors/Base"; -import { IChainQuerier } from "../../core/clients/blockchain/IChainQuerier"; -import { GasFees } from "../../core/clients/blockchain/IGasProvider"; - -export class ChainQuerier - implements IChainQuerier -{ - /** - * Creates an instance of ChainQuerier. - * - * @param {JsonRpcProvider} provider - The JSON RPC provider for interacting with the Ethereum network. - * @param {Signer} [signer] - An optional Ethers.js signer object for signing transactions. - */ - constructor( - protected readonly provider: JsonRpcProvider, - protected readonly signer?: Signer, - ) {} - - /** - * Retrieves the current nonce for a given account address. - * - * @param {string} [accountAddress] - The Ethereum account address to fetch the nonce for. Optional if a signer is provided. - * @returns {Promise} A promise that resolves to the current nonce of the account. - * @throws {BaseError} If no account address is provided and no signer is available. - */ - public async getCurrentNonce(accountAddress?: string): Promise { - if (accountAddress) { - return this.provider.getTransactionCount(accountAddress); - } - - if (!this.signer) { - throw new BaseError("Please provide a signer."); - } - - return this.provider.getTransactionCount(await this.signer.getAddress()); - } - - /** - * Retrieves the current block number of the blockchain. - * - * @returns {Promise} A promise that resolves to the current block number. - */ - public async getCurrentBlockNumber(): Promise { - return this.provider.getBlockNumber(); - } - - /** - * Retrieves the transaction receipt for a given transaction hash. - * - * @param {string} transactionHash - The hash of the transaction to fetch the receipt for. - * @returns {Promise} A promise that resolves to the transaction receipt, or null if the transaction is not found. - */ - public async getTransactionReceipt(transactionHash: string): Promise { - return this.provider.getTransactionReceipt(transactionHash); - } - - /** - * Retrieves a block by its number or tag. - * - * @param {BlockTag} blockNumber - The block number or tag to fetch. - * @returns {Promise} A promise that resolves to the block, or null if the block is not found. - */ - public async getBlock(blockNumber: BlockTag): Promise { - return this.provider.getBlock(blockNumber); - } - - /** - * Sends a custom JSON-RPC request. - * - * @param {string} methodName - The name of the JSON-RPC method to call. - * @param {any[]} params - The parameters to pass to the JSON-RPC method. - * @returns {Promise} A promise that resolves to the result of the JSON-RPC call. - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - public async sendRequest(methodName: string, params: any[]): Promise { - return this.provider.send(methodName, params); - } - - /** - * Estimates the gas required for a transaction. - * - * @param {TransactionRequest} transactionRequest - The transaction request to estimate gas for. - * @returns {Promise} A promise that resolves to the estimated gas. - */ - public async estimateGas(transactionRequest: TransactionRequest): Promise { - return this.provider.estimateGas(transactionRequest); - } - - /** - * Gets the JSON RPC provider. - * - * @returns {JsonRpcProvider} The JSON RPC provider. - */ - public getProvider(): JsonRpcProvider { - return this.provider; - } - - /** - * Retrieves a transaction by its hash. - * - * @param {string} transactionHash - The hash of the transaction to fetch. - * @returns {Promise} A promise that resolves to the transaction, or null if the transaction is not found. - */ - public async getTransaction(transactionHash: string): Promise { - return this.provider.getTransaction(transactionHash); - } - - /** - * Sends a signed transaction. - * - * @param {string} signedTx - The signed transaction to broadcast. - * @returns {Promise} A promise that resolves to the transaction response. - */ - public async broadcastTransaction(signedTx: string): Promise { - return this.provider.broadcastTransaction(signedTx); - } - - /** - * Executes a call on the Ethereum network. - * - * @param {TransactionRequest} transactionRequest - The transaction request to execute. - * @returns {Promise} A promise that resolves to the result of the call. - */ - public ethCall(transactionRequest: TransactionRequest): Promise { - return this.provider.call(transactionRequest); - } - - /** - * Retrieves the current gas fees. - * - * @returns {Promise} A promise that resolves to an object containing the current gas fees. - * @throws {BaseError} If there is an error getting the fee data. - */ - public async getFees(): Promise { - const { maxPriorityFeePerGas, maxFeePerGas } = await this.provider.getFeeData(); - - if (!maxPriorityFeePerGas || !maxFeePerGas) { - throw new BaseError("Error getting fee data"); - } - - return { maxPriorityFeePerGas, maxFeePerGas }; - } -} diff --git a/sdk/src/clients/blockchain/__tests__/ChainQuerier.test.ts b/sdk/src/clients/blockchain/__tests__/ChainQuerier.test.ts deleted file mode 100644 index f4595fc7b..000000000 --- a/sdk/src/clients/blockchain/__tests__/ChainQuerier.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { JsonRpcProvider, Wallet } from "ethers"; -import { describe, afterEach, it, expect, beforeEach } from "@jest/globals"; -import { MockProxy, mock, mockClear } from "jest-mock-extended"; -import { ChainQuerier } from "../ChainQuerier"; -import { TEST_ADDRESS_1, TEST_L1_SIGNER_PRIVATE_KEY, TEST_TRANSACTION_HASH } from "../../../utils/testing/constants"; -import { generateTransactionReceipt } from "../../../utils/testing/helpers"; - -describe("ChainQuerier", () => { - let providerMock: MockProxy; - let chainQuerier: ChainQuerier; - beforeEach(() => { - providerMock = mock(); - chainQuerier = new ChainQuerier(providerMock, new Wallet(TEST_L1_SIGNER_PRIVATE_KEY, providerMock)); - }); - - afterEach(() => { - mockClear(providerMock); - }); - - describe("getCurrentNonce", () => { - it("should throw an error when accountAddress param is undefined and no signer has been passed to the ChainQuerier class", async () => { - const chainQuerier = new ChainQuerier(providerMock); - await expect(chainQuerier.getCurrentNonce()).rejects.toThrow("Please provide a signer."); - }); - - it("should return the nonce of the accountAddress passed in parameter", async () => { - const getTransactionCountSpy = jest.spyOn(providerMock, "getTransactionCount").mockResolvedValueOnce(10); - expect(await chainQuerier.getCurrentNonce(TEST_ADDRESS_1)).toEqual(10); - expect(getTransactionCountSpy).toHaveBeenCalledTimes(1); - expect(getTransactionCountSpy).toHaveBeenCalledWith(TEST_ADDRESS_1); - }); - - it("should return the nonce of the signer address", async () => { - const getTransactionCountSpy = jest.spyOn(providerMock, "getTransactionCount").mockResolvedValueOnce(10); - expect(await chainQuerier.getCurrentNonce()).toEqual(10); - expect(getTransactionCountSpy).toHaveBeenCalledTimes(1); - expect(getTransactionCountSpy).toHaveBeenCalledWith("0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf"); - }); - }); - - describe("getCurrentBlockNumber", () => { - it("should return the current block number", async () => { - const mockBlockNumber = 10_000; - jest.spyOn(providerMock, "getBlockNumber").mockResolvedValueOnce(mockBlockNumber); - expect(await chainQuerier.getCurrentBlockNumber()).toEqual(mockBlockNumber); - }); - }); - - describe("getTransactionReceipt", () => { - it("should return the transaction receipt", async () => { - const mockTransactionReceipt = generateTransactionReceipt(); - jest.spyOn(providerMock, "getTransactionReceipt").mockResolvedValueOnce(mockTransactionReceipt); - expect(await chainQuerier.getTransactionReceipt(TEST_TRANSACTION_HASH)).toEqual(mockTransactionReceipt); - }); - }); -}); diff --git a/sdk/src/clients/blockchain/abis/L2MessageService.json b/sdk/src/clients/blockchain/abis/L2MessageService.json deleted file mode 100644 index 167825234..000000000 --- a/sdk/src/clients/blockchain/abis/L2MessageService.json +++ /dev/null @@ -1,1120 +0,0 @@ -{ - "contractName": "L2MessageService", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - } - ], - "name": "FeePaymentFailed", - "type": "error" - }, - { - "inputs": [], - "name": "FeeTooLow", - "type": "error" - }, - { - "inputs": [], - "name": "FinalRollingHashIsZero", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "pauseType", - "type": "uint256" - } - ], - "name": "IsNotPaused", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "pauseType", - "type": "uint256" - } - ], - "name": "IsPaused", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expected", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "found", - "type": "uint256" - } - ], - "name": "L1MessageNumberSynchronizationWrong", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "found", - "type": "bytes32" - } - ], - "name": "L1RollingHashSynchronizationWrong", - "type": "error" - }, - { - "inputs": [], - "name": "LimitIsZero", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "messageHash", - "type": "bytes32" - } - ], - "name": "MessageDoesNotExistOrHasAlreadyBeenClaimed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "length", - "type": "uint256" - } - ], - "name": "MessageHashesListLengthHigherThanOneHundred", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "name": "MessageSendingFailed", - "type": "error" - }, - { - "inputs": [], - "name": "PeriodIsZero", - "type": "error" - }, - { - "inputs": [], - "name": "RateLimitExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "ServiceHasMigratedToRollingHashes", - "type": "error" - }, - { - "inputs": [], - "name": "ValueSentTooLow", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddressNotAllowed", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "resettingAddress", - "type": "address" - } - ], - "name": "AmountUsedInPeriodReset", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32[]", - "name": "messageHashes", - "type": "bytes32[]" - } - ], - "name": "L1L2MessageHashesAddedToInbox", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "amountChangeBy", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bool", - "name": "amountUsedLoweredToLimit", - "type": "bool" - }, - { - "indexed": false, - "internalType": "bool", - "name": "usedAmountResetToZero", - "type": "bool" - } - ], - "name": "LimitAmountChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "_messageHash", - "type": "bytes32" - } - ], - "name": "MessageClaimed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "_from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "_to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "_fee", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "_value", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "_nonce", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "_calldata", - "type": "bytes" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "_messageHash", - "type": "bytes32" - } - ], - "name": "MessageSent", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "previousMinimumFee", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newMinimumFee", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "calledBy", - "type": "address" - } - ], - "name": "MinimumFeeChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "messageSender", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "pauseType", - "type": "uint256" - } - ], - "name": "Paused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "periodInSeconds", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "limitInWei", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "currentPeriodEnd", - "type": "uint256" - } - ], - "name": "RateLimitInitialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "messageNumber", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "rollingHash", - "type": "bytes32" - } - ], - "name": "RollingHashUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "version", - "type": "uint256" - } - ], - "name": "ServiceVersionMigrated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "messageSender", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "pauseType", - "type": "uint256" - } - ], - "name": "UnPaused", - "type": "event" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "GENERAL_PAUSE_TYPE", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "INBOX_STATUS_CLAIMED", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "INBOX_STATUS_RECEIVED", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "INBOX_STATUS_UNKNOWN", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "L1_L2_MESSAGE_SETTER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "L1_L2_PAUSE_TYPE", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "L2_L1_PAUSE_TYPE", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MINIMUM_FEE_SETTER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "PAUSE_MANAGER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "PROVING_SYSTEM_PAUSE_TYPE", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "RATE_LIMIT_SETTER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32[]", - "name": "_messageHashes", - "type": "bytes32[]" - } - ], - "name": "addL1L2MessageHashes", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32[]", - "name": "_messageHashes", - "type": "bytes32[]" - }, - { - "internalType": "uint256", - "name": "_startingMessageNumber", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_finalMessageNumber", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "_finalRollingHash", - "type": "bytes32" - } - ], - "name": "anchorL1L2MessageHashes", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_from", - "type": "address" - }, - { - "internalType": "address", - "name": "_to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_fee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_value", - "type": "uint256" - }, - { - "internalType": "address payable", - "name": "_feeRecipient", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_calldata", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "_nonce", - "type": "uint256" - } - ], - "name": "claimMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "currentPeriodAmountInWei", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "currentPeriodEnd", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "messageHash", - "type": "bytes32" - } - ], - "name": "inboxL1L2MessageStatus", - "outputs": [ - { - "internalType": "uint256", - "name": "messageStatus", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_securityCouncil", - "type": "address" - }, - { - "internalType": "address", - "name": "_l1l2MessageSetter", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_rateLimitPeriod", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_rateLimitAmount", - "type": "uint256" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "_pauseType", - "type": "uint8" - } - ], - "name": "isPaused", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "messageNumber", - "type": "uint256" - } - ], - "name": "l1RollingHashes", - "outputs": [ - { - "internalType": "bytes32", - "name": "rollingHash", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "lastAnchoredL1MessageNumber", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "limitInWei", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "minimumFeeInWei", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "nextMessageNumber", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "_pauseType", - "type": "uint8" - } - ], - "name": "pauseByType", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "pauseType", - "type": "bytes32" - } - ], - "name": "pauseTypeStatuses", - "outputs": [ - { - "internalType": "bool", - "name": "pauseStatus", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "periodInSeconds", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "resetAmountUsedInPeriod", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "resetRateLimitAmount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_fee", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_calldata", - "type": "bytes" - } - ], - "name": "sendMessage", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "sender", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_feeInWei", - "type": "uint256" - } - ], - "name": "setMinimumFee", - "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": "uint8", - "name": "_pauseType", - "type": "uint8" - } - ], - "name": "unPauseByType", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "bytecode": "0x608060405234801561001057600080fd5b5061001961001e565b6100dd565b600054610100900460ff161561008a5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116146100db576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61249980620000ed6000396000f3fe6080604052600436106102bb5760003560e01c806391f7b9011161016e578063bcbd6fcd116100cb578063d547741f1161007f578063e196fb5d11610064578063e196fb5d14610783578063eb990c59146107a3578063f4b476e1146107c357600080fd5b8063d547741f1461072f578063d84f91e81461074f57600080fd5b8063c0729ab1116100b0578063c0729ab1146106d3578063c1dc0f07146106e9578063cc5782f6146106ff57600080fd5b8063bcbd6fcd1461066b578063bf3e75051461069f57600080fd5b8063ad422ff011610122578063b4a5a4b711610107578063b4a5a4b714610610578063b837dbe914610625578063bc61e7331461063c57600080fd5b8063ad422ff0146105e5578063aea4f745146105fb57600080fd5b80639f3ce55a116101535780639f3ce55a146105a8578063a217fddf146105bb578063abd6230d146105d057600080fd5b806391f7b901146103525780639340a1d11461059157600080fd5b8063491e09361161021c57806374377a34116101d05780637fe335d3116101b55780637fe335d314610506578063899458831461053457806391d148541461054b57600080fd5b806374377a34146104bd5780637d1e8c55146104f157600080fd5b80635879445611610201578063587944561461047e57806367e404ce146104945780636a6379671461042957600080fd5b8063491e09361461043e578063557eac731461045e57600080fd5b8063248a9ca31161027357806336568abe1161025857806336568abe146103e95780633c3621461461040957806348922ab71461042957600080fd5b8063248a9ca3146103995780632f2ff15d146103c957600080fd5b80631065a399116102a45780631065a3991461033057806311314d0f14610352578063182a75061461037957600080fd5b806301ffc9a7146102c05780630f6893ca146102f5575b600080fd5b3480156102cc57600080fd5b506102e06102db366004611eaf565b6107e3565b60405190151581526020015b60405180910390f35b34801561030157600080fd5b50610322610310366004611ef1565b60b06020526000908152604090205481565b6040519081526020016102ec565b34801561033c57600080fd5b5061035061034b366004611f0a565b61087c565b005b34801561035e57600080fd5b50610367600281565b60405160ff90911681526020016102ec565b34801561038557600080fd5b50610350610394366004611ef1565b610947565b3480156103a557600080fd5b506103226103b4366004611ef1565b60009081526065602052604090206001015490565b3480156103d557600080fd5b506103506103e4366004611f42565b6109ba565b3480156103f557600080fd5b50610350610404366004611f42565b6109e4565b34801561041557600080fd5b50610350610424366004611fbe565b610a70565b34801561043557600080fd5b50610367600181565b34801561044a57600080fd5b5061035061045936600461205a565b610d2f565b34801561046a57600080fd5b50610350610479366004611ef1565b610fd0565b34801561048a57600080fd5b5061032260995481565b3480156104a057600080fd5b50610115546040516001600160a01b0390911681526020016102ec565b3480156104c957600080fd5b506103227f4705265620026983c754c5288b65446d794a03174326ec6d7c0b5c7f1fd6741581565b3480156104fd57600080fd5b50610367600081565b34801561051257600080fd5b50610322610521366004611ef1565b6101196020526000908152604090205481565b34801561054057600080fd5b506103226101175481565b34801561055757600080fd5b506102e0610566366004611f42565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561059d57600080fd5b506103226101185481565b6103506105b63660046120f0565b611098565b3480156105c757600080fd5b50610322600081565b3480156105dc57600080fd5b50610367600381565b3480156105f157600080fd5b5061032260985481565b34801561060757600080fd5b5061035061128a565b34801561061c57600080fd5b50610367600481565b34801561063157600080fd5b506103226101165481565b34801561064857600080fd5b506102e0610657366004611f0a565b60a654600160ff9092169190911b16151590565b34801561067757600080fd5b506103227fcc6ce8bb749b4b07d2f635ce95747506096d0737f9abf10cc8f4a14384603ba281565b3480156106ab57600080fd5b506103227f1185e52d62bfbbea270e57d3d09733d221b53ab7a18bae82bb3c6c74bab16d8281565b3480156106df57600080fd5b50610322609a5481565b3480156106f557600080fd5b5061032260975481565b34801561070b57600080fd5b506102e061071a366004611ef1565b60a56020526000908152604090205460ff1681565b34801561073b57600080fd5b5061035061074a366004611f42565b6112e6565b34801561075b57600080fd5b506103227f356a809dfdea9198dd76fb76bf6d403ecf13ea675eb89e1eda2db2c4a4676a2681565b34801561078f57600080fd5b5061035061079e366004611f0a565b61130b565b3480156107af57600080fd5b506103506107be36600461214c565b61139d565b3480156107cf57600080fd5b506103506107de366004612192565b6115e6565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061087657507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b7f356a809dfdea9198dd76fb76bf6d403ecf13ea675eb89e1eda2db2c4a4676a266108a681611718565b60a654600160ff84161b166108f1576040517fb015579f00000000000000000000000000000000000000000000000000000000815260ff831660048201526024015b60405180910390fd5b60a68054600160ff851690811b199091169091557fef04ba2036ccaeab3a59717b51d2b9146b0b0904077177f1148a5418bf1eae23335b6040516001600160a01b03909116815260200160405180910390a25050565b7fcc6ce8bb749b4b07d2f635ce95747506096d0737f9abf10cc8f4a14384603ba261097181611718565b610117805490839055604080518281526020810185905233917f6d8040017e56a6d91bb242def14af5d7eae1eaff7475e45c678dac5d49d35498910160405180910390a2505050565b6000828152606560205260409020600101546109d581611718565b6109df8383611725565b505050565b6001600160a01b0381163314610a625760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084016108e8565b610a6c82826117c7565b5050565b6001610a7b8161184a565b7f4705265620026983c754c5288b65446d794a03174326ec6d7c0b5c7f1fd67415610aa581611718565b856064811115610acb57604051630ec5d10d60e21b8152600481018290526024016108e8565b6000849003610b06576040517f36a4bb9400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610118546000819003610b5257610b1e6001886121ea565b6040519091506002907f6f4cd2683fd248db2513412cb2f25f767694689d6f083941f7437c8fe1f8796490600090a2610b92565b80610b5e6001896121ea565b14610b9257610b6e6001886121ea565b60405163d39e75f960e01b81526004810191909152602481018290526044016108e8565b6000818152610119602052604081205490805b84811015610c2a578b8b82818110610bbf57610bbf6121fd565b905060200201359150600060ff1660b060008481526020019081526020016000205403610c1a57600082815260b06020526040902060019055610c0c838360009182526020526040902090565b9250610c1784612213565b93505b610c2381612213565b9050610ba5565b50878314610c555760405163d39e75f960e01b815260048101899052602481018490526044016108e8565b818714610c98576040517f7557a60a00000000000000000000000000000000000000000000000000000000815260048101889052602481018390526044016108e8565b610118548314610d22576101188390556000838152610119602052604090819020839055517f9995fb3da0c2de4012f2b814b6fc29ce7507571dcb20b8d0bd38621a842df1eb90610cec908d908d9061222c565b60405180910390a1604051829084907f99b65a4301b38c09fb6a5f27052d73e8372bbe8f6779d678bfe8a41b66cce7ac90600090a35b5050505050505050505050565b610d37611878565b858784848760005a9050610d4b60026118d1565b60008e8e8e8e8b8e8e604051602001610d6a97969594939291906122a7565b604051602081830303815290604052805190602001209050610d8b81611925565b8e61011560006101000a8154816001600160a01b0302191690836001600160a01b031602179055506000808f6001600160a01b03168e8d8d604051610dd19291906122f3565b60006040518083038185875af1925050503d8060008114610e0e576040519150601f19603f3d011682016040523d82523d6000602084013e610e13565b606091505b509150915081610e7057805115610e2d5780518082602001fd5b8f6040517f546134430000000000000000000000000000000000000000000000000000000081526004016108e891906001600160a01b0391909116815260200190565b610115805473ffffffffffffffffffffffffffffffffffffffff191663075bcd1517905560405183907fa4c827e719e911e8f19393ccdb85b5102f08f0910604d340ba38390b7ff2ab0e90600090a2505086159050610fb657856000849003610f4257853b158015610f40573a5a610eea61ae3486612303565b610ef491906121ea565b610efe9190612316565b915081881115610f3c576001600160a01b0387166108fc610f1f848b6121ea565b6040518115909202916000818181858888f1935050505050610f40565b8791505b505b60006001600160a01b03841615610f595783610f5b565b335b90506000816001600160a01b03166108fc849081150290604051600060405180830381858888f19350505050905080610fb25760405163295f137d60e21b81526001600160a01b03831660048201526024016108e8565b5050505b505050505050610fc6600160b155565b5050505050505050565b7f1185e52d62bfbbea270e57d3d09733d221b53ab7a18bae82bb3c6c74bab16d82610ffa81611718565b6000806000426099541015611021576097546110169042612303565b609955506001611033565b609a5485101561103357849250600191505b609885905580806110415750815b1561104c57609a8390555b60408051868152831515602082015282151581830152905133917fbc3dc0cb5c15c51c81316450d44048838bb478b9809447d01c766a06f3e9f2c8919081900360600190a25050505050565b6110a260036118d1565b6001600160a01b0384166110c9576040516342bcdf7f60e11b815260040160405180910390fd5b34831115611103576040517fb03b693200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101175480841015611141576040517f732f941300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008061114e83876121ea565b915061115a86346121ea565b6101168054919250600091908261117083612213565b9091555090506111886111838484612303565b611984565b600033898585858b8b6040516020016111a797969594939291906122a7565b60405160208183030381529060405280519060200120905080896001600160a01b0316336001600160a01b03167fe856c2b8bd4eb0027ce32eeaf595c21b0b6b4644b326e5b7bd80a1cf8db72e6c8787878d8d60405161120b95949392919061232d565b60405180910390a4604051600090419087908381818185875af1925050503d8060008114611255576040519150601f19603f3d011682016040523d82523d6000602084013e61125a565b606091505b505090508061127e5760405163295f137d60e21b81524160048201526024016108e8565b50505050505050505050565b7f1185e52d62bfbbea270e57d3d09733d221b53ab7a18bae82bb3c6c74bab16d826112b481611718565b6000609a81905560405133917fba88c025b0cbb77022c0c487beef24f759f1e4be2f51a205bc427cee19c2eaa691a250565b60008281526065602052604090206001015461130181611718565b6109df83836117c7565b7f356a809dfdea9198dd76fb76bf6d403ecf13ea675eb89e1eda2db2c4a4676a2661133581611718565b60a654600160ff84161b161561136357604051636d9236ef60e11b815260ff831660048201526024016108e8565b60a68054600160ff851690811b9091179091557fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d33610928565b600054610100900460ff16158080156113bd5750600054600160ff909116105b806113d75750303b1580156113d7575060005460ff166001145b6114495760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016108e8565b6000805460ff19166001179055801561146c576000805461ff0019166101001790555b6001600160a01b038516611493576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b0384166114ba576040516342bcdf7f60e11b815260040160405180910390fd5b6114c26119fa565b6114ca6119fa565b6114d26119fa565b6114dc8383611a67565b6114e584611bab565b6001610116556114f6600086611725565b6115207fcc6ce8bb749b4b07d2f635ce95747506096d0737f9abf10cc8f4a14384603ba286611725565b61154a7f1185e52d62bfbbea270e57d3d09733d221b53ab7a18bae82bb3c6c74bab16d8286611725565b6115747f356a809dfdea9198dd76fb76bf6d403ecf13ea675eb89e1eda2db2c4a4676a2686611725565b610115805473ffffffffffffffffffffffffffffffffffffffff191663075bcd1517905580156115df576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15b5050505050565b60016115f18161184a565b7f4705265620026983c754c5288b65446d794a03174326ec6d7c0b5c7f1fd6741561161b81611718565b6101185415611656576040517fac1775cf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82606481111561167c57604051630ec5d10d60e21b8152600481018290526024016108e8565b60005b818110156116e657600086868381811061169b5761169b6121fd565b905060200201359050600060ff1660b0600083815260200190815260200160002054036116d557600081815260b060205260409020600190555b506116df81612213565b905061167f565b507f9995fb3da0c2de4012f2b814b6fc29ce7507571dcb20b8d0bd38621a842df1eb85856040516115d692919061222c565b6117228133611c40565b50565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610a6c5760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556117833390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff1615610a6c5760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60a654600160ff83161b161561172257604051636d9236ef60e11b815260ff821660048201526024016108e8565b600260b154036118ca5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108e8565b600260b155565b60a654600160ff83161b81161561190057604051636d9236ef60e11b815260ff831660048201526024016108e8565b6002811615610a6c57604051636d9236ef60e11b8152600160048201526024016108e8565b600081815260b06020526040902054600114611970576040517f992d87c3000000000000000000000000000000000000000000000000000000008152600481018290526024016108e8565b600090815260b06020526040902060029055565b60004260995410156119a75760975461199d9042612303565b60995550806119b8565b81609a546119b59190612303565b90505b6098548111156119f4576040517fa74c1c5f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b609a5550565b600054610100900460ff16611a655760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108e8565b565b600054610100900460ff16611ad25760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108e8565b81600003611b0c576040517fb5ed5a3b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600003611b46576040517fd10d72bb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60978290556098819055611b5a8242612303565b60998190556097546098546040805192835260208301919091528101919091527f8f805c372b66240792580418b7328c0c554ae235f0932475c51b026887fe26a99060600160405180910390a15050565b600054610100900460ff16611c165760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108e8565b6117227f4705265620026983c754c5288b65446d794a03174326ec6d7c0b5c7f1fd6741582611725565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610a6c57611c7381611cb5565b611c7e836020611cc7565b604051602001611c8f929190612382565b60408051601f198184030181529082905262461bcd60e51b82526108e891600401612403565b60606108766001600160a01b03831660145b60606000611cd6836002612316565b611ce1906002612303565b67ffffffffffffffff811115611cf957611cf9612436565b6040519080825280601f01601f191660200182016040528015611d23576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611d5a57611d5a6121fd565b60200101906001600160f81b031916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611da557611da56121fd565b60200101906001600160f81b031916908160001a9053506000611dc9846002612316565b611dd4906001612303565b90505b6001811115611e59577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110611e1557611e156121fd565b1a60f81b828281518110611e2b57611e2b6121fd565b60200101906001600160f81b031916908160001a90535060049490941c93611e528161244c565b9050611dd7565b508315611ea85760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016108e8565b9392505050565b600060208284031215611ec157600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114611ea857600080fd5b600060208284031215611f0357600080fd5b5035919050565b600060208284031215611f1c57600080fd5b813560ff81168114611ea857600080fd5b6001600160a01b038116811461172257600080fd5b60008060408385031215611f5557600080fd5b823591506020830135611f6781611f2d565b809150509250929050565b60008083601f840112611f8457600080fd5b50813567ffffffffffffffff811115611f9c57600080fd5b6020830191508360208260051b8501011115611fb757600080fd5b9250929050565b600080600080600060808688031215611fd657600080fd5b853567ffffffffffffffff811115611fed57600080fd5b611ff988828901611f72565b9099909850602088013597604081013597506060013595509350505050565b60008083601f84011261202a57600080fd5b50813567ffffffffffffffff81111561204257600080fd5b602083019150836020828501011115611fb757600080fd5b60008060008060008060008060e0898b03121561207657600080fd5b883561208181611f2d565b9750602089013561209181611f2d565b9650604089013595506060890135945060808901356120af81611f2d565b935060a089013567ffffffffffffffff8111156120cb57600080fd5b6120d78b828c01612018565b999c989b50969995989497949560c00135949350505050565b6000806000806060858703121561210657600080fd5b843561211181611f2d565b935060208501359250604085013567ffffffffffffffff81111561213457600080fd5b61214087828801612018565b95989497509550505050565b6000806000806080858703121561216257600080fd5b843561216d81611f2d565b9350602085013561217d81611f2d565b93969395505050506040820135916060013590565b600080602083850312156121a557600080fd5b823567ffffffffffffffff8111156121bc57600080fd5b6121c885828601611f72565b90969095509350505050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610876576108766121d4565b634e487b7160e01b600052603260045260246000fd5b600060018201612225576122256121d4565b5060010190565b6020815281602082015260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111561226557600080fd5b8260051b80856040850137919091016040019392505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006001600160a01b03808a16835280891660208401525086604083015285606083015284608083015260c060a08301526122e660c08301848661227e565b9998505050505050505050565b8183823760009101908152919050565b80820180821115610876576108766121d4565b8082028115828204841417610876576108766121d4565b85815284602082015283604082015260806060820152600061235360808301848661227e565b979650505050505050565b60005b83811015612379578181015183820152602001612361565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516123ba81601785016020880161235e565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516123f781602884016020880161235e565b01602801949350505050565b602081526000825180602084015261242281604085016020870161235e565b601f01601f19169190910160400192915050565b634e487b7160e01b600052604160045260246000fd5b60008161245b5761245b6121d4565b50600019019056fea2646970667358221220ae954f99bf065be167ad739534a69496a26a5d06063088f6fc190b5999d597b164736f6c63430008130033", - "deployedBytecode": "0x6080604052600436106102bb5760003560e01c806391f7b9011161016e578063bcbd6fcd116100cb578063d547741f1161007f578063e196fb5d11610064578063e196fb5d14610783578063eb990c59146107a3578063f4b476e1146107c357600080fd5b8063d547741f1461072f578063d84f91e81461074f57600080fd5b8063c0729ab1116100b0578063c0729ab1146106d3578063c1dc0f07146106e9578063cc5782f6146106ff57600080fd5b8063bcbd6fcd1461066b578063bf3e75051461069f57600080fd5b8063ad422ff011610122578063b4a5a4b711610107578063b4a5a4b714610610578063b837dbe914610625578063bc61e7331461063c57600080fd5b8063ad422ff0146105e5578063aea4f745146105fb57600080fd5b80639f3ce55a116101535780639f3ce55a146105a8578063a217fddf146105bb578063abd6230d146105d057600080fd5b806391f7b901146103525780639340a1d11461059157600080fd5b8063491e09361161021c57806374377a34116101d05780637fe335d3116101b55780637fe335d314610506578063899458831461053457806391d148541461054b57600080fd5b806374377a34146104bd5780637d1e8c55146104f157600080fd5b80635879445611610201578063587944561461047e57806367e404ce146104945780636a6379671461042957600080fd5b8063491e09361461043e578063557eac731461045e57600080fd5b8063248a9ca31161027357806336568abe1161025857806336568abe146103e95780633c3621461461040957806348922ab71461042957600080fd5b8063248a9ca3146103995780632f2ff15d146103c957600080fd5b80631065a399116102a45780631065a3991461033057806311314d0f14610352578063182a75061461037957600080fd5b806301ffc9a7146102c05780630f6893ca146102f5575b600080fd5b3480156102cc57600080fd5b506102e06102db366004611eaf565b6107e3565b60405190151581526020015b60405180910390f35b34801561030157600080fd5b50610322610310366004611ef1565b60b06020526000908152604090205481565b6040519081526020016102ec565b34801561033c57600080fd5b5061035061034b366004611f0a565b61087c565b005b34801561035e57600080fd5b50610367600281565b60405160ff90911681526020016102ec565b34801561038557600080fd5b50610350610394366004611ef1565b610947565b3480156103a557600080fd5b506103226103b4366004611ef1565b60009081526065602052604090206001015490565b3480156103d557600080fd5b506103506103e4366004611f42565b6109ba565b3480156103f557600080fd5b50610350610404366004611f42565b6109e4565b34801561041557600080fd5b50610350610424366004611fbe565b610a70565b34801561043557600080fd5b50610367600181565b34801561044a57600080fd5b5061035061045936600461205a565b610d2f565b34801561046a57600080fd5b50610350610479366004611ef1565b610fd0565b34801561048a57600080fd5b5061032260995481565b3480156104a057600080fd5b50610115546040516001600160a01b0390911681526020016102ec565b3480156104c957600080fd5b506103227f4705265620026983c754c5288b65446d794a03174326ec6d7c0b5c7f1fd6741581565b3480156104fd57600080fd5b50610367600081565b34801561051257600080fd5b50610322610521366004611ef1565b6101196020526000908152604090205481565b34801561054057600080fd5b506103226101175481565b34801561055757600080fd5b506102e0610566366004611f42565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561059d57600080fd5b506103226101185481565b6103506105b63660046120f0565b611098565b3480156105c757600080fd5b50610322600081565b3480156105dc57600080fd5b50610367600381565b3480156105f157600080fd5b5061032260985481565b34801561060757600080fd5b5061035061128a565b34801561061c57600080fd5b50610367600481565b34801561063157600080fd5b506103226101165481565b34801561064857600080fd5b506102e0610657366004611f0a565b60a654600160ff9092169190911b16151590565b34801561067757600080fd5b506103227fcc6ce8bb749b4b07d2f635ce95747506096d0737f9abf10cc8f4a14384603ba281565b3480156106ab57600080fd5b506103227f1185e52d62bfbbea270e57d3d09733d221b53ab7a18bae82bb3c6c74bab16d8281565b3480156106df57600080fd5b50610322609a5481565b3480156106f557600080fd5b5061032260975481565b34801561070b57600080fd5b506102e061071a366004611ef1565b60a56020526000908152604090205460ff1681565b34801561073b57600080fd5b5061035061074a366004611f42565b6112e6565b34801561075b57600080fd5b506103227f356a809dfdea9198dd76fb76bf6d403ecf13ea675eb89e1eda2db2c4a4676a2681565b34801561078f57600080fd5b5061035061079e366004611f0a565b61130b565b3480156107af57600080fd5b506103506107be36600461214c565b61139d565b3480156107cf57600080fd5b506103506107de366004612192565b6115e6565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061087657507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b7f356a809dfdea9198dd76fb76bf6d403ecf13ea675eb89e1eda2db2c4a4676a266108a681611718565b60a654600160ff84161b166108f1576040517fb015579f00000000000000000000000000000000000000000000000000000000815260ff831660048201526024015b60405180910390fd5b60a68054600160ff851690811b199091169091557fef04ba2036ccaeab3a59717b51d2b9146b0b0904077177f1148a5418bf1eae23335b6040516001600160a01b03909116815260200160405180910390a25050565b7fcc6ce8bb749b4b07d2f635ce95747506096d0737f9abf10cc8f4a14384603ba261097181611718565b610117805490839055604080518281526020810185905233917f6d8040017e56a6d91bb242def14af5d7eae1eaff7475e45c678dac5d49d35498910160405180910390a2505050565b6000828152606560205260409020600101546109d581611718565b6109df8383611725565b505050565b6001600160a01b0381163314610a625760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084016108e8565b610a6c82826117c7565b5050565b6001610a7b8161184a565b7f4705265620026983c754c5288b65446d794a03174326ec6d7c0b5c7f1fd67415610aa581611718565b856064811115610acb57604051630ec5d10d60e21b8152600481018290526024016108e8565b6000849003610b06576040517f36a4bb9400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610118546000819003610b5257610b1e6001886121ea565b6040519091506002907f6f4cd2683fd248db2513412cb2f25f767694689d6f083941f7437c8fe1f8796490600090a2610b92565b80610b5e6001896121ea565b14610b9257610b6e6001886121ea565b60405163d39e75f960e01b81526004810191909152602481018290526044016108e8565b6000818152610119602052604081205490805b84811015610c2a578b8b82818110610bbf57610bbf6121fd565b905060200201359150600060ff1660b060008481526020019081526020016000205403610c1a57600082815260b06020526040902060019055610c0c838360009182526020526040902090565b9250610c1784612213565b93505b610c2381612213565b9050610ba5565b50878314610c555760405163d39e75f960e01b815260048101899052602481018490526044016108e8565b818714610c98576040517f7557a60a00000000000000000000000000000000000000000000000000000000815260048101889052602481018390526044016108e8565b610118548314610d22576101188390556000838152610119602052604090819020839055517f9995fb3da0c2de4012f2b814b6fc29ce7507571dcb20b8d0bd38621a842df1eb90610cec908d908d9061222c565b60405180910390a1604051829084907f99b65a4301b38c09fb6a5f27052d73e8372bbe8f6779d678bfe8a41b66cce7ac90600090a35b5050505050505050505050565b610d37611878565b858784848760005a9050610d4b60026118d1565b60008e8e8e8e8b8e8e604051602001610d6a97969594939291906122a7565b604051602081830303815290604052805190602001209050610d8b81611925565b8e61011560006101000a8154816001600160a01b0302191690836001600160a01b031602179055506000808f6001600160a01b03168e8d8d604051610dd19291906122f3565b60006040518083038185875af1925050503d8060008114610e0e576040519150601f19603f3d011682016040523d82523d6000602084013e610e13565b606091505b509150915081610e7057805115610e2d5780518082602001fd5b8f6040517f546134430000000000000000000000000000000000000000000000000000000081526004016108e891906001600160a01b0391909116815260200190565b610115805473ffffffffffffffffffffffffffffffffffffffff191663075bcd1517905560405183907fa4c827e719e911e8f19393ccdb85b5102f08f0910604d340ba38390b7ff2ab0e90600090a2505086159050610fb657856000849003610f4257853b158015610f40573a5a610eea61ae3486612303565b610ef491906121ea565b610efe9190612316565b915081881115610f3c576001600160a01b0387166108fc610f1f848b6121ea565b6040518115909202916000818181858888f1935050505050610f40565b8791505b505b60006001600160a01b03841615610f595783610f5b565b335b90506000816001600160a01b03166108fc849081150290604051600060405180830381858888f19350505050905080610fb25760405163295f137d60e21b81526001600160a01b03831660048201526024016108e8565b5050505b505050505050610fc6600160b155565b5050505050505050565b7f1185e52d62bfbbea270e57d3d09733d221b53ab7a18bae82bb3c6c74bab16d82610ffa81611718565b6000806000426099541015611021576097546110169042612303565b609955506001611033565b609a5485101561103357849250600191505b609885905580806110415750815b1561104c57609a8390555b60408051868152831515602082015282151581830152905133917fbc3dc0cb5c15c51c81316450d44048838bb478b9809447d01c766a06f3e9f2c8919081900360600190a25050505050565b6110a260036118d1565b6001600160a01b0384166110c9576040516342bcdf7f60e11b815260040160405180910390fd5b34831115611103576040517fb03b693200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101175480841015611141576040517f732f941300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008061114e83876121ea565b915061115a86346121ea565b6101168054919250600091908261117083612213565b9091555090506111886111838484612303565b611984565b600033898585858b8b6040516020016111a797969594939291906122a7565b60405160208183030381529060405280519060200120905080896001600160a01b0316336001600160a01b03167fe856c2b8bd4eb0027ce32eeaf595c21b0b6b4644b326e5b7bd80a1cf8db72e6c8787878d8d60405161120b95949392919061232d565b60405180910390a4604051600090419087908381818185875af1925050503d8060008114611255576040519150601f19603f3d011682016040523d82523d6000602084013e61125a565b606091505b505090508061127e5760405163295f137d60e21b81524160048201526024016108e8565b50505050505050505050565b7f1185e52d62bfbbea270e57d3d09733d221b53ab7a18bae82bb3c6c74bab16d826112b481611718565b6000609a81905560405133917fba88c025b0cbb77022c0c487beef24f759f1e4be2f51a205bc427cee19c2eaa691a250565b60008281526065602052604090206001015461130181611718565b6109df83836117c7565b7f356a809dfdea9198dd76fb76bf6d403ecf13ea675eb89e1eda2db2c4a4676a2661133581611718565b60a654600160ff84161b161561136357604051636d9236ef60e11b815260ff831660048201526024016108e8565b60a68054600160ff851690811b9091179091557fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d33610928565b600054610100900460ff16158080156113bd5750600054600160ff909116105b806113d75750303b1580156113d7575060005460ff166001145b6114495760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016108e8565b6000805460ff19166001179055801561146c576000805461ff0019166101001790555b6001600160a01b038516611493576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b0384166114ba576040516342bcdf7f60e11b815260040160405180910390fd5b6114c26119fa565b6114ca6119fa565b6114d26119fa565b6114dc8383611a67565b6114e584611bab565b6001610116556114f6600086611725565b6115207fcc6ce8bb749b4b07d2f635ce95747506096d0737f9abf10cc8f4a14384603ba286611725565b61154a7f1185e52d62bfbbea270e57d3d09733d221b53ab7a18bae82bb3c6c74bab16d8286611725565b6115747f356a809dfdea9198dd76fb76bf6d403ecf13ea675eb89e1eda2db2c4a4676a2686611725565b610115805473ffffffffffffffffffffffffffffffffffffffff191663075bcd1517905580156115df576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15b5050505050565b60016115f18161184a565b7f4705265620026983c754c5288b65446d794a03174326ec6d7c0b5c7f1fd6741561161b81611718565b6101185415611656576040517fac1775cf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82606481111561167c57604051630ec5d10d60e21b8152600481018290526024016108e8565b60005b818110156116e657600086868381811061169b5761169b6121fd565b905060200201359050600060ff1660b0600083815260200190815260200160002054036116d557600081815260b060205260409020600190555b506116df81612213565b905061167f565b507f9995fb3da0c2de4012f2b814b6fc29ce7507571dcb20b8d0bd38621a842df1eb85856040516115d692919061222c565b6117228133611c40565b50565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610a6c5760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556117833390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff1615610a6c5760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60a654600160ff83161b161561172257604051636d9236ef60e11b815260ff821660048201526024016108e8565b600260b154036118ca5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108e8565b600260b155565b60a654600160ff83161b81161561190057604051636d9236ef60e11b815260ff831660048201526024016108e8565b6002811615610a6c57604051636d9236ef60e11b8152600160048201526024016108e8565b600081815260b06020526040902054600114611970576040517f992d87c3000000000000000000000000000000000000000000000000000000008152600481018290526024016108e8565b600090815260b06020526040902060029055565b60004260995410156119a75760975461199d9042612303565b60995550806119b8565b81609a546119b59190612303565b90505b6098548111156119f4576040517fa74c1c5f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b609a5550565b600054610100900460ff16611a655760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108e8565b565b600054610100900460ff16611ad25760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108e8565b81600003611b0c576040517fb5ed5a3b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600003611b46576040517fd10d72bb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60978290556098819055611b5a8242612303565b60998190556097546098546040805192835260208301919091528101919091527f8f805c372b66240792580418b7328c0c554ae235f0932475c51b026887fe26a99060600160405180910390a15050565b600054610100900460ff16611c165760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016108e8565b6117227f4705265620026983c754c5288b65446d794a03174326ec6d7c0b5c7f1fd6741582611725565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610a6c57611c7381611cb5565b611c7e836020611cc7565b604051602001611c8f929190612382565b60408051601f198184030181529082905262461bcd60e51b82526108e891600401612403565b60606108766001600160a01b03831660145b60606000611cd6836002612316565b611ce1906002612303565b67ffffffffffffffff811115611cf957611cf9612436565b6040519080825280601f01601f191660200182016040528015611d23576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611d5a57611d5a6121fd565b60200101906001600160f81b031916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611da557611da56121fd565b60200101906001600160f81b031916908160001a9053506000611dc9846002612316565b611dd4906001612303565b90505b6001811115611e59577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110611e1557611e156121fd565b1a60f81b828281518110611e2b57611e2b6121fd565b60200101906001600160f81b031916908160001a90535060049490941c93611e528161244c565b9050611dd7565b508315611ea85760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016108e8565b9392505050565b600060208284031215611ec157600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114611ea857600080fd5b600060208284031215611f0357600080fd5b5035919050565b600060208284031215611f1c57600080fd5b813560ff81168114611ea857600080fd5b6001600160a01b038116811461172257600080fd5b60008060408385031215611f5557600080fd5b823591506020830135611f6781611f2d565b809150509250929050565b60008083601f840112611f8457600080fd5b50813567ffffffffffffffff811115611f9c57600080fd5b6020830191508360208260051b8501011115611fb757600080fd5b9250929050565b600080600080600060808688031215611fd657600080fd5b853567ffffffffffffffff811115611fed57600080fd5b611ff988828901611f72565b9099909850602088013597604081013597506060013595509350505050565b60008083601f84011261202a57600080fd5b50813567ffffffffffffffff81111561204257600080fd5b602083019150836020828501011115611fb757600080fd5b60008060008060008060008060e0898b03121561207657600080fd5b883561208181611f2d565b9750602089013561209181611f2d565b9650604089013595506060890135945060808901356120af81611f2d565b935060a089013567ffffffffffffffff8111156120cb57600080fd5b6120d78b828c01612018565b999c989b50969995989497949560c00135949350505050565b6000806000806060858703121561210657600080fd5b843561211181611f2d565b935060208501359250604085013567ffffffffffffffff81111561213457600080fd5b61214087828801612018565b95989497509550505050565b6000806000806080858703121561216257600080fd5b843561216d81611f2d565b9350602085013561217d81611f2d565b93969395505050506040820135916060013590565b600080602083850312156121a557600080fd5b823567ffffffffffffffff8111156121bc57600080fd5b6121c885828601611f72565b90969095509350505050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610876576108766121d4565b634e487b7160e01b600052603260045260246000fd5b600060018201612225576122256121d4565b5060010190565b6020815281602082015260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111561226557600080fd5b8260051b80856040850137919091016040019392505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006001600160a01b03808a16835280891660208401525086604083015285606083015284608083015260c060a08301526122e660c08301848661227e565b9998505050505050505050565b8183823760009101908152919050565b80820180821115610876576108766121d4565b8082028115828204841417610876576108766121d4565b85815284602082015283604082015260806060820152600061235360808301848661227e565b979650505050505050565b60005b83811015612379578181015183820152602001612361565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516123ba81601785016020880161235e565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516123f781602884016020880161235e565b01602801949350505050565b602081526000825180602084015261242281604085016020870161235e565b601f01601f19169190910160400192915050565b634e487b7160e01b600052604160045260246000fd5b60008161245b5761245b6121d4565b50600019019056fea2646970667358221220ae954f99bf065be167ad739534a69496a26a5d06063088f6fc190b5999d597b164736f6c63430008130033", - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/sdk/src/clients/blockchain/abis/LineaRollup.json b/sdk/src/clients/blockchain/abis/LineaRollup.json deleted file mode 100644 index 0605ba4ad..000000000 --- a/sdk/src/clients/blockchain/abis/LineaRollup.json +++ /dev/null @@ -1,2259 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "LineaRollup", - "sourceName": "contracts/LineaRollup.sol", - "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "BytesLengthNotMultipleOf32", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "bytesLength", - "type": "uint256" - } - ], - "name": "BytesLengthNotMultipleOfTwo", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "currentDataHash", - "type": "bytes32" - } - ], - "name": "DataAlreadySubmitted", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expected", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "actual", - "type": "uint256" - } - ], - "name": "DataEndingBlockDoesNotMatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "value", - "type": "bytes32" - } - ], - "name": "DataHashesNotInSequence", - "type": "error" - }, - { - "inputs": [], - "name": "DataParentHasEmptyShnarf", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expected", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "actual", - "type": "uint256" - } - ], - "name": "DataStartingBlockDoesNotMatch", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyBlobData", - "type": "error" - }, - { - "inputs": [], - "name": "EmptySubmissionData", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - } - ], - "name": "FeePaymentFailed", - "type": "error" - }, - { - "inputs": [], - "name": "FeeTooLow", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "finalBlockNumber", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastFinalizedBlock", - "type": "uint256" - } - ], - "name": "FinalBlockNumberLessThanOrEqualToLastFinalizedBlock", - "type": "error" - }, - { - "inputs": [], - "name": "FinalBlockStateEqualsZeroHash", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "firstHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "secondHash", - "type": "bytes32" - } - ], - "name": "FinalStateRootHashDoesNotMatch", - "type": "error" - }, - { - "inputs": [], - "name": "FinalizationDataMissing", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "l2BlockTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "currentBlockTimestamp", - "type": "uint256" - } - ], - "name": "FinalizationInTheFuture", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "firstBlockNumber", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "finalBlockNumber", - "type": "uint256" - } - ], - "name": "FirstBlockGreaterThanFinalBlock", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "firstBlockNumber", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastFinalizedBlock", - "type": "uint256" - } - ], - "name": "FirstBlockLessThanOrEqualToLastFinalizedBlock", - "type": "error" - }, - { - "inputs": [], - "name": "FirstByteIsNotZero", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidMerkleProof", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidProof", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidProofType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "pauseType", - "type": "uint256" - } - ], - "name": "IsNotPaused", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "pauseType", - "type": "uint256" - } - ], - "name": "IsPaused", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "messageHash", - "type": "bytes32" - } - ], - "name": "L1L2MessageNotSent", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "messageNumber", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "rollingHash", - "type": "bytes32" - } - ], - "name": "L1RollingHashDoesNotExistOnL1", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "merkleRoot", - "type": "bytes32" - } - ], - "name": "L2MerkleRootAlreadyAnchored", - "type": "error" - }, - { - "inputs": [], - "name": "L2MerkleRootDoesNotExist", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "LastFinalizedShnarfWrong", - "type": "error" - }, - { - "inputs": [], - "name": "LimitIsZero", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "messageIndex", - "type": "uint256" - } - ], - "name": "MessageAlreadyClaimed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "messageHash", - "type": "bytes32" - } - ], - "name": "MessageAlreadyReceived", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "messageHash", - "type": "bytes32" - } - ], - "name": "MessageDoesNotExistOrHasAlreadyBeenClaimed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "name": "MessageSendingFailed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "rollingHash", - "type": "bytes32" - } - ], - "name": "MissingMessageNumberForRollingHash", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "messageNumber", - "type": "uint256" - } - ], - "name": "MissingRollingHashForMessageNumber", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "firstHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "secondHash", - "type": "bytes32" - } - ], - "name": "ParentHashesDoesNotMatch", - "type": "error" - }, - { - "inputs": [], - "name": "PeriodIsZero", - "type": "error" - }, - { - "inputs": [], - "name": "PointEvaluationFailed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "fieldElements", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "blsCurveModulus", - "type": "uint256" - } - ], - "name": "PointEvaluationResponseInvalid", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expected", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "actual", - "type": "uint256" - } - ], - "name": "PrecompileReturnDataLengthWrong", - "type": "error" - }, - { - "inputs": [], - "name": "ProofIsEmpty", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "actual", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expected", - "type": "uint256" - } - ], - "name": "ProofLengthDifferentThanMerkleDepth", - "type": "error" - }, - { - "inputs": [], - "name": "RateLimitExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "StartingRootHashDoesNotMatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "StateRootHashInvalid", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expected", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "TimestampsNotInSequence", - "type": "error" - }, - { - "inputs": [], - "name": "ValueSentTooLow", - "type": "error" - }, - { - "inputs": [], - "name": "YPointGreaterThanCurveModulus", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddressNotAllowed", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "resettingAddress", - "type": "address" - } - ], - "name": "AmountUsedInPeriodReset", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "stateRootHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bool", - "name": "finalizedWithProof", - "type": "bool" - } - ], - "name": "BlockFinalized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "lastBlockFinalized", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "startingRootHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "finalRootHash", - "type": "bytes32" - } - ], - "name": "BlocksVerificationDone", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "lastBlockFinalized", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "startingRootHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "finalRootHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bool", - "name": "withProof", - "type": "bool" - } - ], - "name": "DataFinalized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "dataHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "startBlock", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "endBlock", - "type": "uint256" - } - ], - "name": "DataSubmitted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32[]", - "name": "messageHashes", - "type": "bytes32[]" - } - ], - "name": "L1L2MessagesReceivedOnL2", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "messageHash", - "type": "bytes32" - } - ], - "name": "L2L1MessageHashAddedToInbox", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "l2MerkleRoot", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "treeDepth", - "type": "uint256" - } - ], - "name": "L2MerkleRootAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "l2Block", - "type": "uint256" - } - ], - "name": "L2MessagingBlockAnchored", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "amountChangeBy", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bool", - "name": "amountUsedLoweredToLimit", - "type": "bool" - }, - { - "indexed": false, - "internalType": "bool", - "name": "usedAmountResetToZero", - "type": "bool" - } - ], - "name": "LimitAmountChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "_messageHash", - "type": "bytes32" - } - ], - "name": "MessageClaimed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "_from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "_to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "_fee", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "_value", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "_nonce", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "_calldata", - "type": "bytes" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "_messageHash", - "type": "bytes32" - } - ], - "name": "MessageSent", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "messageSender", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "pauseType", - "type": "uint256" - } - ], - "name": "Paused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "periodInSeconds", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "limitInWei", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "currentPeriodEnd", - "type": "uint256" - } - ], - "name": "RateLimitInitialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "messageNumber", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "rollingHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "messageHash", - "type": "bytes32" - } - ], - "name": "RollingHashUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "systemMigrationBlock", - "type": "uint256" - } - ], - "name": "SystemMigrationBlockInitialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "messageSender", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "pauseType", - "type": "uint256" - } - ], - "name": "UnPaused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "verifierAddress", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "proofType", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "verifierSetBy", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "oldVerifierAddress", - "type": "address" - } - ], - "name": "VerifierAddressChanged", - "type": "event" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "GENERAL_PAUSE_TYPE", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "GENESIS_SHNARF", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "INBOX_STATUS_RECEIVED", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "INBOX_STATUS_UNKNOWN", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "L1_L2_PAUSE_TYPE", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "L2_L1_PAUSE_TYPE", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "OPERATOR_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "OUTBOX_STATUS_RECEIVED", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "OUTBOX_STATUS_SENT", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "OUTBOX_STATUS_UNKNOWN", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "PAUSE_MANAGER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "PROVING_SYSTEM_PAUSE_TYPE", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "RATE_LIMIT_SETTER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "VERIFIER_SETTER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_from", - "type": "address" - }, - { - "internalType": "address", - "name": "_to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_fee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_value", - "type": "uint256" - }, - { - "internalType": "address payable", - "name": "_feeRecipient", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_calldata", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "_nonce", - "type": "uint256" - } - ], - "name": "claimMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bytes32[]", - "name": "proof", - "type": "bytes32[]" - }, - { - "internalType": "uint256", - "name": "messageNumber", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "leafIndex", - "type": "uint32" - }, - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "fee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "address payable", - "name": "feeRecipient", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "merkleRoot", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "internalType": "struct IL1MessageService.ClaimMessageWithProofParams", - "name": "_params", - "type": "tuple" - } - ], - "name": "claimMessageWithProof", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "currentFinalizedShnarf", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "currentL2BlockNumber", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "currentL2StoredL1MessageNumber", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "currentL2StoredL1RollingHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "currentPeriodAmountInWei", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "currentPeriodEnd", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "currentTimestamp", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "dataHash", - "type": "bytes32" - } - ], - "name": "dataEndingBlock", - "outputs": [ - { - "internalType": "uint256", - "name": "endingBlock", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "dataHash", - "type": "bytes32" - } - ], - "name": "dataFinalStateRootHashes", - "outputs": [ - { - "internalType": "bytes32", - "name": "finalStateRootHash", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "dataHash", - "type": "bytes32" - } - ], - "name": "dataParents", - "outputs": [ - { - "internalType": "bytes32", - "name": "parentHash", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "dataHash", - "type": "bytes32" - } - ], - "name": "dataShnarfHashes", - "outputs": [ - { - "internalType": "bytes32", - "name": "shnarfHash", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "dataHash", - "type": "bytes32" - } - ], - "name": "dataStartingBlock", - "outputs": [ - { - "internalType": "uint256", - "name": "startingBlock", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "_aggregatedProof", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "_proofType", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "parentStateRootHash", - "type": "bytes32" - }, - { - "internalType": "bytes32[]", - "name": "dataHashes", - "type": "bytes32[]" - }, - { - "internalType": "bytes32", - "name": "dataParentHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "finalBlockNumber", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastFinalizedTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "finalTimestamp", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "l1RollingHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "l1RollingHashMessageNumber", - "type": "uint256" - }, - { - "internalType": "bytes32[]", - "name": "l2MerkleRoots", - "type": "bytes32[]" - }, - { - "internalType": "uint256", - "name": "l2MerkleTreesDepth", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "l2MessagingBlocksOffsets", - "type": "bytes" - } - ], - "internalType": "struct ILineaRollup.FinalizationData", - "name": "_finalizationData", - "type": "tuple" - } - ], - "name": "finalizeCompressedBlocksWithProof", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "parentStateRootHash", - "type": "bytes32" - }, - { - "internalType": "bytes32[]", - "name": "dataHashes", - "type": "bytes32[]" - }, - { - "internalType": "bytes32", - "name": "dataParentHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "finalBlockNumber", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastFinalizedTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "finalTimestamp", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "l1RollingHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "l1RollingHashMessageNumber", - "type": "uint256" - }, - { - "internalType": "bytes32[]", - "name": "l2MerkleRoots", - "type": "bytes32[]" - }, - { - "internalType": "uint256", - "name": "l2MerkleTreesDepth", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "l2MessagingBlocksOffsets", - "type": "bytes" - } - ], - "internalType": "struct ILineaRollup.FinalizationData", - "name": "_finalizationData", - "type": "tuple" - } - ], - "name": "finalizeCompressedBlocksWithoutProof", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "messageHash", - "type": "bytes32" - } - ], - "name": "inboxL2L1MessageStatus", - "outputs": [ - { - "internalType": "uint256", - "name": "messageStatus", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_initialStateRootHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_initialL2BlockNumber", - "type": "uint256" - }, - { - "internalType": "address", - "name": "_defaultVerifier", - "type": "address" - }, - { - "internalType": "address", - "name": "_securityCouncil", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_operators", - "type": "address[]" - }, - { - "internalType": "uint256", - "name": "_rateLimitPeriodInSeconds", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_rateLimitAmountInWei", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_genesisTimestamp", - "type": "uint256" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_lastFinalizedShnarf", - "type": "bytes32" - } - ], - "name": "initializeLastFinalizedShnarf", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_messageNumber", - "type": "uint256" - } - ], - "name": "isMessageClaimed", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "_pauseType", - "type": "uint8" - } - ], - "name": "isPaused", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "merkleRoot", - "type": "bytes32" - } - ], - "name": "l2MerkleRootsDepths", - "outputs": [ - { - "internalType": "uint256", - "name": "treeDepth", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "limitInWei", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "nextMessageNumber", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "messageHash", - "type": "bytes32" - } - ], - "name": "outboxL1L2MessageStatus", - "outputs": [ - { - "internalType": "uint256", - "name": "messageStatus", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "_pauseType", - "type": "uint8" - } - ], - "name": "pauseByType", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "pauseType", - "type": "bytes32" - } - ], - "name": "pauseTypeStatuses", - "outputs": [ - { - "internalType": "bool", - "name": "pauseStatus", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "periodInSeconds", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "resetAmountUsedInPeriod", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "resetRateLimitAmount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "messageNumber", - "type": "uint256" - } - ], - "name": "rollingHashes", - "outputs": [ - { - "internalType": "bytes32", - "name": "rollingHash", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_fee", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_calldata", - "type": "bytes" - } - ], - "name": "sendMessage", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "sender", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_newVerifierAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_proofType", - "type": "uint256" - } - ], - "name": "setVerifierAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" - } - ], - "name": "stateRootHashes", - "outputs": [ - { - "internalType": "bytes32", - "name": "stateRootHash", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "parentStateRootHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "dataParentHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "finalStateRootHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "firstBlockInData", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "finalBlockInData", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "snarkHash", - "type": "bytes32" - } - ], - "internalType": "struct ILineaRollup.SupportingSubmissionData", - "name": "_submissionData", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "_dataEvaluationClaim", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_kzgCommitment", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "_kzgProof", - "type": "bytes" - } - ], - "name": "submitBlobData", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "parentStateRootHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "dataParentHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "finalStateRootHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "firstBlockInData", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "finalBlockInData", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "snarkHash", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "compressedData", - "type": "bytes" - } - ], - "internalType": "struct ILineaRollup.SubmissionData", - "name": "_submissionData", - "type": "tuple" - } - ], - "name": "submitData", - "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": [], - "name": "systemMigrationBlock", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "_pauseType", - "type": "uint8" - } - ], - "name": "unPauseByType", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "proofType", - "type": "uint256" - } - ], - "name": "verifiers", - "outputs": [ - { - "internalType": "address", - "name": "verifierAddress", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "bytecode": "0x608060405234801562000010575f80fd5b506200001b62000021565b620000df565b5f54610100900460ff16156200008d5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b5f5460ff90811614620000dd575f805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b614e6780620000ed5f395ff3fe608060405260043610610392575f3560e01c806373bd07b7116101de578063b837dbe911610108578063d547741f1161009d578063e196fb5d1161006d578063e196fb5d14610adf578063e97a1e9e14610afe578063f5b541a614610b31578063f9f4828414610b64575f80fd5b8063d547741f14610a58578063d5d4b83514610a77578063d630280f14610a8d578063d84f91e814610aac575f80fd5b8063c1dc0f07116100d8578063c1dc0f07146109e0578063c2116974146109f5578063cc5782f614610a14578063cd9b9e9a14610a42575f80fd5b8063b837dbe914610955578063bc61e7331461096a578063bf3e750514610998578063c0729ab1146109cb575f80fd5b80639ee8b2111161017e578063ac1eff681161014e578063ac1eff68146108d6578063ad422ff014610918578063aea4f7451461092d578063b4a5a4b714610941575f80fd5b80639ee8b2111461087d5780639f3ce55a1461089c578063a217fddf146108af578063abd6230d146108c2575f80fd5b80638be745d1116101b95780638be745d1146107d4578063914e57eb1461080057806391d148541461082c578063986fcddd146107c1575f80fd5b806373bd07b71461040f5780637a776315146107a25780637d1e8c55146107c1575f80fd5b80634cdd389b116102bf5780636078bfd81161025f57806367e404ce1161022f57806367e404ce1461070e578063695378f5146107595780636a637967146105625780636e6738431461076f575f80fd5b80636078bfd81461066b57806360e83cf3146106975780636463fb2a146106c357806366f96e98146106e2575f80fd5b8063587944561161029a57806358794456146105ff5780635b7eb4bd146105625780635c721a0c146106145780635ed73ceb1461063f575f80fd5b80634cdd389b146105955780635355420e146105c1578063557eac73146105e0575f80fd5b80632c70645c1161033557806336568abe1161030557806336568abe146105185780633fc08b651461053757806348922ab714610562578063491e093614610576575f80fd5b80632c70645c146104a55780632d3c12e5146104bb5780632f2ff15d146104da5780633631b669146104f9575f80fd5b806311314d0f1161037057806311314d0f1461040f5780631e2ff94f146104355780631f443da01461044b578063248a9ca314610477575f80fd5b806301ffc9a71461039657806305861180146103ca5780631065a399146103ee575b5f80fd5b3480156103a1575f80fd5b506103b56103b0366004614389565b610b83565b60405190151581526020015b60405180910390f35b3480156103d5575f80fd5b506103e06101bb5481565b6040519081526020016103c1565b3480156103f9575f80fd5b5061040d6104083660046143c8565b610c1b565b005b34801561041a575f80fd5b50610423600281565b60405160ff90911681526020016103c1565b348015610440575f80fd5b506103e06101185481565b348015610456575f80fd5b506103e06104653660046143e8565b6101b96020525f908152604090205481565b348015610482575f80fd5b506103e06104913660046143e8565b5f9081526065602052604090206001015490565b3480156104b0575f80fd5b506103e06101835481565b3480156104c6575f80fd5b5061040d6104d5366004614444565b610cf3565b3480156104e5575f80fd5b5061040d6104f43660046144f2565b610e35565b348015610504575f80fd5b5061040d6105133660046143e8565b610e5e565b348015610523575f80fd5b5061040d6105323660046144f2565b610f9d565b348015610542575f80fd5b506103e06105513660046143e8565b60a56020525f908152604090205481565b34801561056d575f80fd5b50610423600181565b348015610581575f80fd5b5061040d610590366004614520565b611050565b3480156105a0575f80fd5b506103e06105af3660046143e8565b6101b76020525f908152604090205481565b3480156105cc575f80fd5b5061040d6105db3660046145b0565b611380565b3480156105eb575f80fd5b5061040d6105fa3660046143e8565b61176c565b34801561060a575f80fd5b506103e060995481565b34801561061f575f80fd5b506103e061062e3660046143e8565b60a66020525f908152604090205481565b34801561064a575f80fd5b506103e06106593660046143e8565b6101ba6020525f908152604090205481565b348015610676575f80fd5b506103e06106853660046143e8565b6101b66020525f908152604090205481565b3480156106a2575f80fd5b506103e06106b13660046143e8565b6101506020525f908152604090205481565b3480156106ce575f80fd5b5061040d6106dd36600461466f565b611832565b3480156106ed575f80fd5b506103e06106fc3660046143e8565b6101b86020525f908152604090205481565b348015610719575f80fd5b5060e55473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016103c1565b348015610764575f80fd5b506103e06101195481565b34801561077a575f80fd5b506103e07f32937fd5162e282df7e9a14a5073a2425321c7966eaf70ed6c838a1006d84c4c81565b3480156107ad575f80fd5b5061040d6107bc3660046146a7565b611d2e565b3480156107cc575f80fd5b506104235f81565b3480156107df575f80fd5b506103e06107ee3660046143e8565b61011a6020525f908152604090205481565b34801561080b575f80fd5b506103e061081a3660046143e8565b61014e6020525f908152604090205481565b348015610837575f80fd5b506103b56108463660046144f2565b5f91825260656020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b348015610888575f80fd5b506103b56108973660046143e8565b611e80565b61040d6108aa3660046146de565b611ea3565b3480156108ba575f80fd5b506103e05f81565b3480156108cd575f80fd5b50610423600381565b3480156108e1575f80fd5b506107346108f03660046143e8565b61011b6020525f908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b348015610923575f80fd5b506103e060985481565b348015610938575f80fd5b5061040d612010565b34801561094c575f80fd5b50610423600481565b348015610960575f80fd5b506103e060e45481565b348015610975575f80fd5b506103b56109843660046143c8565b60da54600160ff9092169190911b16151590565b3480156109a3575f80fd5b506103e07f1185e52d62bfbbea270e57d3d09733d221b53ab7a18bae82bb3c6c74bab16d8281565b3480156109d6575f80fd5b506103e0609a5481565b3480156109eb575f80fd5b506103e060975481565b348015610a00575f80fd5b5061040d610a0f366004614736565b61206b565b348015610a1f575f80fd5b506103b5610a2e3660046143e8565b60d96020525f908152604090205460ff1681565b348015610a4d575f80fd5b506103e06101bd5481565b348015610a63575f80fd5b5061040d610a723660046144f2565b612198565b348015610a82575f80fd5b506103e06101bc5481565b348015610a98575f80fd5b5061040d610aa7366004614777565b6121bc565b348015610ab7575f80fd5b506103e07f356a809dfdea9198dd76fb76bf6d403ecf13ea675eb89e1eda2db2c4a4676a2681565b348015610aea575f80fd5b5061040d610af93660046143c8565b6124b5565b348015610b09575f80fd5b506103e07f4f64fe1ce613546d34d666d8258c13c6296820fd13114d784203feb91276e83881565b348015610b3c575f80fd5b506103e07f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92981565b348015610b6f575f80fd5b5061040d610b7e3660046147e5565b612560565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b000000000000000000000000000000000000000000000000000000001480610c1557507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b7f356a809dfdea9198dd76fb76bf6d403ecf13ea675eb89e1eda2db2c4a4676a26610c458161258b565b60da54600160ff84161b16610c90576040517fb015579f00000000000000000000000000000000000000000000000000000000815260ff831660048201526024015b60405180910390fd5b60da8054600160ff851690811b199091169091557fef04ba2036ccaeab3a59717b51d2b9146b0b0904077177f1148a5418bf1eae23335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a25050565b6004610cfe81612595565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929610d288161258b565b5f4980610d61576040517fa0feae8d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff000000018810610dba576040517f32bdd92500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160a08b013560208083019190915281830184905282518083038401815260609092019092528051910120610e00610dfa368c90038c018c61484c565b8361261b565b610e0f82828b8b8b8b8b612856565b610e29818a84610e24368f90038f018f61484c565b612a27565b50505050505050505050565b5f82815260656020526040902060010154610e4f8161258b565b610e598383612b5d565b505050565b5f54600390610100900460ff16158015610e7e57505f5460ff8083169116105b610f0a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610c87565b5f80546101bd8490557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001660ff8316908117610100177fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b73ffffffffffffffffffffffffffffffffffffffff81163314611042576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610c87565b61104c8282612c4f565b5050565b611058612d08565b85878484875f5a905061106b6003612595565b5f8e8e8e8e8b8e8e6040516020016110899796959493929190614930565b6040516020818303038152906040528051906020012090506110aa81612d7b565b6110bc6110b78d8f6149b5565b612dd5565b8e60e55f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505f808f73ffffffffffffffffffffffffffffffffffffffff168e8d8d6040516111269291906149c8565b5f6040518083038185875af1925050503d805f8114611160576040519150601f19603f3d011682016040523d82523d5f602084013e611165565b606091505b5091509150816111cf5780511561117f5780518082602001fd5b8f6040517f54613443000000000000000000000000000000000000000000000000000000008152600401610c87919073ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b60e580547fffffffffffffffffffffffff00000000000000000000000000000000000000001663075bcd1517905560405183907fa4c827e719e911e8f19393ccdb85b5102f08f0910604d340ba38390b7ff2ab0e905f90a250508615905061136657855f8490036112b557853b1580156112b3573a5a61125161bc7c866149b5565b61125b91906149d7565b61126591906149ea565b9150818811156112af5773ffffffffffffffffffffffffffffffffffffffff87166108fc611293848b6149d7565b6040518115909202915f818181858888f19350505050506112b3565b8791505b505b5f73ffffffffffffffffffffffffffffffffffffffff8416156112d857836112da565b335b90505f8173ffffffffffffffffffffffffffffffffffffffff166108fc8490811502906040515f60405180830381858888f19350505050905080611362576040517fa57c4df400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83166004820152602401610c87565b5050505b505050505050611376600160a755565b5050505050505050565b5f54610100900460ff161580801561139e57505f54600160ff909116105b806113b75750303b1580156113b757505f5460ff166001145b611443576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610c87565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561149f575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b73ffffffffffffffffffffffffffffffffffffffff88166114ec576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b858110156115c3575f87878381811061150957611509614a01565b905060200201602081019061151e9190614a2e565b73ffffffffffffffffffffffffffffffffffffffff160361156b576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6115bb7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9298888848181106115a1576115a1614a01565b90506020020160208101906115b69190614a2e565b612b5d565b6001016114ee565b506115ce5f88612b5d565b6115f87f32937fd5162e282df7e9a14a5073a2425321c7966eaf70ed6c838a1006d84c4c88612b5d565b611600612e51565b61160c87888686612ef1565b7f033d11f27e62ab919708ec716731da80d261a6e4253259b7acde9bf89d28ec1880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8a161790556101198990555f89815261011a6020908152604082208c90559080527f731f3ee9e6d4d973a9db2cd906af646e8361f7be89e984c5d3f716864957e9368b90556101b890527f4f64fe1ce613546d34d666d8258c13c6296820fd13114d784203feb91276e8387fcad30177c4c23bf7ff6cfa6d7eed724357d58710018c138bfe23278ca5288b4e8190556101bd556101188290558015610e29575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050505050505050565b7f1185e52d62bfbbea270e57d3d09733d221b53ab7a18bae82bb3c6c74bab16d826117968161258b565b5f805f4260995410156117bb576097546117b090426149b5565b6099555060016117cd565b609a548510156117cd57849250600191505b609885905580806117db5750815b156117e657609a8390555b60408051868152831515602082015282151581830152905133917fbc3dc0cb5c15c51c81316450d44048838bb478b9809447d01c766a06f3e9f2c8919081900360600190a25050505050565b61183a612d08565b60a0810180359061184e9060808401614a2e565b61185c610120840184614a49565b61186d610100860160e08701614a2e565b5f5a905061187b6003612595565b6101008701355f9081526101506020526040812054908190036118ca576040517f4e68667500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118d48880614aaa565b9050811461192357806118e78980614aaa565b6040517f5e3fd6ad0000000000000000000000000000000000000000000000000000000081526004810193909352602483015250604401610c87565b61193088602001356130d0565b6119456110b760c08a013560a08b01356149b5565b5f61195660808a0160608b01614a2e565b61196660a08b0160808c01614a2e565b60a08b013560c08c013560208d01356119836101208f018f614a49565b6040516020016119999796959493929190614930565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052805160209091012090506119fa816119df8b80614aaa565b6119ef60608e0160408f01614b0e565b8d6101000135613148565b611a30576040517fb05e92fa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611a4060808a0160608b01614a2e565b60e580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff929092169190911790555f80611a9760a08c0160808d01614a2e565b73ffffffffffffffffffffffffffffffffffffffff1660c08c0135611ac06101208e018e614a49565b604051611ace9291906149c8565b5f6040518083038185875af1925050503d805f8114611b08576040519150601f19603f3d011682016040523d82523d5f602084013e611b0d565b606091505b509150915081611b8257805115611b275780518082602001fd5b611b3760a08c0160808d01614a2e565b6040517f5461344300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610c87565b60e580547fffffffffffffffffffffffff00000000000000000000000000000000000000001663075bcd1517905560405183907fa4c827e719e911e8f19393ccdb85b5102f08f0910604d340ba38390b7ff2ab0e905f90a2505050505f861115611d1b57855f849003611c6a57853b158015611c68573a5a611c0661bc7c866149b5565b611c1091906149d7565b611c1a91906149ea565b915081881115611c645773ffffffffffffffffffffffffffffffffffffffff87166108fc611c48848b6149d7565b6040518115909202915f818181858888f1935050505050611c68565b8791505b505b5f73ffffffffffffffffffffffffffffffffffffffff841615611c8d5783611c8f565b335b90505f8173ffffffffffffffffffffffffffffffffffffffff166108fc8490811502906040515f60405180830381858888f19350505050905080611d17576040517fa57c4df400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83166004820152602401610c87565b5050505b505050505050611d2b600160a755565b50565b6004611d3981612595565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929611d638161258b565b611d7060c0840184614a49565b90505f03611daa576040517fc01eab5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6040518060c00160405280855f01358152602001856020013581526020018560400135815260200185606001358152602001856080013581526020018560a0013581525090505f848060c00190611e029190614a49565b604051611e109291906149c8565b60405180910390209050611e24828261261b565b6040805160a0870135602080830191909152818301849052825180830384018152606090920190925280519101205f611e69611e6360c0890189614a49565b846131dc565b9050611e7782828587612a27565b50505050505050565b600881901c5f90815261014f6020526040812054600160ff84161b161515610c15565b6002611eae81612595565b73ffffffffffffffffffffffffffffffffffffffff8516611efb576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b34841115611f35576040517fb03b693200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60e480545f9182611f4583614b31565b9091555090505f611f5686346149d7565b90505f33888884868a8a604051602001611f769796959493929190614930565b604051602081830303815290604052805190602001209050611f9883826132dd565b808873ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe856c2b8bd4eb0027ce32eeaf595c21b0b6b4644b326e5b7bd80a1cf8db72e6c8a86888c8c604051611ffe959493929190614b68565b60405180910390a45050505050505050565b7f1185e52d62bfbbea270e57d3d09733d221b53ab7a18bae82bb3c6c74bab16d8261203a8161258b565b5f609a81905560405133917fba88c025b0cbb77022c0c487beef24f759f1e4be2f51a205bc427cee19c2eaa691a250565b7f32937fd5162e282df7e9a14a5073a2425321c7966eaf70ed6c838a1006d84c4c6120958161258b565b73ffffffffffffffffffffffffffffffffffffffff83166120e2576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f82815261011b602090815260409182902054915173ffffffffffffffffffffffffffffffffffffffff928316815233928592908716917f4a29db3fc6b42bda201e4b4d69ce8d575eeeba5f153509c0d0a342af0f1bd021910160405180910390a4505f90815261011b6020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b5f828152606560205260409020600101546121b28161258b565b610e598383612c4f565b60046121c781612595565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9296121f18161258b565b5f85900361222b576040517f7907d79b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610119545f81815261011a6020526040902054843514612277576040517fead4c30e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101bd546040808601355f9081526101b86020522054146122e4576101bd546040858101355f9081526101b86020528190205490517f2f22b98a00000000000000000000000000000000000000000000000000000000815260048101929092526024820152604401610c87565b6101bb546101bc545f6122f987856001613359565b60408051602081018390528935918101919091526080808a013560608381019190915260a0808c01359284019290925290820187905289013560c08201529091505f9060e001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190528360c08a01358660e08c01356101208d013561238d6101008f018f614aaa565b60405160200161239e929190614b98565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120908301979097528101949094526060840192909252608083015260a082015260c081019190915260e001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261243a9291602001614bfa565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101207f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001900690506124a8818a8d8d8c3560608e013561396a565b5050505050505050505050565b7f356a809dfdea9198dd76fb76bf6d403ecf13ea675eb89e1eda2db2c4a4676a266124df8161258b565b60da54600160ff84161b1615612526576040517fdb246dde00000000000000000000000000000000000000000000000000000000815260ff83166004820152602401610c87565b60da8054600160ff851690811b9091179091557fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d33610cc7565b600161256b81613b2e565b5f6125758161258b565b6101195461258484825f613359565b5050505050565b611d2b8133613b75565b60da54600160ff83161b8116156125dd576040517fdb246dde00000000000000000000000000000000000000000000000000000000815260ff83166004820152602401610c87565b600281161561104c576040517fdb246dde00000000000000000000000000000000000000000000000000000000815260016004820152602401610c87565b6040820151612656576040517f2898482a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602080830180515f9081526101b6835260408082205461011954935183526101ba909452902054826126c15784516040517fd5aa5ad6000000000000000000000000000000000000000000000000000000008152610c87918591600401918252602082015260400190565b5f6126cd8260016149b5565b90508560600151811461271c5760608601516040517fabefa5e8000000000000000000000000000000000000000000000000000000008152610c87918391600401918252602082015260400190565b828660600151116127695760608601516040517fa386ed70000000000000000000000000000000000000000000000000000000008152600481019190915260248101849052604401610c87565b8560800151866060015111156127be57606086015160808701516040517fcbbd795300000000000000000000000000000000000000000000000000000000815260048101929092526024820152604401610c87565b855184146128055785516040517fd5aa5ad6000000000000000000000000000000000000000000000000000000008152610c87918691600401918252602082015260400190565b5f8581526101b660205260409020541561284e576040517f0f06cd1500000000000000000000000000000000000000000000000000000000815260048101869052602401610c87565b505050505050565b7f73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001860695505f80600a73ffffffffffffffffffffffffffffffffffffffff16898989898989896040516020016128b29796959493929190614c28565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290526128ea91614c64565b5f60405180830381855afa9150503d805f8114612922576040519150601f19603f3d011682016040523d82523d5f602084013e612927565b606091505b509150915081612963576040517fa71194af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408151146129ab578051604080517ff75db381000000000000000000000000000000000000000000000000000000008152610c879290600401918252602082015260400190565b60208101516040820151611000821415806129e657507f73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff000000018114155b156124a8576040517f68dcad5f0000000000000000000000000000000000000000000000000000000081526004810183905260248101829052604401610c87565b6020808201515f9081526101b8909152604090205480612a73576040517f5548c6b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60a0808301516040808501518151602081018690529182019290925260608101919091526080810187905290810185905260c001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120858201515f8881526101b7845284812091909155868401516101b68452848220556060870180516101b98552858320556080880180516101ba8652868420556101b890945293812082905591519251909450919286917f174b4a2e83ebebaf6824e559d2bab7b7e229c80d211e98298a1224970b719a4291a45050505050565b5f82815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1661104c575f82815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055612bf13390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b5f82815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff161561104c575f82815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600260a75403612d74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c87565b600260a755565b5f81815260a66020526040902054600114612dc5576040517f992d87c300000000000000000000000000000000000000000000000000000000815260048101829052602401610c87565b5f90815260a66020526040812055565b5f426099541015612df757609754612ded90426149b5565b6099555080612e08565b81609a54612e0591906149b5565b90505b609854811115612e44576040517fa74c1c5f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b609a5550565b600160a755565b5f54610100900460ff16612ee7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610c87565b612eef613c2e565b565b5f54610100900460ff16612f87576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610c87565b73ffffffffffffffffffffffffffffffffffffffff8416612fd4576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8316613021576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b613029613cc4565b613031613cc4565b613039613cc4565b6130438282613d5a565b61306d7f1185e52d62bfbbea270e57d3d09733d221b53ab7a18bae82bb3c6c74bab16d8285612b5d565b6130977f356a809dfdea9198dd76fb76bf6d403ecf13ea675eb89e1eda2db2c4a4676a2684612b5d565b5050600160e455505060e580547fffffffffffffffffffffffff00000000000000000000000000000000000000001663075bcd15179055565b600881901c5f90815261014f6020526040902054600160ff83161b1615613126576040517f335a4a9000000000000000000000000000000000000000000000000000000000815260048101829052602401610c87565b600881901c5f90815261014f602052604090208054600160ff84161b17905550565b5f85815b858110156131cf57600163ffffffff8616821c811690036131995761319287878381811061317c5761317c614a01565b90506020020135835f9182526020526040902090565b91506131c7565b6131c4828888848181106131af576131af614a01565b905060200201355f9182526020526040902090565b91505b60010161314c565b5090911495945050505050565b5f6131e8602084614c7f565b1561321f576040517f6426c6c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f729eebce00000000000000000000000000000000000000000000000000000000835b80156132d457602081039050808601357fff0000000000000000000000000000000000000000000000000000000000000081161561328557604051838152600481fd5b7f73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001817f73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff0000000187870908935050613242565b50509392505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82015f90815261014e60208181526040808420548452848252808420868552929091528083208290555190918391839186917fea3b023b4c8680d4b4824f0143132c95476359a2bb70a81d6c5a36f6918f63399190a4505050565b5f806133686020860186614aaa565b90509050805f036133a5576040517fdcb2388500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b838560600135116133ef576040517f706144050000000000000000000000000000000000000000000000000000000081526060860135600482015260248101859052604401610c87565b6134018560e001358660c00135613ec0565b8460800135610118541461345357610118546040517f3211d9be000000000000000000000000000000000000000000000000000000008152600481019190915260808601356024820152604401610c87565b428560a001351061349c576040517fbf81c6e000000000000000000000000000000000000000000000000000000000815260a08601356004820152426024820152604401610c87565b5f6101b7816134ae6020890189614aaa565b5f8181106134be576134be614a01565b9050602002013581526020019081526020015f205490508560400135811461351f57604080517f9a89a75800000000000000000000000000000000000000000000000000000000815260048101839052908701356024820152604401610c87565b5f8181526101b6602052604090205486358114613572576040517fe1cb6e600000000000000000000000000000000000000000000000000000000081526004810182905287356024820152604401610c87565b5f6101b68161358460208b018b614aaa565b61358f6001896149d7565b81811061359e5761359e614a01565b9050602002013581526020019081526020015f205490505f801b81036135f0576040517f2898482a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101b85f61360160208b018b614aaa565b600161361060208e018e614aaa565b90500381811061362257613622614a01565b9050602002013581526020019081526020015f205494505f801b8503613674576040517f5548c6b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6136906136856101008a018a614aaa565b8a6101200135613f8d565b6136a76136a16101408a018a614a49565b89614099565b60015b848110156137bc576136bf60208a018a614aaa565b600183038181106136d2576136d2614a01565b905060200201356101b75f8b80602001906136ed9190614aaa565b858181106136fd576136fd614a01565b9050602002013581526020019081526020015f2054146137b45761372460208a018a614aaa565b6001830381811061373757613737614a01565b905060200201356101b75f8b80602001906137529190614aaa565b8581811061376257613762614a01565b9050602002013581526020019081526020015f20546040517f710cd580000000000000000000000000000000000000000000000000000000008152600401610c87929190918252602082015260400190565b6001016136aa565b505f6101b9816137cf60208c018c614aaa565b5f8181106137df576137df614a01565b9050602002013581526020019081526020015f205490505f6101ba5f8b806020019061380b9190614aaa565b61381660018b6149d7565b81811061382557613825614a01565b9050602002013581526020019081526020015f2054905089606001358114613886576040517f9f6adc690000000000000000000000000000000000000000000000000000000081526004810182905260608b01356024820152604401610c87565b6138918960016149b5565b82146138df576138a28960016149b5565b6040517fabefa5e8000000000000000000000000000000000000000000000000000000008152600481019190915260248101839052604401610c87565b60608a01355f81815261011a6020526040908190208590556101bd89905560a08c01356101185561011982905560e08c01356101bb5560c08c01356101bc555184918c35917f1335f1a2b3ff25f07f5fef07dd35d8fb4312c3c73b138e2fad9347b3319ab53c90613955908d1515815260200190565b60405180910390a45050505050509392505050565b6040805160018082528183019092525f916020808301908036833701905050905086815f8151811061399e5761399e614a01565b6020908102919091018101919091525f87815261011b909152604090205473ffffffffffffffffffffffffffffffffffffffff1680613a09576040517f69ed70ab00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f7e4f7a8a0000000000000000000000000000000000000000000000000000000081525f9073ffffffffffffffffffffffffffffffffffffffff831690637e4f7a8a90613a61908a908a908890600401614cb7565b6020604051808303815f875af1158015613a7d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613aa19190614d0e565b905080613ada576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f84815261011a60209081526040918290205482518881529182015285917f5c885a794662ebe3b08ae0874fc2c88b5343b0223ba9cd2cad92b69c0d0c901f910160405180910390a2505050505050505050565b60da54600160ff83161b1615611d2b576040517fdb246dde00000000000000000000000000000000000000000000000000000000815260ff82166004820152602401610c87565b5f82815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1661104c57613bb481614126565b613bbf836020614145565b604051602001613bd0929190614d2d565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a0000000000000000000000000000000000000000000000000000000008252610c8791600401614dad565b5f54610100900460ff16612e4a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610c87565b5f54610100900460ff16612eef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610c87565b5f54610100900460ff16613df0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610c87565b815f03613e29576040517fb5ed5a3b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805f03613e62576040517fd10d72bb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60978290556098819055613e7682426149b5565b60998190556097546098546040805192835260208301919091528101919091527f8f805c372b66240792580418b7328c0c554ae235f0932475c51b026887fe26a990606001610f91565b815f03613f0257801561104c576040517f0c25659200000000000000000000000000000000000000000000000000000000815260048101829052602401610c87565b80613f3c576040517f5228f4c800000000000000000000000000000000000000000000000000000000815260048101839052602401610c87565b5f82815261014e6020526040902054811461104c576040517f36459fa00000000000000000000000000000000000000000000000000000000081526004810183905260248101829052604401610c87565b5f5b82811015614093576101505f858584818110613fad57613fad614a01565b9050602002013581526020019081526020015f20545f1461401657838382818110613fda57613fda614a01565b905060200201356040517fe5d14425000000000000000000000000000000000000000000000000000000008152600401610c8791815260200190565b816101505f86868581811061402d5761402d614a01565b9050602002013581526020019081526020015f20819055508184848381811061405857614058614a01565b905060200201357f300e6f978eee6a4b0bba78dd8400dc64fd5652dbfc868a2258e16d0977be222b60405160405180910390a3600101613f8f565b50505050565b6140a4600283614c7f565b156140de576040517f0c91d77600000000000000000000000000000000000000000000000000000000815260048101839052602401610c87565b5f805b83811015612584576040518582013560f01c9250838301907f3c116827db9db3a30c1a25db8b0ee4bab9d2b223560209cfd839601b621c726d905f90a26002016140e1565b6060610c1573ffffffffffffffffffffffffffffffffffffffff831660145b60605f6141538360026149ea565b61415e9060026149b5565b67ffffffffffffffff8111156141765761417661481f565b6040519080825280601f01601f1916602001820160405280156141a0576020820181803683370190505b5090507f3000000000000000000000000000000000000000000000000000000000000000815f815181106141d6576141d6614a01565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061423857614238614a01565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053505f6142728460026149ea565b61427d9060016149b5565b90505b6001811115614319577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106142be576142be614a01565b1a60f81b8282815181106142d4576142d4614a01565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a90535060049490941c9361431281614dfd565b9050614280565b508315614382576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c87565b9392505050565b5f60208284031215614399575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114614382575f80fd5b5f602082840312156143d8575f80fd5b813560ff81168114614382575f80fd5b5f602082840312156143f8575f80fd5b5035919050565b5f8083601f84011261440f575f80fd5b50813567ffffffffffffffff811115614426575f80fd5b60208301915083602082850101111561443d575f80fd5b9250929050565b5f805f805f8086880361012081121561445b575f80fd5b60c0811215614468575f80fd5b5086955060c0870135945060e087013567ffffffffffffffff8082111561448d575f80fd5b6144998a838b016143ff565b90965094506101008901359150808211156144b2575f80fd5b506144bf89828a016143ff565b979a9699509497509295939492505050565b73ffffffffffffffffffffffffffffffffffffffff81168114611d2b575f80fd5b5f8060408385031215614503575f80fd5b823591506020830135614515816144d1565b809150509250929050565b5f805f805f805f8060e0898b031215614537575f80fd5b8835614542816144d1565b97506020890135614552816144d1565b965060408901359550606089013594506080890135614570816144d1565b935060a089013567ffffffffffffffff81111561458b575f80fd5b6145978b828c016143ff565b999c989b50969995989497949560c00135949350505050565b5f805f805f805f805f6101008a8c0312156145c9575f80fd5b8935985060208a0135975060408a01356145e2816144d1565b965060608a01356145f2816144d1565b955060808a013567ffffffffffffffff8082111561460e575f80fd5b818c0191508c601f830112614621575f80fd5b81358181111561462f575f80fd5b8d60208260051b8501011115614643575f80fd5b9a9d999c50979a96996020919091019890975060a08701359660c0810135965060e00135945092505050565b5f6020828403121561467f575f80fd5b813567ffffffffffffffff811115614695575f80fd5b82016101408185031215614382575f80fd5b5f602082840312156146b7575f80fd5b813567ffffffffffffffff8111156146cd575f80fd5b820160e08185031215614382575f80fd5b5f805f80606085870312156146f1575f80fd5b84356146fc816144d1565b935060208501359250604085013567ffffffffffffffff81111561471e575f80fd5b61472a878288016143ff565b95989497509550505050565b5f8060408385031215614747575f80fd5b8235614752816144d1565b946020939093013593505050565b5f6101608284031215614771575f80fd5b50919050565b5f805f806060858703121561478a575f80fd5b843567ffffffffffffffff808211156147a1575f80fd5b6147ad888389016143ff565b90965094506020870135935060408701359150808211156147cc575f80fd5b506147d987828801614760565b91505092959194509250565b5f602082840312156147f5575f80fd5b813567ffffffffffffffff81111561480b575f80fd5b61481784828501614760565b949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f60c0828403121561485c575f80fd5b60405160c0810181811067ffffffffffffffff821117156148a4577f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b8060405250823581526020830135602082015260408301356040820152606083013560608201526080830135608082015260a083013560a08201528091505092915050565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b5f73ffffffffffffffffffffffffffffffffffffffff808a16835280891660208401525086604083015285606083015284608083015260c060a083015261497b60c0830184866148e9565b9998505050505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b80820180821115610c1557610c15614988565b818382375f9101908152919050565b81810381811115610c1557610c15614988565b8082028115828204841417610c1557610c15614988565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215614a3e575f80fd5b8135614382816144d1565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112614a7c575f80fd5b83018035915067ffffffffffffffff821115614a96575f80fd5b60200191503681900382131561443d575f80fd5b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112614add575f80fd5b83018035915067ffffffffffffffff821115614af7575f80fd5b6020019150600581901b360382131561443d575f80fd5b5f60208284031215614b1e575f80fd5b813563ffffffff81168114614382575f80fd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614b6157614b61614988565b5060010190565b858152846020820152836040820152608060608201525f614b8d6080830184866148e9565b979650505050505050565b5f7f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115614bc5575f80fd5b8260051b80858437919091019392505050565b5f5b83811015614bf2578181015183820152602001614bda565b50505f910152565b5f8351614c0b818460208801614bd8565b835190830190614c1f818360208801614bd8565b01949350505050565b878152866020820152856040820152838560608301375f848201606081015f815284868237505f93016060019283525090979650505050505050565b5f8251614c75818460208701614bd8565b9190910192915050565b5f82614cb2577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500690565b604081525f614cca6040830185876148e9565b8281036020848101919091528451808352858201928201905f5b81811015614d0057845183529383019391830191600101614ce4565b509098975050505050505050565b5f60208284031215614d1e575f80fd5b81518015158114614382575f80fd5b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081525f8351614d64816017850160208801614bd8565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351614da1816028840160208801614bd8565b01602801949350505050565b602081525f8251806020840152614dcb816040850160208701614bd8565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b5f81614e0b57614e0b614988565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fea26469706673582212205733f8a4ec3487fd65dac516249287485e7f1bf9b1d1b71a9ad60a819dcc1f2d64736f6c63430008180033", - "deployedBytecode": "0x608060405260043610610392575f3560e01c806373bd07b7116101de578063b837dbe911610108578063d547741f1161009d578063e196fb5d1161006d578063e196fb5d14610adf578063e97a1e9e14610afe578063f5b541a614610b31578063f9f4828414610b64575f80fd5b8063d547741f14610a58578063d5d4b83514610a77578063d630280f14610a8d578063d84f91e814610aac575f80fd5b8063c1dc0f07116100d8578063c1dc0f07146109e0578063c2116974146109f5578063cc5782f614610a14578063cd9b9e9a14610a42575f80fd5b8063b837dbe914610955578063bc61e7331461096a578063bf3e750514610998578063c0729ab1146109cb575f80fd5b80639ee8b2111161017e578063ac1eff681161014e578063ac1eff68146108d6578063ad422ff014610918578063aea4f7451461092d578063b4a5a4b714610941575f80fd5b80639ee8b2111461087d5780639f3ce55a1461089c578063a217fddf146108af578063abd6230d146108c2575f80fd5b80638be745d1116101b95780638be745d1146107d4578063914e57eb1461080057806391d148541461082c578063986fcddd146107c1575f80fd5b806373bd07b71461040f5780637a776315146107a25780637d1e8c55146107c1575f80fd5b80634cdd389b116102bf5780636078bfd81161025f57806367e404ce1161022f57806367e404ce1461070e578063695378f5146107595780636a637967146105625780636e6738431461076f575f80fd5b80636078bfd81461066b57806360e83cf3146106975780636463fb2a146106c357806366f96e98146106e2575f80fd5b8063587944561161029a57806358794456146105ff5780635b7eb4bd146105625780635c721a0c146106145780635ed73ceb1461063f575f80fd5b80634cdd389b146105955780635355420e146105c1578063557eac73146105e0575f80fd5b80632c70645c1161033557806336568abe1161030557806336568abe146105185780633fc08b651461053757806348922ab714610562578063491e093614610576575f80fd5b80632c70645c146104a55780632d3c12e5146104bb5780632f2ff15d146104da5780633631b669146104f9575f80fd5b806311314d0f1161037057806311314d0f1461040f5780631e2ff94f146104355780631f443da01461044b578063248a9ca314610477575f80fd5b806301ffc9a71461039657806305861180146103ca5780631065a399146103ee575b5f80fd5b3480156103a1575f80fd5b506103b56103b0366004614389565b610b83565b60405190151581526020015b60405180910390f35b3480156103d5575f80fd5b506103e06101bb5481565b6040519081526020016103c1565b3480156103f9575f80fd5b5061040d6104083660046143c8565b610c1b565b005b34801561041a575f80fd5b50610423600281565b60405160ff90911681526020016103c1565b348015610440575f80fd5b506103e06101185481565b348015610456575f80fd5b506103e06104653660046143e8565b6101b96020525f908152604090205481565b348015610482575f80fd5b506103e06104913660046143e8565b5f9081526065602052604090206001015490565b3480156104b0575f80fd5b506103e06101835481565b3480156104c6575f80fd5b5061040d6104d5366004614444565b610cf3565b3480156104e5575f80fd5b5061040d6104f43660046144f2565b610e35565b348015610504575f80fd5b5061040d6105133660046143e8565b610e5e565b348015610523575f80fd5b5061040d6105323660046144f2565b610f9d565b348015610542575f80fd5b506103e06105513660046143e8565b60a56020525f908152604090205481565b34801561056d575f80fd5b50610423600181565b348015610581575f80fd5b5061040d610590366004614520565b611050565b3480156105a0575f80fd5b506103e06105af3660046143e8565b6101b76020525f908152604090205481565b3480156105cc575f80fd5b5061040d6105db3660046145b0565b611380565b3480156105eb575f80fd5b5061040d6105fa3660046143e8565b61176c565b34801561060a575f80fd5b506103e060995481565b34801561061f575f80fd5b506103e061062e3660046143e8565b60a66020525f908152604090205481565b34801561064a575f80fd5b506103e06106593660046143e8565b6101ba6020525f908152604090205481565b348015610676575f80fd5b506103e06106853660046143e8565b6101b66020525f908152604090205481565b3480156106a2575f80fd5b506103e06106b13660046143e8565b6101506020525f908152604090205481565b3480156106ce575f80fd5b5061040d6106dd36600461466f565b611832565b3480156106ed575f80fd5b506103e06106fc3660046143e8565b6101b86020525f908152604090205481565b348015610719575f80fd5b5060e55473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016103c1565b348015610764575f80fd5b506103e06101195481565b34801561077a575f80fd5b506103e07f32937fd5162e282df7e9a14a5073a2425321c7966eaf70ed6c838a1006d84c4c81565b3480156107ad575f80fd5b5061040d6107bc3660046146a7565b611d2e565b3480156107cc575f80fd5b506104235f81565b3480156107df575f80fd5b506103e06107ee3660046143e8565b61011a6020525f908152604090205481565b34801561080b575f80fd5b506103e061081a3660046143e8565b61014e6020525f908152604090205481565b348015610837575f80fd5b506103b56108463660046144f2565b5f91825260656020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b348015610888575f80fd5b506103b56108973660046143e8565b611e80565b61040d6108aa3660046146de565b611ea3565b3480156108ba575f80fd5b506103e05f81565b3480156108cd575f80fd5b50610423600381565b3480156108e1575f80fd5b506107346108f03660046143e8565b61011b6020525f908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b348015610923575f80fd5b506103e060985481565b348015610938575f80fd5b5061040d612010565b34801561094c575f80fd5b50610423600481565b348015610960575f80fd5b506103e060e45481565b348015610975575f80fd5b506103b56109843660046143c8565b60da54600160ff9092169190911b16151590565b3480156109a3575f80fd5b506103e07f1185e52d62bfbbea270e57d3d09733d221b53ab7a18bae82bb3c6c74bab16d8281565b3480156109d6575f80fd5b506103e0609a5481565b3480156109eb575f80fd5b506103e060975481565b348015610a00575f80fd5b5061040d610a0f366004614736565b61206b565b348015610a1f575f80fd5b506103b5610a2e3660046143e8565b60d96020525f908152604090205460ff1681565b348015610a4d575f80fd5b506103e06101bd5481565b348015610a63575f80fd5b5061040d610a723660046144f2565b612198565b348015610a82575f80fd5b506103e06101bc5481565b348015610a98575f80fd5b5061040d610aa7366004614777565b6121bc565b348015610ab7575f80fd5b506103e07f356a809dfdea9198dd76fb76bf6d403ecf13ea675eb89e1eda2db2c4a4676a2681565b348015610aea575f80fd5b5061040d610af93660046143c8565b6124b5565b348015610b09575f80fd5b506103e07f4f64fe1ce613546d34d666d8258c13c6296820fd13114d784203feb91276e83881565b348015610b3c575f80fd5b506103e07f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92981565b348015610b6f575f80fd5b5061040d610b7e3660046147e5565b612560565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b000000000000000000000000000000000000000000000000000000001480610c1557507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b7f356a809dfdea9198dd76fb76bf6d403ecf13ea675eb89e1eda2db2c4a4676a26610c458161258b565b60da54600160ff84161b16610c90576040517fb015579f00000000000000000000000000000000000000000000000000000000815260ff831660048201526024015b60405180910390fd5b60da8054600160ff851690811b199091169091557fef04ba2036ccaeab3a59717b51d2b9146b0b0904077177f1148a5418bf1eae23335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a25050565b6004610cfe81612595565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929610d288161258b565b5f4980610d61576040517fa0feae8d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff000000018810610dba576040517f32bdd92500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160a08b013560208083019190915281830184905282518083038401815260609092019092528051910120610e00610dfa368c90038c018c61484c565b8361261b565b610e0f82828b8b8b8b8b612856565b610e29818a84610e24368f90038f018f61484c565b612a27565b50505050505050505050565b5f82815260656020526040902060010154610e4f8161258b565b610e598383612b5d565b505050565b5f54600390610100900460ff16158015610e7e57505f5460ff8083169116105b610f0a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610c87565b5f80546101bd8490557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001660ff8316908117610100177fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b73ffffffffffffffffffffffffffffffffffffffff81163314611042576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610c87565b61104c8282612c4f565b5050565b611058612d08565b85878484875f5a905061106b6003612595565b5f8e8e8e8e8b8e8e6040516020016110899796959493929190614930565b6040516020818303038152906040528051906020012090506110aa81612d7b565b6110bc6110b78d8f6149b5565b612dd5565b8e60e55f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505f808f73ffffffffffffffffffffffffffffffffffffffff168e8d8d6040516111269291906149c8565b5f6040518083038185875af1925050503d805f8114611160576040519150601f19603f3d011682016040523d82523d5f602084013e611165565b606091505b5091509150816111cf5780511561117f5780518082602001fd5b8f6040517f54613443000000000000000000000000000000000000000000000000000000008152600401610c87919073ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b60e580547fffffffffffffffffffffffff00000000000000000000000000000000000000001663075bcd1517905560405183907fa4c827e719e911e8f19393ccdb85b5102f08f0910604d340ba38390b7ff2ab0e905f90a250508615905061136657855f8490036112b557853b1580156112b3573a5a61125161bc7c866149b5565b61125b91906149d7565b61126591906149ea565b9150818811156112af5773ffffffffffffffffffffffffffffffffffffffff87166108fc611293848b6149d7565b6040518115909202915f818181858888f19350505050506112b3565b8791505b505b5f73ffffffffffffffffffffffffffffffffffffffff8416156112d857836112da565b335b90505f8173ffffffffffffffffffffffffffffffffffffffff166108fc8490811502906040515f60405180830381858888f19350505050905080611362576040517fa57c4df400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83166004820152602401610c87565b5050505b505050505050611376600160a755565b5050505050505050565b5f54610100900460ff161580801561139e57505f54600160ff909116105b806113b75750303b1580156113b757505f5460ff166001145b611443576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610c87565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561149f575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b73ffffffffffffffffffffffffffffffffffffffff88166114ec576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b858110156115c3575f87878381811061150957611509614a01565b905060200201602081019061151e9190614a2e565b73ffffffffffffffffffffffffffffffffffffffff160361156b576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6115bb7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9298888848181106115a1576115a1614a01565b90506020020160208101906115b69190614a2e565b612b5d565b6001016114ee565b506115ce5f88612b5d565b6115f87f32937fd5162e282df7e9a14a5073a2425321c7966eaf70ed6c838a1006d84c4c88612b5d565b611600612e51565b61160c87888686612ef1565b7f033d11f27e62ab919708ec716731da80d261a6e4253259b7acde9bf89d28ec1880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8a161790556101198990555f89815261011a6020908152604082208c90559080527f731f3ee9e6d4d973a9db2cd906af646e8361f7be89e984c5d3f716864957e9368b90556101b890527f4f64fe1ce613546d34d666d8258c13c6296820fd13114d784203feb91276e8387fcad30177c4c23bf7ff6cfa6d7eed724357d58710018c138bfe23278ca5288b4e8190556101bd556101188290558015610e29575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050505050505050565b7f1185e52d62bfbbea270e57d3d09733d221b53ab7a18bae82bb3c6c74bab16d826117968161258b565b5f805f4260995410156117bb576097546117b090426149b5565b6099555060016117cd565b609a548510156117cd57849250600191505b609885905580806117db5750815b156117e657609a8390555b60408051868152831515602082015282151581830152905133917fbc3dc0cb5c15c51c81316450d44048838bb478b9809447d01c766a06f3e9f2c8919081900360600190a25050505050565b61183a612d08565b60a0810180359061184e9060808401614a2e565b61185c610120840184614a49565b61186d610100860160e08701614a2e565b5f5a905061187b6003612595565b6101008701355f9081526101506020526040812054908190036118ca576040517f4e68667500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118d48880614aaa565b9050811461192357806118e78980614aaa565b6040517f5e3fd6ad0000000000000000000000000000000000000000000000000000000081526004810193909352602483015250604401610c87565b61193088602001356130d0565b6119456110b760c08a013560a08b01356149b5565b5f61195660808a0160608b01614a2e565b61196660a08b0160808c01614a2e565b60a08b013560c08c013560208d01356119836101208f018f614a49565b6040516020016119999796959493929190614930565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052805160209091012090506119fa816119df8b80614aaa565b6119ef60608e0160408f01614b0e565b8d6101000135613148565b611a30576040517fb05e92fa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611a4060808a0160608b01614a2e565b60e580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff929092169190911790555f80611a9760a08c0160808d01614a2e565b73ffffffffffffffffffffffffffffffffffffffff1660c08c0135611ac06101208e018e614a49565b604051611ace9291906149c8565b5f6040518083038185875af1925050503d805f8114611b08576040519150601f19603f3d011682016040523d82523d5f602084013e611b0d565b606091505b509150915081611b8257805115611b275780518082602001fd5b611b3760a08c0160808d01614a2e565b6040517f5461344300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610c87565b60e580547fffffffffffffffffffffffff00000000000000000000000000000000000000001663075bcd1517905560405183907fa4c827e719e911e8f19393ccdb85b5102f08f0910604d340ba38390b7ff2ab0e905f90a2505050505f861115611d1b57855f849003611c6a57853b158015611c68573a5a611c0661bc7c866149b5565b611c1091906149d7565b611c1a91906149ea565b915081881115611c645773ffffffffffffffffffffffffffffffffffffffff87166108fc611c48848b6149d7565b6040518115909202915f818181858888f1935050505050611c68565b8791505b505b5f73ffffffffffffffffffffffffffffffffffffffff841615611c8d5783611c8f565b335b90505f8173ffffffffffffffffffffffffffffffffffffffff166108fc8490811502906040515f60405180830381858888f19350505050905080611d17576040517fa57c4df400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83166004820152602401610c87565b5050505b505050505050611d2b600160a755565b50565b6004611d3981612595565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929611d638161258b565b611d7060c0840184614a49565b90505f03611daa576040517fc01eab5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6040518060c00160405280855f01358152602001856020013581526020018560400135815260200185606001358152602001856080013581526020018560a0013581525090505f848060c00190611e029190614a49565b604051611e109291906149c8565b60405180910390209050611e24828261261b565b6040805160a0870135602080830191909152818301849052825180830384018152606090920190925280519101205f611e69611e6360c0890189614a49565b846131dc565b9050611e7782828587612a27565b50505050505050565b600881901c5f90815261014f6020526040812054600160ff84161b161515610c15565b6002611eae81612595565b73ffffffffffffffffffffffffffffffffffffffff8516611efb576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b34841115611f35576040517fb03b693200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60e480545f9182611f4583614b31565b9091555090505f611f5686346149d7565b90505f33888884868a8a604051602001611f769796959493929190614930565b604051602081830303815290604052805190602001209050611f9883826132dd565b808873ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe856c2b8bd4eb0027ce32eeaf595c21b0b6b4644b326e5b7bd80a1cf8db72e6c8a86888c8c604051611ffe959493929190614b68565b60405180910390a45050505050505050565b7f1185e52d62bfbbea270e57d3d09733d221b53ab7a18bae82bb3c6c74bab16d8261203a8161258b565b5f609a81905560405133917fba88c025b0cbb77022c0c487beef24f759f1e4be2f51a205bc427cee19c2eaa691a250565b7f32937fd5162e282df7e9a14a5073a2425321c7966eaf70ed6c838a1006d84c4c6120958161258b565b73ffffffffffffffffffffffffffffffffffffffff83166120e2576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f82815261011b602090815260409182902054915173ffffffffffffffffffffffffffffffffffffffff928316815233928592908716917f4a29db3fc6b42bda201e4b4d69ce8d575eeeba5f153509c0d0a342af0f1bd021910160405180910390a4505f90815261011b6020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b5f828152606560205260409020600101546121b28161258b565b610e598383612c4f565b60046121c781612595565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9296121f18161258b565b5f85900361222b576040517f7907d79b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610119545f81815261011a6020526040902054843514612277576040517fead4c30e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101bd546040808601355f9081526101b86020522054146122e4576101bd546040858101355f9081526101b86020528190205490517f2f22b98a00000000000000000000000000000000000000000000000000000000815260048101929092526024820152604401610c87565b6101bb546101bc545f6122f987856001613359565b60408051602081018390528935918101919091526080808a013560608381019190915260a0808c01359284019290925290820187905289013560c08201529091505f9060e001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190528360c08a01358660e08c01356101208d013561238d6101008f018f614aaa565b60405160200161239e929190614b98565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120908301979097528101949094526060840192909252608083015260a082015260c081019190915260e001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261243a9291602001614bfa565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101207f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001900690506124a8818a8d8d8c3560608e013561396a565b5050505050505050505050565b7f356a809dfdea9198dd76fb76bf6d403ecf13ea675eb89e1eda2db2c4a4676a266124df8161258b565b60da54600160ff84161b1615612526576040517fdb246dde00000000000000000000000000000000000000000000000000000000815260ff83166004820152602401610c87565b60da8054600160ff851690811b9091179091557fab40a374bc51de372200a8bc981af8c9ecdc08dfdaef0bb6e09f88f3c616ef3d33610cc7565b600161256b81613b2e565b5f6125758161258b565b6101195461258484825f613359565b5050505050565b611d2b8133613b75565b60da54600160ff83161b8116156125dd576040517fdb246dde00000000000000000000000000000000000000000000000000000000815260ff83166004820152602401610c87565b600281161561104c576040517fdb246dde00000000000000000000000000000000000000000000000000000000815260016004820152602401610c87565b6040820151612656576040517f2898482a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602080830180515f9081526101b6835260408082205461011954935183526101ba909452902054826126c15784516040517fd5aa5ad6000000000000000000000000000000000000000000000000000000008152610c87918591600401918252602082015260400190565b5f6126cd8260016149b5565b90508560600151811461271c5760608601516040517fabefa5e8000000000000000000000000000000000000000000000000000000008152610c87918391600401918252602082015260400190565b828660600151116127695760608601516040517fa386ed70000000000000000000000000000000000000000000000000000000008152600481019190915260248101849052604401610c87565b8560800151866060015111156127be57606086015160808701516040517fcbbd795300000000000000000000000000000000000000000000000000000000815260048101929092526024820152604401610c87565b855184146128055785516040517fd5aa5ad6000000000000000000000000000000000000000000000000000000008152610c87918691600401918252602082015260400190565b5f8581526101b660205260409020541561284e576040517f0f06cd1500000000000000000000000000000000000000000000000000000000815260048101869052602401610c87565b505050505050565b7f73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001860695505f80600a73ffffffffffffffffffffffffffffffffffffffff16898989898989896040516020016128b29796959493929190614c28565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290526128ea91614c64565b5f60405180830381855afa9150503d805f8114612922576040519150601f19603f3d011682016040523d82523d5f602084013e612927565b606091505b509150915081612963576040517fa71194af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408151146129ab578051604080517ff75db381000000000000000000000000000000000000000000000000000000008152610c879290600401918252602082015260400190565b60208101516040820151611000821415806129e657507f73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff000000018114155b156124a8576040517f68dcad5f0000000000000000000000000000000000000000000000000000000081526004810183905260248101829052604401610c87565b6020808201515f9081526101b8909152604090205480612a73576040517f5548c6b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60a0808301516040808501518151602081018690529182019290925260608101919091526080810187905290810185905260c001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120858201515f8881526101b7845284812091909155868401516101b68452848220556060870180516101b98552858320556080880180516101ba8652868420556101b890945293812082905591519251909450919286917f174b4a2e83ebebaf6824e559d2bab7b7e229c80d211e98298a1224970b719a4291a45050505050565b5f82815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1661104c575f82815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055612bf13390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b5f82815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff161561104c575f82815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600260a75403612d74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c87565b600260a755565b5f81815260a66020526040902054600114612dc5576040517f992d87c300000000000000000000000000000000000000000000000000000000815260048101829052602401610c87565b5f90815260a66020526040812055565b5f426099541015612df757609754612ded90426149b5565b6099555080612e08565b81609a54612e0591906149b5565b90505b609854811115612e44576040517fa74c1c5f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b609a5550565b600160a755565b5f54610100900460ff16612ee7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610c87565b612eef613c2e565b565b5f54610100900460ff16612f87576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610c87565b73ffffffffffffffffffffffffffffffffffffffff8416612fd4576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8316613021576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b613029613cc4565b613031613cc4565b613039613cc4565b6130438282613d5a565b61306d7f1185e52d62bfbbea270e57d3d09733d221b53ab7a18bae82bb3c6c74bab16d8285612b5d565b6130977f356a809dfdea9198dd76fb76bf6d403ecf13ea675eb89e1eda2db2c4a4676a2684612b5d565b5050600160e455505060e580547fffffffffffffffffffffffff00000000000000000000000000000000000000001663075bcd15179055565b600881901c5f90815261014f6020526040902054600160ff83161b1615613126576040517f335a4a9000000000000000000000000000000000000000000000000000000000815260048101829052602401610c87565b600881901c5f90815261014f602052604090208054600160ff84161b17905550565b5f85815b858110156131cf57600163ffffffff8616821c811690036131995761319287878381811061317c5761317c614a01565b90506020020135835f9182526020526040902090565b91506131c7565b6131c4828888848181106131af576131af614a01565b905060200201355f9182526020526040902090565b91505b60010161314c565b5090911495945050505050565b5f6131e8602084614c7f565b1561321f576040517f6426c6c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f729eebce00000000000000000000000000000000000000000000000000000000835b80156132d457602081039050808601357fff0000000000000000000000000000000000000000000000000000000000000081161561328557604051838152600481fd5b7f73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001817f73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff0000000187870908935050613242565b50509392505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82015f90815261014e60208181526040808420548452848252808420868552929091528083208290555190918391839186917fea3b023b4c8680d4b4824f0143132c95476359a2bb70a81d6c5a36f6918f63399190a4505050565b5f806133686020860186614aaa565b90509050805f036133a5576040517fdcb2388500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b838560600135116133ef576040517f706144050000000000000000000000000000000000000000000000000000000081526060860135600482015260248101859052604401610c87565b6134018560e001358660c00135613ec0565b8460800135610118541461345357610118546040517f3211d9be000000000000000000000000000000000000000000000000000000008152600481019190915260808601356024820152604401610c87565b428560a001351061349c576040517fbf81c6e000000000000000000000000000000000000000000000000000000000815260a08601356004820152426024820152604401610c87565b5f6101b7816134ae6020890189614aaa565b5f8181106134be576134be614a01565b9050602002013581526020019081526020015f205490508560400135811461351f57604080517f9a89a75800000000000000000000000000000000000000000000000000000000815260048101839052908701356024820152604401610c87565b5f8181526101b6602052604090205486358114613572576040517fe1cb6e600000000000000000000000000000000000000000000000000000000081526004810182905287356024820152604401610c87565b5f6101b68161358460208b018b614aaa565b61358f6001896149d7565b81811061359e5761359e614a01565b9050602002013581526020019081526020015f205490505f801b81036135f0576040517f2898482a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101b85f61360160208b018b614aaa565b600161361060208e018e614aaa565b90500381811061362257613622614a01565b9050602002013581526020019081526020015f205494505f801b8503613674576040517f5548c6b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6136906136856101008a018a614aaa565b8a6101200135613f8d565b6136a76136a16101408a018a614a49565b89614099565b60015b848110156137bc576136bf60208a018a614aaa565b600183038181106136d2576136d2614a01565b905060200201356101b75f8b80602001906136ed9190614aaa565b858181106136fd576136fd614a01565b9050602002013581526020019081526020015f2054146137b45761372460208a018a614aaa565b6001830381811061373757613737614a01565b905060200201356101b75f8b80602001906137529190614aaa565b8581811061376257613762614a01565b9050602002013581526020019081526020015f20546040517f710cd580000000000000000000000000000000000000000000000000000000008152600401610c87929190918252602082015260400190565b6001016136aa565b505f6101b9816137cf60208c018c614aaa565b5f8181106137df576137df614a01565b9050602002013581526020019081526020015f205490505f6101ba5f8b806020019061380b9190614aaa565b61381660018b6149d7565b81811061382557613825614a01565b9050602002013581526020019081526020015f2054905089606001358114613886576040517f9f6adc690000000000000000000000000000000000000000000000000000000081526004810182905260608b01356024820152604401610c87565b6138918960016149b5565b82146138df576138a28960016149b5565b6040517fabefa5e8000000000000000000000000000000000000000000000000000000008152600481019190915260248101839052604401610c87565b60608a01355f81815261011a6020526040908190208590556101bd89905560a08c01356101185561011982905560e08c01356101bb5560c08c01356101bc555184918c35917f1335f1a2b3ff25f07f5fef07dd35d8fb4312c3c73b138e2fad9347b3319ab53c90613955908d1515815260200190565b60405180910390a45050505050509392505050565b6040805160018082528183019092525f916020808301908036833701905050905086815f8151811061399e5761399e614a01565b6020908102919091018101919091525f87815261011b909152604090205473ffffffffffffffffffffffffffffffffffffffff1680613a09576040517f69ed70ab00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f7e4f7a8a0000000000000000000000000000000000000000000000000000000081525f9073ffffffffffffffffffffffffffffffffffffffff831690637e4f7a8a90613a61908a908a908890600401614cb7565b6020604051808303815f875af1158015613a7d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613aa19190614d0e565b905080613ada576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f84815261011a60209081526040918290205482518881529182015285917f5c885a794662ebe3b08ae0874fc2c88b5343b0223ba9cd2cad92b69c0d0c901f910160405180910390a2505050505050505050565b60da54600160ff83161b1615611d2b576040517fdb246dde00000000000000000000000000000000000000000000000000000000815260ff82166004820152602401610c87565b5f82815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1661104c57613bb481614126565b613bbf836020614145565b604051602001613bd0929190614d2d565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a0000000000000000000000000000000000000000000000000000000008252610c8791600401614dad565b5f54610100900460ff16612e4a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610c87565b5f54610100900460ff16612eef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610c87565b5f54610100900460ff16613df0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610c87565b815f03613e29576040517fb5ed5a3b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805f03613e62576040517fd10d72bb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60978290556098819055613e7682426149b5565b60998190556097546098546040805192835260208301919091528101919091527f8f805c372b66240792580418b7328c0c554ae235f0932475c51b026887fe26a990606001610f91565b815f03613f0257801561104c576040517f0c25659200000000000000000000000000000000000000000000000000000000815260048101829052602401610c87565b80613f3c576040517f5228f4c800000000000000000000000000000000000000000000000000000000815260048101839052602401610c87565b5f82815261014e6020526040902054811461104c576040517f36459fa00000000000000000000000000000000000000000000000000000000081526004810183905260248101829052604401610c87565b5f5b82811015614093576101505f858584818110613fad57613fad614a01565b9050602002013581526020019081526020015f20545f1461401657838382818110613fda57613fda614a01565b905060200201356040517fe5d14425000000000000000000000000000000000000000000000000000000008152600401610c8791815260200190565b816101505f86868581811061402d5761402d614a01565b9050602002013581526020019081526020015f20819055508184848381811061405857614058614a01565b905060200201357f300e6f978eee6a4b0bba78dd8400dc64fd5652dbfc868a2258e16d0977be222b60405160405180910390a3600101613f8f565b50505050565b6140a4600283614c7f565b156140de576040517f0c91d77600000000000000000000000000000000000000000000000000000000815260048101839052602401610c87565b5f805b83811015612584576040518582013560f01c9250838301907f3c116827db9db3a30c1a25db8b0ee4bab9d2b223560209cfd839601b621c726d905f90a26002016140e1565b6060610c1573ffffffffffffffffffffffffffffffffffffffff831660145b60605f6141538360026149ea565b61415e9060026149b5565b67ffffffffffffffff8111156141765761417661481f565b6040519080825280601f01601f1916602001820160405280156141a0576020820181803683370190505b5090507f3000000000000000000000000000000000000000000000000000000000000000815f815181106141d6576141d6614a01565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061423857614238614a01565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053505f6142728460026149ea565b61427d9060016149b5565b90505b6001811115614319577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106142be576142be614a01565b1a60f81b8282815181106142d4576142d4614a01565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a90535060049490941c9361431281614dfd565b9050614280565b508315614382576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c87565b9392505050565b5f60208284031215614399575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114614382575f80fd5b5f602082840312156143d8575f80fd5b813560ff81168114614382575f80fd5b5f602082840312156143f8575f80fd5b5035919050565b5f8083601f84011261440f575f80fd5b50813567ffffffffffffffff811115614426575f80fd5b60208301915083602082850101111561443d575f80fd5b9250929050565b5f805f805f8086880361012081121561445b575f80fd5b60c0811215614468575f80fd5b5086955060c0870135945060e087013567ffffffffffffffff8082111561448d575f80fd5b6144998a838b016143ff565b90965094506101008901359150808211156144b2575f80fd5b506144bf89828a016143ff565b979a9699509497509295939492505050565b73ffffffffffffffffffffffffffffffffffffffff81168114611d2b575f80fd5b5f8060408385031215614503575f80fd5b823591506020830135614515816144d1565b809150509250929050565b5f805f805f805f8060e0898b031215614537575f80fd5b8835614542816144d1565b97506020890135614552816144d1565b965060408901359550606089013594506080890135614570816144d1565b935060a089013567ffffffffffffffff81111561458b575f80fd5b6145978b828c016143ff565b999c989b50969995989497949560c00135949350505050565b5f805f805f805f805f6101008a8c0312156145c9575f80fd5b8935985060208a0135975060408a01356145e2816144d1565b965060608a01356145f2816144d1565b955060808a013567ffffffffffffffff8082111561460e575f80fd5b818c0191508c601f830112614621575f80fd5b81358181111561462f575f80fd5b8d60208260051b8501011115614643575f80fd5b9a9d999c50979a96996020919091019890975060a08701359660c0810135965060e00135945092505050565b5f6020828403121561467f575f80fd5b813567ffffffffffffffff811115614695575f80fd5b82016101408185031215614382575f80fd5b5f602082840312156146b7575f80fd5b813567ffffffffffffffff8111156146cd575f80fd5b820160e08185031215614382575f80fd5b5f805f80606085870312156146f1575f80fd5b84356146fc816144d1565b935060208501359250604085013567ffffffffffffffff81111561471e575f80fd5b61472a878288016143ff565b95989497509550505050565b5f8060408385031215614747575f80fd5b8235614752816144d1565b946020939093013593505050565b5f6101608284031215614771575f80fd5b50919050565b5f805f806060858703121561478a575f80fd5b843567ffffffffffffffff808211156147a1575f80fd5b6147ad888389016143ff565b90965094506020870135935060408701359150808211156147cc575f80fd5b506147d987828801614760565b91505092959194509250565b5f602082840312156147f5575f80fd5b813567ffffffffffffffff81111561480b575f80fd5b61481784828501614760565b949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f60c0828403121561485c575f80fd5b60405160c0810181811067ffffffffffffffff821117156148a4577f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b8060405250823581526020830135602082015260408301356040820152606083013560608201526080830135608082015260a083013560a08201528091505092915050565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b5f73ffffffffffffffffffffffffffffffffffffffff808a16835280891660208401525086604083015285606083015284608083015260c060a083015261497b60c0830184866148e9565b9998505050505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b80820180821115610c1557610c15614988565b818382375f9101908152919050565b81810381811115610c1557610c15614988565b8082028115828204841417610c1557610c15614988565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215614a3e575f80fd5b8135614382816144d1565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112614a7c575f80fd5b83018035915067ffffffffffffffff821115614a96575f80fd5b60200191503681900382131561443d575f80fd5b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112614add575f80fd5b83018035915067ffffffffffffffff821115614af7575f80fd5b6020019150600581901b360382131561443d575f80fd5b5f60208284031215614b1e575f80fd5b813563ffffffff81168114614382575f80fd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614b6157614b61614988565b5060010190565b858152846020820152836040820152608060608201525f614b8d6080830184866148e9565b979650505050505050565b5f7f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115614bc5575f80fd5b8260051b80858437919091019392505050565b5f5b83811015614bf2578181015183820152602001614bda565b50505f910152565b5f8351614c0b818460208801614bd8565b835190830190614c1f818360208801614bd8565b01949350505050565b878152866020820152856040820152838560608301375f848201606081015f815284868237505f93016060019283525090979650505050505050565b5f8251614c75818460208701614bd8565b9190910192915050565b5f82614cb2577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500690565b604081525f614cca6040830185876148e9565b8281036020848101919091528451808352858201928201905f5b81811015614d0057845183529383019391830191600101614ce4565b509098975050505050505050565b5f60208284031215614d1e575f80fd5b81518015158114614382575f80fd5b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081525f8351614d64816017850160208801614bd8565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351614da1816028840160208801614bd8565b01602801949350505050565b602081525f8251806020840152614dcb816040850160208701614bd8565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b5f81614e0b57614e0b614988565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fea26469706673582212205733f8a4ec3487fd65dac516249287485e7f1bf9b1d1b71a9ad60a819dcc1f2d64736f6c63430008180033", - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/sdk/src/clients/blockchain/abis/PlonkVerifier.json b/sdk/src/clients/blockchain/abis/PlonkVerifier.json deleted file mode 100644 index d5f285047..000000000 --- a/sdk/src/clients/blockchain/abis/PlonkVerifier.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "contractName": "PlonkVerifier", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "a", - "type": "uint256" - } - ], - "name": "PrintUint256", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "proof", - "type": "bytes" - }, - { - "internalType": "uint256[]", - "name": "public_inputs", - "type": "uint256[]" - } - ], - "name": "Verify", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "bytecode": "0x608060405234801561001057600080fd5b50612466806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80637e4f7a8a14610030575b600080fd5b61004361003e3660046120b1565b610057565b604051901515815260200160405180910390f35b6000806000806000610069878761117f565b92965090945092509050600061008088888461159c565b905060008060009050604051856000820152876040820152846060820152866020820152836101c08201526100b36100ff565b6100bc8b610e57565b6100c58b610dea565b6100ce8b610bb4565b6100d78b610701565b6100e08b6104fa565b6100e98b610217565b6102408101519150610260810151925050611170565b60405161028060405101610119816008606085015161112a565b6000805160206123f183398151915260008051602061241183398151915282089050806101e08401526000805160206123f183398151915260016000805160206123f183398151915203606085015108610194837f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593efffffff8361112a565b90506000805160206123f18339815191527f2a57c4a4850b6c2481463cffb1512d51832d6b3f6a82427f1b65b6e172000001820990506000805160206123f18339815191528282098451935091506000805160206123f1833981519152905082820990506000805160206123f183398151915282820990508060c0840152505050565b60405161028081016000805160206123f18339815191526020832006816040810192506102e08501518152610300850151602082015261025d838361032088018461109e565b6101808401610272848461024089018461109e565b6101608501610286846102808901836110fc565b6001855260026020860152805160408087019182529095908160608160076107d05a03fa5060208101915081517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd470382526102e38682858661101d565b5050836040850194506103008560608801516102e08a0184611063565b6000805160206123f18339815191526000805160206123b18339815191526060880151096000805160206123f183398151915281860994505061034985856103208a018461109e565b6103558582848561101d565b50602082810180517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47038082526102608801528251865291810151858201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c260408601527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed60608601527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b60808601527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa60a0860152915160c08501525160e08401527f12740934ba9615b77b6a49b06fcce83ce90d67b1d0e2a530069e3a7306569a916101008401527f116da8c89a0d090f3d8644ada33a5f1c8013ba7204aeca62d66d931b99afe6e76101208401527f25222d9816e5f86b4a7dedd00d04acc5c979c18bd22b834ea8c6d07c0ba441db6101408401527f076441042e77b6309644b56251f059cf14befc72ac8a6157d30924e58dc4c172610160840152905060006101808360086107d05a03fa90506102408201518116610240830152505050565b6040516102806040510161022082015180604060010261020001808401604085015161018087015260608501516101a08701526102a087015161016087015261054c8184608088016101808a0161109e565b61055f836102c0890161016089016110fc565b826102608701526000805160206123f1833981519152848409925061058d818460c088016101808a0161109e565b506105a1826101a0880161016088016110fc565b6000805160206123f183398151915283830991506105cb818501836101008701610180890161109e565b6105de826101c0880161016088016110fc565b6000805160206123f18339815191528383099150610608818501836101408701610180890161109e565b61061b826101e0880161016088016110fc565b6000805160206123f18339815191528383099150610645818501836101808701610180890161109e565b61065882610200880161016088016110fc565b6000805160206123f18339815191528383099150610682818501836101c08701610180890161109e565b61069582610220880161016088016110fc565b6103608601610200850160005b60018110156106f6576000805160206123f183398151915286860994506106d184880186846101808c0161109e565b6106e085846101608b016110fc565b60209290920191604091909101906001016106a2565b505050505050505050565b604080516467616d6d6161028082019081526060808301516102a08085019190915260e08401516102c0808601919091526101008501516102e0860152610120850151610300860152610140850151610320860152602087015161034086015294860151610360808601919091529186015161038085015260808601516103a085015260a08601516103c085015260c08601516103e08501527f1d5408c43c22cc34434488a0cb4fa2745c3f422b0fb195724e3f1143dddc622c6104008501527f1690d573abd01844ec528269be7898e259c9f1c73c3c23a365afa512c34560e06104208501527f02a5a3c770a8e8595bff76358ef982e8abf95b08bf74f5c8709bc34d28484b016104408501527f0124c05f06c5d46726e89a1acccf22f64f8ce535699c27a62a6a6a6045ca363e6104608501527f24a0b9cf265f926f2576bebe81eaf4485874c5d0d40786ec7718597938b1950f6104808501527f07fc8dbc510e83a416aa31f40fa10c5c4863b709bc742cba0647bfc9e11e51046104a08501528501516104c0840152928401516104e08301526101a08401516105008301526101c08401516105208301526101e084015161054083015261020084015161056083015261022084015161058083015290916105a0830190840160005b60018110156108ff5781518352602092830192909101906001016108e0565b50601b91506103259050602061022085018285850160026107d05a03fa505050506102200180516000805160206123f18339815191529006905250565b604051610280604051017f1c1b525df0b18554d4dd828f8b2e607357f8253137242d14bc673861dc34e11a81527f2648b5fdafc700004029fc59ff01405c410bb91cddc1b07a79342db60c64df9e60208201526109a7604082016101a0850151836101208601611063565b7f0c850337812ad8ffa6d293490423f491c42e9befa88e42d9aa476e190f2507ee81527f0e1c8948d91dab2e9fdce337e0a345a1a7f1a263a2daca6012128320e5e814696020820152610a08604082016101c085015183610120860161109e565b6000805160206123f18339815191526101c08401516101a0850151096000805160206123d183398151915282527f1562cf4b1044da21e79ed8a6ed7c39429ebd0084973c8d9e25268fad26be291b6020830152610a6e604083018284610120870161109e565b506000805160206123d183398151915281527f1b017f27d0ecc607d0b16d0f94051f1af8c46a0cd1353cef16f9fc69b1bed42c6020820152610abe604082016101e085015183610120860161109e565b60008082526020820152610adb604082018261012085018061101d565b6103608301610380840160005b6001811015610b29578151845260208201516020850152610b1360408501845186610120890161109e565b6020929092019160409190910190600101610ae8565b5050507f0f8ec3f38611514aadfd2b6fcc3b6c295badd98ffce4b65a9ea6718328ba181f81527ef642ac5be0d822c5a535312d589b5557a8db3183e408fb78ff8f1c8b7b20466020820152610b87604082018583610120860161109e565b61024083015181526102608301516020820152610bad604082018683610120860161109e565b5050505050565b60405160208101516040820151606083015160008401516000805160206123f183398151915284610280880151096000805160206123f183398151915261020088015186096000805160206123f18339815191526101a0890151820890506000805160206123f183398151915285820890506000805160206123f183398151915261022089015187096000805160206123f18339815191526101c08a0151820890506000805160206123f183398151915286820890506000805160206123f18339815191528284096000805160206123f183398151915282820990506000805160206123f183398151915285820990506000805160206123f1833981519152600580096000805160206123f1833981519152878a0998506000805160206123f18339815191526101a08c01518a0894506000805160206123f183398151915288860894506000805160206123f183398151915260058a0993506000805160206123f18339815191526101c08c0151850893506000805160206123f183398151915288850893506000805160206123f1833981519152818a099250506000805160206123f18339815191526101e08b0151830891506000805160206123f183398151915287830891506000805160206123f183398151915283850997506000805160206123f18339815191528289096000805160206123f1833981519152908103985085890997506000805160206123f183398151915260c08a015189089750610dde88828c61093c565b50505050505050505050565b604051600260080161028060405101610e088183606086015161112a565b9150610e1d8183610160870160e08701611063565b610e3081610120860160e086018061101d565b610e3f818360e0860180611063565b610e518160e08681019086018061101d565b50505050565b604051610280604051016000805160206123f183398151915260208301516102008501510981526000805160206123f1833981519152604083015182510881526000805160206123f18339815191526101a08401518251088152602081016000805160206123f183398151915260208401516102208601510981526000805160206123f1833981519152604084015182510881526000805160206123f18339815191526101c08501518251088152604082016000805160206123f183398151915260408501516101e08701510881526000805160206123f1833981519152825184510983526000805160206123f1833981519152815184510980845284516000805160206123f18339815191529250900982526000805160206123f18339815191526102808501518351098252606082016000805160206123f18339815191526101c08501516102c08701510881526000805160206123f1833981519152835182510881526000805160206123f183398151915260c08501516000805160206123f18339815191520382510881526000805160206123f18339815191526101e08501516102a0870151098252805161024085015281518151146102408501525050505050565b6040518251855260208301516020860152835160408601526020840151606086015260408260808760066107d05a03fa6102408201518116610240830152505050505050565b604051825185526020830151602086015283604086015260408260608760076107d05a03fa6102408201518116610240830152505050505050565b604051825185526020830151602086015283604086015260408560608760076107d05a03fa825160408701526020830151606087015260408360808860066107d05a03fa811690506102408201518116610240830152505050505050565b6000805160206123f1833981519152838351096000805160206123f183398151915281835108825250505050565b602083526020808401526020604084015280606084015250806080830152506000805160206123f183398151915260a082015260208160c08360056107d05a03fa505190565b96505050505050505b92915050565b6000806000806000806000806040516111988a8c6111ea565b805194506111a6858c6114bf565b805193506111b4848c6114e6565b805192506111c2838c611524565b516000805160206123f18339815191529485900694938490069392839006929006905061158c565b6040516467616d6d6181527f1d5408c43c22cc34434488a0cb4fa2745c3f422b0fb195724e3f1143dddc622c60208201527f1690d573abd01844ec528269be7898e259c9f1c73c3c23a365afa512c34560e060408201527f02a5a3c770a8e8595bff76358ef982e8abf95b08bf74f5c8709bc34d28484b0160608201527f0124c05f06c5d46726e89a1acccf22f64f8ce535699c27a62a6a6a6045ca363e60808201527f0f8ec3f38611514aadfd2b6fcc3b6c295badd98ffce4b65a9ea6718328ba181f60a08201527ef642ac5be0d822c5a535312d589b5557a8db3183e408fb78ff8f1c8b7b204660c08201527f1c1b525df0b18554d4dd828f8b2e607357f8253137242d14bc673861dc34e11a60e08201527f2648b5fdafc700004029fc59ff01405c410bb91cddc1b07a79342db60c64df9e6101008201527f0c850337812ad8ffa6d293490423f491c42e9befa88e42d9aa476e190f2507ee6101208201527f0e1c8948d91dab2e9fdce337e0a345a1a7f1a263a2daca6012128320e5e814696101408201526000805160206123d18339815191526101608201527f1562cf4b1044da21e79ed8a6ed7c39429ebd0084973c8d9e25268fad26be291b6101808201526000805160206123d18339815191526101a08201527f1b017f27d0ecc607d0b16d0f94051f1af8c46a0cd1353cef16f9fc69b1bed42c6101c082015260006101e0820152600061020082015260208301610220820160005b8551811015611426578251825260209283019290910190600101611407565b506103808401915060005b600181101561145a57825182526020808401519083015260409283019290910190600101611431565b506020840151815260408401516020820152606084015160408201526080840151606082015260a0840151608082015260c084015160a0820152505060208351026102c50160406001028101905060208282601b850160026107d05a03fa5050505050565b50604051636265746181528160208201526020816024601c840160026107d05a03fa505050565b60405164616c7068618152826020820152610240820151604082015261026082015160608201526020816065601b840160026107d05a03fa50505050565b604051637a657461815282602082015260e082015160408201526101008201516060820152610120820151608082015261014082015160a082015261016082015160c082015261018082015160e082015260208160e4601c840160026107d05a03fa50505050565b9299919850965090945092505050565b60008060006115b0848651602088016115ba565b506040515161181c565b6040516115c881848661161f565b60008060005b85811015611613576000805160206123f1833981519152855185510991506000805160206123f1833981519152828408602095860195949094019392506001016115ce565b50506040515250505050565b6000805160206123f18339815191526000805160206124118339815191526116498560088561112a565b086000805160206123f18339815191527f2a57c4a4850b6c2481463cffb1512d51832d6b3f6a82427f1b65b6e1720000018209905060018460005b858110156116e1576000805160206123f1833981519152836000805160206123f183398151915203860882526000805160206123f18339815191526000805160206123b18339815191528409925060209190910190600101611684565b506116ed81868861175d565b50600190508460005b85811015611754576000805160206123f1833981519152836000805160206123f1833981519152868551090982526020820191506000805160206123f18339815191526000805160206123b1833981519152840992506001016116f6565b50505050505050565b600183526000805b838110156117a15781850151828401516000805160206123f1833981519152818309905060208401935080848801525050600181019050611765565b5060208103820191508084019350506117d06020840160026000805160206123f183398151915203855161112a565b60005b83811015610bad5760208503945082516000805160206123f18339815191528651840984526000805160206123f1833981519152818409601f19909401939250506001016117d3565b61182a60405160088661112a565b91506000805160206123f18339815191526000805160206124118339815191528308604080516001808252818301909252919350600091906020808301908036833750506005602083015250905060606118866001600261217f565b67ffffffffffffffff81111561189e5761189e611fea565b6040519080825280602002602001820160405280156118c7578160200160208202803683370190505b5090506118d481896119be565b60005b60018110156119b157600061193f836118f184600261217f565b8151811061190157611901612196565b602002602001015184846002611917919061217f565b6119229060016121ac565b8151811061193257611932612196565b60200260200101516119f3565b90506000611972898b5187868151811061195b5761195b612196565b602002602001015161196d91906121ac565b611b28565b90506000805160206123f183398151915281830990506000805160206123f18339815191528187089550505080806119a9906121bf565b9150506118d7565b5050509150509392505050565b60208201610380820160005b6002811015610bad578151835260208083015190840152604092830192909101906001016119ca565b600080611a008484611c7b565b905060005b6020811015611a5e57611a1981600861217f565b82611a2583602f6121d8565b60308110611a3557611a35612196565b602002015160ff16901b83611a4a91906121ac565b925080611a56816121bf565b915050611a05565b50611a776000805160206123f1833981519152836121eb565b91506000805b6010811015611ad657611a9181600861217f565b83611a9d83600f6121d8565b60308110611aad57611aad612196565b602002015160ff16901b82611ac291906121ac565b915080611ace816121bf565b915050611a7d565b507f0e0a77c19a07df2f666ea36f7879462e36fc76959f60cd29ac96341c4ffffffb6000805160206123f183398151915281830991506000805160206123f18339815191528285089695505050505050565b600080611b81565b600060405160208152602080820152602060408201528260608201528360808201526000805160206123f183398151915260a08201526020600060c08360056107d05a03fa50506000519392505050565b611b99836000805160206123b1833981519152611b30565b6000805160206123f1833981519152816000805160206123f18339815191520386089350611bc8600886611b30565b94506000805160206123f1833981519152600080516020612411833981519152860894506000805160206123f18339815191527f2a57c4a4850b6c2481463cffb1512d51832d6b3f6a82427f1b65b6e17200000182099050611c4a7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593efffffff85611b30565b93506000805160206123f183398151915284820990506000805160206123f183398151915285820995945050505050565b611c83611fcb565b60408051808201909152600b8082526a42534232322d506c6f6e6b60a81b6020830152606090600090603090825b6040811015611cf1578484604051602001611ccd929190612231565b60405160208183030381529060405294508080611ce9906121bf565b915050611cb1565b508388888585878a87604051602001611d11989796959493929190612263565b60405160208183030381529060405293506000600285604051611d3491906122dd565b602060405180830381855afa158015611d51573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190611d7491906122f9565b90508060018784604051602001611d8e9493929190612312565b60405160208183030381529060405294506000600286604051611db191906122dd565b602060405180830381855afa158015611dce573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190611df191906122f9565b905060005b6020811015611e4357818160208110611e1157611e11612196565b1a898260308110611e2457611e24612196565b60ff909216602092909202015280611e3b816121bf565b915050611df6565b50604051600083811a9083901a1860f81b6001600160f81b031916602082015260210160408051601f19818403018152919052955060015b6020811015611ee75786828260208110611e9757611e97612196565b1a848360208110611eaa57611eaa612196565b1a60f81b60f81c18604051602001611ec3929190612231565b60405160208183030381529060405296508080611edf906121bf565b915050611e7b565b508560028885604051602001611f009493929190612358565b6040516020818303038152906040529550600286604051611f2191906122dd565b602060405180830381855afa158015611f3e573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190611f6191906122f9565b905060005b6010811015611fbd57818160208110611f8157611f81612196565b1a89611f8e8360206121ac565b60308110611f9e57611f9e612196565b60ff909216602092909202015280611fb5816121bf565b915050611f66565b505050505050505092915050565b6040518061060001604052806030906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561202957612029611fea565b604052919050565b600082601f83011261204257600080fd5b8135602067ffffffffffffffff82111561205e5761205e611fea565b8160051b61206d828201612000565b928352848101820192828101908785111561208757600080fd5b83870192505b848310156120a65782358252918301919083019061208d565b979650505050505050565b600080604083850312156120c457600080fd5b823567ffffffffffffffff808211156120dc57600080fd5b818501915085601f8301126120f057600080fd5b813560208282111561210457612104611fea565b612116601f8301601f19168201612000565b828152888284870101111561212a57600080fd5b8282860183830137600092810182019290925290945085013591508082111561215257600080fd5b5061215f85828601612031565b9150509250929050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761117957611179612169565b634e487b7160e01b600052603260045260246000fd5b8082018082111561117957611179612169565b6000600182016121d1576121d1612169565b5060010190565b8181038181111561117957611179612169565b60008261220857634e487b7160e01b600052601260045260246000fd5b500690565b60005b83811015612228578181015183820152602001612210565b50506000910152565b6000835161224381846020880161220d565b60f89390931b6001600160f81b0319169190920190815260010192915050565b60008951612275818460208e0161220d565b808301905089815288602082015260ff60f81b808960f81b166040830152808860f81b166041830152808760f81b16604283015285516122bc816043850160208a0161220d565b60f89590951b16930160438101939093525050604401979650505050505050565b600082516122ef81846020870161220d565b9190910192915050565b60006020828403121561230b57600080fd5b5051919050565b848152600060ff60f81b808660f81b166020840152845161233a81602186016020890161220d565b60f89490941b16919092016021810191909152602201949350505050565b6000855161236a818460208a0161220d565b6001600160f81b031960f887901b81169184019182528551612393816001850160208a0161220d565b60f89590951b16930160018101939093525050600201939250505056fe2b337de1c8c14f22ec9b9e2f96afef3652627366f8170a0a948dad4ac1bd5e800b7b837fbc6114cf487b04a05b3aeb8eac5dcf630284d3208d3e072b2c37843630644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000130644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000000a2646970667358221220d6cd5fc52c473bd70879247dc9113bd3ea6427c5e15c5b0b749f5a0dc811523464736f6c63430008130033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c80637e4f7a8a14610030575b600080fd5b61004361003e3660046120b1565b610057565b604051901515815260200160405180910390f35b6000806000806000610069878761117f565b92965090945092509050600061008088888461159c565b905060008060009050604051856000820152876040820152846060820152866020820152836101c08201526100b36100ff565b6100bc8b610e57565b6100c58b610dea565b6100ce8b610bb4565b6100d78b610701565b6100e08b6104fa565b6100e98b610217565b6102408101519150610260810151925050611170565b60405161028060405101610119816008606085015161112a565b6000805160206123f183398151915260008051602061241183398151915282089050806101e08401526000805160206123f183398151915260016000805160206123f183398151915203606085015108610194837f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593efffffff8361112a565b90506000805160206123f18339815191527f2a57c4a4850b6c2481463cffb1512d51832d6b3f6a82427f1b65b6e172000001820990506000805160206123f18339815191528282098451935091506000805160206123f1833981519152905082820990506000805160206123f183398151915282820990508060c0840152505050565b60405161028081016000805160206123f18339815191526020832006816040810192506102e08501518152610300850151602082015261025d838361032088018461109e565b6101808401610272848461024089018461109e565b6101608501610286846102808901836110fc565b6001855260026020860152805160408087019182529095908160608160076107d05a03fa5060208101915081517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd470382526102e38682858661101d565b5050836040850194506103008560608801516102e08a0184611063565b6000805160206123f18339815191526000805160206123b18339815191526060880151096000805160206123f183398151915281860994505061034985856103208a018461109e565b6103558582848561101d565b50602082810180517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47038082526102608801528251865291810151858201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c260408601527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed60608601527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b60808601527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa60a0860152915160c08501525160e08401527f12740934ba9615b77b6a49b06fcce83ce90d67b1d0e2a530069e3a7306569a916101008401527f116da8c89a0d090f3d8644ada33a5f1c8013ba7204aeca62d66d931b99afe6e76101208401527f25222d9816e5f86b4a7dedd00d04acc5c979c18bd22b834ea8c6d07c0ba441db6101408401527f076441042e77b6309644b56251f059cf14befc72ac8a6157d30924e58dc4c172610160840152905060006101808360086107d05a03fa90506102408201518116610240830152505050565b6040516102806040510161022082015180604060010261020001808401604085015161018087015260608501516101a08701526102a087015161016087015261054c8184608088016101808a0161109e565b61055f836102c0890161016089016110fc565b826102608701526000805160206123f1833981519152848409925061058d818460c088016101808a0161109e565b506105a1826101a0880161016088016110fc565b6000805160206123f183398151915283830991506105cb818501836101008701610180890161109e565b6105de826101c0880161016088016110fc565b6000805160206123f18339815191528383099150610608818501836101408701610180890161109e565b61061b826101e0880161016088016110fc565b6000805160206123f18339815191528383099150610645818501836101808701610180890161109e565b61065882610200880161016088016110fc565b6000805160206123f18339815191528383099150610682818501836101c08701610180890161109e565b61069582610220880161016088016110fc565b6103608601610200850160005b60018110156106f6576000805160206123f183398151915286860994506106d184880186846101808c0161109e565b6106e085846101608b016110fc565b60209290920191604091909101906001016106a2565b505050505050505050565b604080516467616d6d6161028082019081526060808301516102a08085019190915260e08401516102c0808601919091526101008501516102e0860152610120850151610300860152610140850151610320860152602087015161034086015294860151610360808601919091529186015161038085015260808601516103a085015260a08601516103c085015260c08601516103e08501527f1d5408c43c22cc34434488a0cb4fa2745c3f422b0fb195724e3f1143dddc622c6104008501527f1690d573abd01844ec528269be7898e259c9f1c73c3c23a365afa512c34560e06104208501527f02a5a3c770a8e8595bff76358ef982e8abf95b08bf74f5c8709bc34d28484b016104408501527f0124c05f06c5d46726e89a1acccf22f64f8ce535699c27a62a6a6a6045ca363e6104608501527f24a0b9cf265f926f2576bebe81eaf4485874c5d0d40786ec7718597938b1950f6104808501527f07fc8dbc510e83a416aa31f40fa10c5c4863b709bc742cba0647bfc9e11e51046104a08501528501516104c0840152928401516104e08301526101a08401516105008301526101c08401516105208301526101e084015161054083015261020084015161056083015261022084015161058083015290916105a0830190840160005b60018110156108ff5781518352602092830192909101906001016108e0565b50601b91506103259050602061022085018285850160026107d05a03fa505050506102200180516000805160206123f18339815191529006905250565b604051610280604051017f1c1b525df0b18554d4dd828f8b2e607357f8253137242d14bc673861dc34e11a81527f2648b5fdafc700004029fc59ff01405c410bb91cddc1b07a79342db60c64df9e60208201526109a7604082016101a0850151836101208601611063565b7f0c850337812ad8ffa6d293490423f491c42e9befa88e42d9aa476e190f2507ee81527f0e1c8948d91dab2e9fdce337e0a345a1a7f1a263a2daca6012128320e5e814696020820152610a08604082016101c085015183610120860161109e565b6000805160206123f18339815191526101c08401516101a0850151096000805160206123d183398151915282527f1562cf4b1044da21e79ed8a6ed7c39429ebd0084973c8d9e25268fad26be291b6020830152610a6e604083018284610120870161109e565b506000805160206123d183398151915281527f1b017f27d0ecc607d0b16d0f94051f1af8c46a0cd1353cef16f9fc69b1bed42c6020820152610abe604082016101e085015183610120860161109e565b60008082526020820152610adb604082018261012085018061101d565b6103608301610380840160005b6001811015610b29578151845260208201516020850152610b1360408501845186610120890161109e565b6020929092019160409190910190600101610ae8565b5050507f0f8ec3f38611514aadfd2b6fcc3b6c295badd98ffce4b65a9ea6718328ba181f81527ef642ac5be0d822c5a535312d589b5557a8db3183e408fb78ff8f1c8b7b20466020820152610b87604082018583610120860161109e565b61024083015181526102608301516020820152610bad604082018683610120860161109e565b5050505050565b60405160208101516040820151606083015160008401516000805160206123f183398151915284610280880151096000805160206123f183398151915261020088015186096000805160206123f18339815191526101a0890151820890506000805160206123f183398151915285820890506000805160206123f183398151915261022089015187096000805160206123f18339815191526101c08a0151820890506000805160206123f183398151915286820890506000805160206123f18339815191528284096000805160206123f183398151915282820990506000805160206123f183398151915285820990506000805160206123f1833981519152600580096000805160206123f1833981519152878a0998506000805160206123f18339815191526101a08c01518a0894506000805160206123f183398151915288860894506000805160206123f183398151915260058a0993506000805160206123f18339815191526101c08c0151850893506000805160206123f183398151915288850893506000805160206123f1833981519152818a099250506000805160206123f18339815191526101e08b0151830891506000805160206123f183398151915287830891506000805160206123f183398151915283850997506000805160206123f18339815191528289096000805160206123f1833981519152908103985085890997506000805160206123f183398151915260c08a015189089750610dde88828c61093c565b50505050505050505050565b604051600260080161028060405101610e088183606086015161112a565b9150610e1d8183610160870160e08701611063565b610e3081610120860160e086018061101d565b610e3f818360e0860180611063565b610e518160e08681019086018061101d565b50505050565b604051610280604051016000805160206123f183398151915260208301516102008501510981526000805160206123f1833981519152604083015182510881526000805160206123f18339815191526101a08401518251088152602081016000805160206123f183398151915260208401516102208601510981526000805160206123f1833981519152604084015182510881526000805160206123f18339815191526101c08501518251088152604082016000805160206123f183398151915260408501516101e08701510881526000805160206123f1833981519152825184510983526000805160206123f1833981519152815184510980845284516000805160206123f18339815191529250900982526000805160206123f18339815191526102808501518351098252606082016000805160206123f18339815191526101c08501516102c08701510881526000805160206123f1833981519152835182510881526000805160206123f183398151915260c08501516000805160206123f18339815191520382510881526000805160206123f18339815191526101e08501516102a0870151098252805161024085015281518151146102408501525050505050565b6040518251855260208301516020860152835160408601526020840151606086015260408260808760066107d05a03fa6102408201518116610240830152505050505050565b604051825185526020830151602086015283604086015260408260608760076107d05a03fa6102408201518116610240830152505050505050565b604051825185526020830151602086015283604086015260408560608760076107d05a03fa825160408701526020830151606087015260408360808860066107d05a03fa811690506102408201518116610240830152505050505050565b6000805160206123f1833981519152838351096000805160206123f183398151915281835108825250505050565b602083526020808401526020604084015280606084015250806080830152506000805160206123f183398151915260a082015260208160c08360056107d05a03fa505190565b96505050505050505b92915050565b6000806000806000806000806040516111988a8c6111ea565b805194506111a6858c6114bf565b805193506111b4848c6114e6565b805192506111c2838c611524565b516000805160206123f18339815191529485900694938490069392839006929006905061158c565b6040516467616d6d6181527f1d5408c43c22cc34434488a0cb4fa2745c3f422b0fb195724e3f1143dddc622c60208201527f1690d573abd01844ec528269be7898e259c9f1c73c3c23a365afa512c34560e060408201527f02a5a3c770a8e8595bff76358ef982e8abf95b08bf74f5c8709bc34d28484b0160608201527f0124c05f06c5d46726e89a1acccf22f64f8ce535699c27a62a6a6a6045ca363e60808201527f0f8ec3f38611514aadfd2b6fcc3b6c295badd98ffce4b65a9ea6718328ba181f60a08201527ef642ac5be0d822c5a535312d589b5557a8db3183e408fb78ff8f1c8b7b204660c08201527f1c1b525df0b18554d4dd828f8b2e607357f8253137242d14bc673861dc34e11a60e08201527f2648b5fdafc700004029fc59ff01405c410bb91cddc1b07a79342db60c64df9e6101008201527f0c850337812ad8ffa6d293490423f491c42e9befa88e42d9aa476e190f2507ee6101208201527f0e1c8948d91dab2e9fdce337e0a345a1a7f1a263a2daca6012128320e5e814696101408201526000805160206123d18339815191526101608201527f1562cf4b1044da21e79ed8a6ed7c39429ebd0084973c8d9e25268fad26be291b6101808201526000805160206123d18339815191526101a08201527f1b017f27d0ecc607d0b16d0f94051f1af8c46a0cd1353cef16f9fc69b1bed42c6101c082015260006101e0820152600061020082015260208301610220820160005b8551811015611426578251825260209283019290910190600101611407565b506103808401915060005b600181101561145a57825182526020808401519083015260409283019290910190600101611431565b506020840151815260408401516020820152606084015160408201526080840151606082015260a0840151608082015260c084015160a0820152505060208351026102c50160406001028101905060208282601b850160026107d05a03fa5050505050565b50604051636265746181528160208201526020816024601c840160026107d05a03fa505050565b60405164616c7068618152826020820152610240820151604082015261026082015160608201526020816065601b840160026107d05a03fa50505050565b604051637a657461815282602082015260e082015160408201526101008201516060820152610120820151608082015261014082015160a082015261016082015160c082015261018082015160e082015260208160e4601c840160026107d05a03fa50505050565b9299919850965090945092505050565b60008060006115b0848651602088016115ba565b506040515161181c565b6040516115c881848661161f565b60008060005b85811015611613576000805160206123f1833981519152855185510991506000805160206123f1833981519152828408602095860195949094019392506001016115ce565b50506040515250505050565b6000805160206123f18339815191526000805160206124118339815191526116498560088561112a565b086000805160206123f18339815191527f2a57c4a4850b6c2481463cffb1512d51832d6b3f6a82427f1b65b6e1720000018209905060018460005b858110156116e1576000805160206123f1833981519152836000805160206123f183398151915203860882526000805160206123f18339815191526000805160206123b18339815191528409925060209190910190600101611684565b506116ed81868861175d565b50600190508460005b85811015611754576000805160206123f1833981519152836000805160206123f1833981519152868551090982526020820191506000805160206123f18339815191526000805160206123b1833981519152840992506001016116f6565b50505050505050565b600183526000805b838110156117a15781850151828401516000805160206123f1833981519152818309905060208401935080848801525050600181019050611765565b5060208103820191508084019350506117d06020840160026000805160206123f183398151915203855161112a565b60005b83811015610bad5760208503945082516000805160206123f18339815191528651840984526000805160206123f1833981519152818409601f19909401939250506001016117d3565b61182a60405160088661112a565b91506000805160206123f18339815191526000805160206124118339815191528308604080516001808252818301909252919350600091906020808301908036833750506005602083015250905060606118866001600261217f565b67ffffffffffffffff81111561189e5761189e611fea565b6040519080825280602002602001820160405280156118c7578160200160208202803683370190505b5090506118d481896119be565b60005b60018110156119b157600061193f836118f184600261217f565b8151811061190157611901612196565b602002602001015184846002611917919061217f565b6119229060016121ac565b8151811061193257611932612196565b60200260200101516119f3565b90506000611972898b5187868151811061195b5761195b612196565b602002602001015161196d91906121ac565b611b28565b90506000805160206123f183398151915281830990506000805160206123f18339815191528187089550505080806119a9906121bf565b9150506118d7565b5050509150509392505050565b60208201610380820160005b6002811015610bad578151835260208083015190840152604092830192909101906001016119ca565b600080611a008484611c7b565b905060005b6020811015611a5e57611a1981600861217f565b82611a2583602f6121d8565b60308110611a3557611a35612196565b602002015160ff16901b83611a4a91906121ac565b925080611a56816121bf565b915050611a05565b50611a776000805160206123f1833981519152836121eb565b91506000805b6010811015611ad657611a9181600861217f565b83611a9d83600f6121d8565b60308110611aad57611aad612196565b602002015160ff16901b82611ac291906121ac565b915080611ace816121bf565b915050611a7d565b507f0e0a77c19a07df2f666ea36f7879462e36fc76959f60cd29ac96341c4ffffffb6000805160206123f183398151915281830991506000805160206123f18339815191528285089695505050505050565b600080611b81565b600060405160208152602080820152602060408201528260608201528360808201526000805160206123f183398151915260a08201526020600060c08360056107d05a03fa50506000519392505050565b611b99836000805160206123b1833981519152611b30565b6000805160206123f1833981519152816000805160206123f18339815191520386089350611bc8600886611b30565b94506000805160206123f1833981519152600080516020612411833981519152860894506000805160206123f18339815191527f2a57c4a4850b6c2481463cffb1512d51832d6b3f6a82427f1b65b6e17200000182099050611c4a7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593efffffff85611b30565b93506000805160206123f183398151915284820990506000805160206123f183398151915285820995945050505050565b611c83611fcb565b60408051808201909152600b8082526a42534232322d506c6f6e6b60a81b6020830152606090600090603090825b6040811015611cf1578484604051602001611ccd929190612231565b60405160208183030381529060405294508080611ce9906121bf565b915050611cb1565b508388888585878a87604051602001611d11989796959493929190612263565b60405160208183030381529060405293506000600285604051611d3491906122dd565b602060405180830381855afa158015611d51573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190611d7491906122f9565b90508060018784604051602001611d8e9493929190612312565b60405160208183030381529060405294506000600286604051611db191906122dd565b602060405180830381855afa158015611dce573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190611df191906122f9565b905060005b6020811015611e4357818160208110611e1157611e11612196565b1a898260308110611e2457611e24612196565b60ff909216602092909202015280611e3b816121bf565b915050611df6565b50604051600083811a9083901a1860f81b6001600160f81b031916602082015260210160408051601f19818403018152919052955060015b6020811015611ee75786828260208110611e9757611e97612196565b1a848360208110611eaa57611eaa612196565b1a60f81b60f81c18604051602001611ec3929190612231565b60405160208183030381529060405296508080611edf906121bf565b915050611e7b565b508560028885604051602001611f009493929190612358565b6040516020818303038152906040529550600286604051611f2191906122dd565b602060405180830381855afa158015611f3e573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190611f6191906122f9565b905060005b6010811015611fbd57818160208110611f8157611f81612196565b1a89611f8e8360206121ac565b60308110611f9e57611f9e612196565b60ff909216602092909202015280611fb5816121bf565b915050611f66565b505050505050505092915050565b6040518061060001604052806030906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561202957612029611fea565b604052919050565b600082601f83011261204257600080fd5b8135602067ffffffffffffffff82111561205e5761205e611fea565b8160051b61206d828201612000565b928352848101820192828101908785111561208757600080fd5b83870192505b848310156120a65782358252918301919083019061208d565b979650505050505050565b600080604083850312156120c457600080fd5b823567ffffffffffffffff808211156120dc57600080fd5b818501915085601f8301126120f057600080fd5b813560208282111561210457612104611fea565b612116601f8301601f19168201612000565b828152888284870101111561212a57600080fd5b8282860183830137600092810182019290925290945085013591508082111561215257600080fd5b5061215f85828601612031565b9150509250929050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761117957611179612169565b634e487b7160e01b600052603260045260246000fd5b8082018082111561117957611179612169565b6000600182016121d1576121d1612169565b5060010190565b8181038181111561117957611179612169565b60008261220857634e487b7160e01b600052601260045260246000fd5b500690565b60005b83811015612228578181015183820152602001612210565b50506000910152565b6000835161224381846020880161220d565b60f89390931b6001600160f81b0319169190920190815260010192915050565b60008951612275818460208e0161220d565b808301905089815288602082015260ff60f81b808960f81b166040830152808860f81b166041830152808760f81b16604283015285516122bc816043850160208a0161220d565b60f89590951b16930160438101939093525050604401979650505050505050565b600082516122ef81846020870161220d565b9190910192915050565b60006020828403121561230b57600080fd5b5051919050565b848152600060ff60f81b808660f81b166020840152845161233a81602186016020890161220d565b60f89490941b16919092016021810191909152602201949350505050565b6000855161236a818460208a0161220d565b6001600160f81b031960f887901b81169184019182528551612393816001850160208a0161220d565b60f89590951b16930160018101939093525050600201939250505056fe2b337de1c8c14f22ec9b9e2f96afef3652627366f8170a0a948dad4ac1bd5e800b7b837fbc6114cf487b04a05b3aeb8eac5dcf630284d3208d3e072b2c37843630644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000130644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000000a2646970667358221220d6cd5fc52c473bd70879247dc9113bd3ea6427c5e15c5b0b749f5a0dc811523464736f6c63430008130033" -} diff --git a/sdk/src/clients/blockchain/abis/ProxyAdmin.json b/sdk/src/clients/blockchain/abis/ProxyAdmin.json deleted file mode 100644 index 23320e913..000000000 --- a/sdk/src/clients/blockchain/abis/ProxyAdmin.json +++ /dev/null @@ -1,158 +0,0 @@ -{ - "contractName": "ProxyAdmin", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "contract ITransparentUpgradeableProxy", - "name": "proxy", - "type": "address" - }, - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeProxyAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract ITransparentUpgradeableProxy", - "name": "proxy", - "type": "address" - } - ], - "name": "getProxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract ITransparentUpgradeableProxy", - "name": "proxy", - "type": "address" - } - ], - "name": "getProxyImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract ITransparentUpgradeableProxy", - "name": "proxy", - "type": "address" - }, - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "upgrade", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract ITransparentUpgradeableProxy", - "name": "proxy", - "type": "address" - }, - { - "internalType": "address", - "name": "implementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - } - ], - "bytecode": "0x608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61069a8061007e6000396000f3fe60806040526004361061007b5760003560e01c80639623609d1161004e5780639623609d1461011157806399a88ec414610124578063f2fde38b14610144578063f3b7dead1461016457600080fd5b8063204e1c7a14610080578063715018a6146100bc5780637eff275e146100d35780638da5cb5b146100f3575b600080fd5b34801561008c57600080fd5b506100a061009b366004610499565b610184565b6040516001600160a01b03909116815260200160405180910390f35b3480156100c857600080fd5b506100d1610215565b005b3480156100df57600080fd5b506100d16100ee3660046104bd565b610229565b3480156100ff57600080fd5b506000546001600160a01b03166100a0565b6100d161011f36600461050c565b610291565b34801561013057600080fd5b506100d161013f3660046104bd565b610300565b34801561015057600080fd5b506100d161015f366004610499565b610336565b34801561017057600080fd5b506100a061017f366004610499565b6103b4565b6000806000836001600160a01b03166040516101aa90635c60da1b60e01b815260040190565b600060405180830381855afa9150503d80600081146101e5576040519150601f19603f3d011682016040523d82523d6000602084013e6101ea565b606091505b5091509150816101f957600080fd5b8080602001905181019061020d91906105e2565b949350505050565b61021d6103da565b6102276000610434565b565b6102316103da565b6040516308f2839760e41b81526001600160a01b038281166004830152831690638f283970906024015b600060405180830381600087803b15801561027557600080fd5b505af1158015610289573d6000803e3d6000fd5b505050505050565b6102996103da565b60405163278f794360e11b81526001600160a01b03841690634f1ef2869034906102c990869086906004016105ff565b6000604051808303818588803b1580156102e257600080fd5b505af11580156102f6573d6000803e3d6000fd5b5050505050505050565b6103086103da565b604051631b2ce7f360e11b81526001600160a01b038281166004830152831690633659cfe69060240161025b565b61033e6103da565b6001600160a01b0381166103a85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6103b181610434565b50565b6000806000836001600160a01b03166040516101aa906303e1469160e61b815260040190565b6000546001600160a01b031633146102275760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161039f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146103b157600080fd5b6000602082840312156104ab57600080fd5b81356104b681610484565b9392505050565b600080604083850312156104d057600080fd5b82356104db81610484565b915060208301356104eb81610484565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561052157600080fd5b833561052c81610484565b9250602084013561053c81610484565b9150604084013567ffffffffffffffff8082111561055957600080fd5b818601915086601f83011261056d57600080fd5b81358181111561057f5761057f6104f6565b604051601f8201601f19908116603f011681019083821181831017156105a7576105a76104f6565b816040528281528960208487010111156105c057600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b6000602082840312156105f457600080fd5b81516104b681610484565b60018060a01b038316815260006020604081840152835180604085015260005b8181101561063b5785810183015185820160600152820161061f565b8181111561064d576000606083870101525b50601f01601f19169290920160600194935050505056fea26469706673582212207ad53e1008cce369999f6b5f2f77109510b404ff1de9b47b639981fd68e6239264736f6c63430008090033", - "deployedBytecode": "0x60806040526004361061007b5760003560e01c80639623609d1161004e5780639623609d1461011157806399a88ec414610124578063f2fde38b14610144578063f3b7dead1461016457600080fd5b8063204e1c7a14610080578063715018a6146100bc5780637eff275e146100d35780638da5cb5b146100f3575b600080fd5b34801561008c57600080fd5b506100a061009b366004610499565b610184565b6040516001600160a01b03909116815260200160405180910390f35b3480156100c857600080fd5b506100d1610215565b005b3480156100df57600080fd5b506100d16100ee3660046104bd565b610229565b3480156100ff57600080fd5b506000546001600160a01b03166100a0565b6100d161011f36600461050c565b610291565b34801561013057600080fd5b506100d161013f3660046104bd565b610300565b34801561015057600080fd5b506100d161015f366004610499565b610336565b34801561017057600080fd5b506100a061017f366004610499565b6103b4565b6000806000836001600160a01b03166040516101aa90635c60da1b60e01b815260040190565b600060405180830381855afa9150503d80600081146101e5576040519150601f19603f3d011682016040523d82523d6000602084013e6101ea565b606091505b5091509150816101f957600080fd5b8080602001905181019061020d91906105e2565b949350505050565b61021d6103da565b6102276000610434565b565b6102316103da565b6040516308f2839760e41b81526001600160a01b038281166004830152831690638f283970906024015b600060405180830381600087803b15801561027557600080fd5b505af1158015610289573d6000803e3d6000fd5b505050505050565b6102996103da565b60405163278f794360e11b81526001600160a01b03841690634f1ef2869034906102c990869086906004016105ff565b6000604051808303818588803b1580156102e257600080fd5b505af11580156102f6573d6000803e3d6000fd5b5050505050505050565b6103086103da565b604051631b2ce7f360e11b81526001600160a01b038281166004830152831690633659cfe69060240161025b565b61033e6103da565b6001600160a01b0381166103a85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6103b181610434565b50565b6000806000836001600160a01b03166040516101aa906303e1469160e61b815260040190565b6000546001600160a01b031633146102275760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161039f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146103b157600080fd5b6000602082840312156104ab57600080fd5b81356104b681610484565b9392505050565b600080604083850312156104d057600080fd5b82356104db81610484565b915060208301356104eb81610484565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561052157600080fd5b833561052c81610484565b9250602084013561053c81610484565b9150604084013567ffffffffffffffff8082111561055957600080fd5b818601915086601f83011261056d57600080fd5b81358181111561057f5761057f6104f6565b604051601f8201601f19908116603f011681019083821181831017156105a7576105a76104f6565b816040528281528960208487010111156105c057600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b6000602082840312156105f457600080fd5b81516104b681610484565b60018060a01b038316815260006020604081840152835180604085015260005b8181101561063b5785810183015185820160600152820161061f565b8181111561064d576000606083870101525b50601f01601f19169290920160600194935050505056fea26469706673582212207ad53e1008cce369999f6b5f2f77109510b404ff1de9b47b639981fd68e6239264736f6c63430008090033", - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/sdk/src/clients/blockchain/abis/TransparentUpgradeableProxy.json b/sdk/src/clients/blockchain/abis/TransparentUpgradeableProxy.json deleted file mode 100644 index 4c00d75c3..000000000 --- a/sdk/src/clients/blockchain/abis/TransparentUpgradeableProxy.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "contractName": "TransparentUpgradeableProxy", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "bytecode": "0x608060405260405162000eda38038062000eda83398101604081905262000026916200049d565b828162000036828260006200004d565b50620000449050826200008a565b505050620005d0565b6200005883620000e5565b600082511180620000665750805b1562000085576200008383836200012760201b620001791760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f620000b562000156565b604080516001600160a01b03928316815291841660208301520160405180910390a1620000e2816200018f565b50565b620000f08162000244565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606200014f838360405180606001604052806027815260200162000eb360279139620002f8565b9392505050565b60006200018060008051602062000e9383398151915260001b6200037760201b620001a51760201c565b546001600160a01b0316919050565b6001600160a01b038116620001fa5760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b806200022360008051602062000e9383398151915260001b6200037760201b620001a51760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6200025a816200037a60201b620001a81760201c565b620002be5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620001f1565b80620002237f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b6200037760201b620001a51760201c565b6060600080856001600160a01b0316856040516200031791906200057d565b600060405180830381855af49150503d806000811462000354576040519150601f19603f3d011682016040523d82523d6000602084013e62000359565b606091505b5090925090506200036d8683838762000389565b9695505050505050565b90565b6001600160a01b03163b151590565b60608315620003fa578251620003f2576001600160a01b0385163b620003f25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401620001f1565b508162000406565b6200040683836200040e565b949350505050565b8151156200041f5781518083602001fd5b8060405162461bcd60e51b8152600401620001f191906200059b565b80516001600160a01b03811681146200045357600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200048b57818101518382015260200162000471565b83811115620000835750506000910152565b600080600060608486031215620004b357600080fd5b620004be846200043b565b9250620004ce602085016200043b565b60408501519092506001600160401b0380821115620004ec57600080fd5b818601915086601f8301126200050157600080fd5b81518181111562000516576200051662000458565b604051601f8201601f19908116603f0116810190838211818310171562000541576200054162000458565b816040528281528960208487010111156200055b57600080fd5b6200056e8360208301602088016200046e565b80955050505050509250925092565b60008251620005918184602087016200046e565b9190910192915050565b6020815260008251806020840152620005bc8160408501602087016200046e565b601f01601f19169190910160400192915050565b6108b380620005e06000396000f3fe60806040523661001357610011610017565b005b6100115b61001f6101b7565b6001600160a01b0316336001600160a01b0316141561016f5760606001600160e01b031960003516631b2ce7f360e11b8114156100655761005e6101ea565b9150610167565b6001600160e01b0319811663278f794360e11b14156100865761005e610241565b6001600160e01b031981166308f2839760e41b14156100a75761005e610287565b6001600160e01b031981166303e1469160e61b14156100c85761005e6102b8565b6001600160e01b03198116635c60da1b60e01b14156100e95761005e6102f8565b60405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b815160208301f35b61017761030c565b565b606061019e83836040518060600160405280602781526020016108576027913961031c565b9392505050565b90565b6001600160a01b03163b151590565b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b60606101f4610394565b600061020336600481846106a2565b81019061021091906106e8565b905061022d8160405180602001604052806000815250600061039f565b505060408051602081019091526000815290565b606060008061025336600481846106a2565b8101906102609190610719565b915091506102708282600161039f565b604051806020016040528060008152509250505090565b6060610291610394565b60006102a036600481846106a2565b8101906102ad91906106e8565b905061022d816103cb565b60606102c2610394565b60006102cc6101b7565b604080516001600160a01b03831660208201529192500160405160208183030381529060405291505090565b6060610302610394565b60006102cc610422565b610177610317610422565b610431565b6060600080856001600160a01b0316856040516103399190610807565b600060405180830381855af49150503d8060008114610374576040519150601f19603f3d011682016040523d82523d6000602084013e610379565b606091505b509150915061038a86838387610455565b9695505050505050565b341561017757600080fd5b6103a8836104d3565b6000825111806103b55750805b156103c6576103c48383610179565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103f46101b7565b604080516001600160a01b03928316815291841660208301520160405180910390a161041f81610513565b50565b600061042c6105bc565b905090565b3660008037600080366000845af43d6000803e808015610450573d6000f35b3d6000fd5b606083156104c15782516104ba576001600160a01b0385163b6104ba5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161015e565b50816104cb565b6104cb83836105e4565b949350505050565b6104dc8161060e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105785760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b606482015260840161015e565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6101db565b8151156105f45781518083602001fd5b8060405162461bcd60e51b815260040161015e9190610823565b6001600160a01b0381163b61067b5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161015e565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc61059b565b600080858511156106b257600080fd5b838611156106bf57600080fd5b5050820193919092039150565b80356001600160a01b03811681146106e357600080fd5b919050565b6000602082840312156106fa57600080fd5b61019e826106cc565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561072c57600080fd5b610735836106cc565b9150602083013567ffffffffffffffff8082111561075257600080fd5b818501915085601f83011261076657600080fd5b81358181111561077857610778610703565b604051601f8201601f19908116603f011681019083821181831017156107a0576107a0610703565b816040528281528860208487010111156107b957600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60005b838110156107f65781810151838201526020016107de565b838111156103c45750506000910152565b600082516108198184602087016107db565b9190910192915050565b60208152600082518060208401526108428160408501602087016107db565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122012bb4f564f73959a03513dc74fc3c6e40e8386e6f02c16b78d6db00ce0aa16af64736f6c63430008090033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b61001f6101b7565b6001600160a01b0316336001600160a01b0316141561016f5760606001600160e01b031960003516631b2ce7f360e11b8114156100655761005e6101ea565b9150610167565b6001600160e01b0319811663278f794360e11b14156100865761005e610241565b6001600160e01b031981166308f2839760e41b14156100a75761005e610287565b6001600160e01b031981166303e1469160e61b14156100c85761005e6102b8565b6001600160e01b03198116635c60da1b60e01b14156100e95761005e6102f8565b60405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b815160208301f35b61017761030c565b565b606061019e83836040518060600160405280602781526020016108576027913961031c565b9392505050565b90565b6001600160a01b03163b151590565b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b60606101f4610394565b600061020336600481846106a2565b81019061021091906106e8565b905061022d8160405180602001604052806000815250600061039f565b505060408051602081019091526000815290565b606060008061025336600481846106a2565b8101906102609190610719565b915091506102708282600161039f565b604051806020016040528060008152509250505090565b6060610291610394565b60006102a036600481846106a2565b8101906102ad91906106e8565b905061022d816103cb565b60606102c2610394565b60006102cc6101b7565b604080516001600160a01b03831660208201529192500160405160208183030381529060405291505090565b6060610302610394565b60006102cc610422565b610177610317610422565b610431565b6060600080856001600160a01b0316856040516103399190610807565b600060405180830381855af49150503d8060008114610374576040519150601f19603f3d011682016040523d82523d6000602084013e610379565b606091505b509150915061038a86838387610455565b9695505050505050565b341561017757600080fd5b6103a8836104d3565b6000825111806103b55750805b156103c6576103c48383610179565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103f46101b7565b604080516001600160a01b03928316815291841660208301520160405180910390a161041f81610513565b50565b600061042c6105bc565b905090565b3660008037600080366000845af43d6000803e808015610450573d6000f35b3d6000fd5b606083156104c15782516104ba576001600160a01b0385163b6104ba5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161015e565b50816104cb565b6104cb83836105e4565b949350505050565b6104dc8161060e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105785760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b606482015260840161015e565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6101db565b8151156105f45781518083602001fd5b8060405162461bcd60e51b815260040161015e9190610823565b6001600160a01b0381163b61067b5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161015e565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc61059b565b600080858511156106b257600080fd5b838611156106bf57600080fd5b5050820193919092039150565b80356001600160a01b03811681146106e357600080fd5b919050565b6000602082840312156106fa57600080fd5b61019e826106cc565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561072c57600080fd5b610735836106cc565b9150602083013567ffffffffffffffff8082111561075257600080fd5b818501915085601f83011261076657600080fd5b81358181111561077857610778610703565b604051601f8201601f19908116603f011681019083821181831017156107a0576107a0610703565b816040528281528860208487010111156107b957600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60005b838110156107f65781810151838201526020016107de565b838111156103c45750506000910152565b600082516108198184602087016107db565b9190910192915050565b60208152600082518060208401526108428160408501602087016107db565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122012bb4f564f73959a03513dc74fc3c6e40e8386e6f02c16b78d6db00ce0aa16af64736f6c63430008090033" -} diff --git a/sdk/src/clients/blockchain/abis/ZkEvmV2.json b/sdk/src/clients/blockchain/abis/ZkEvmV2.json deleted file mode 100644 index 526988f39..000000000 --- a/sdk/src/clients/blockchain/abis/ZkEvmV2.json +++ /dev/null @@ -1,1277 +0,0 @@ -{ - "contractName": "ZkEvmV2", - "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "BlockTimestampError", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyBlock", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - } - ], - "name": "FeePaymentFailed", - "type": "error" - }, - { - "inputs": [], - "name": "FeeTooLow", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidProof", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidProofType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "pauseType", - "type": "bytes32" - } - ], - "name": "IsNotPaused", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "pauseType", - "type": "bytes32" - } - ], - "name": "IsPaused", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "messageHash", - "type": "bytes32" - } - ], - "name": "L1L2MessageNotSent", - "type": "error" - }, - { - "inputs": [], - "name": "LimitIsZero", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "inde", - "type": "uint256" - } - ], - "name": "MemoryOutOfBounds", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "messageHash", - "type": "bytes32" - } - ], - "name": "MessageAlreadyReceived", - "type": "error" - }, - { - "inputs": [], - "name": "MessageAlreadySent", - "type": "error" - }, - { - "inputs": [], - "name": "MessageDoesNotExistOrHasAlreadyBeenClaimed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "name": "MessageSendingFailed", - "type": "error" - }, - { - "inputs": [], - "name": "NotList", - "type": "error" - }, - { - "inputs": [], - "name": "PeriodIsZero", - "type": "error" - }, - { - "inputs": [], - "name": "ProofIsEmpty", - "type": "error" - }, - { - "inputs": [], - "name": "RateLimitExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "StartingRootHashDoesNotMatch", - "type": "error" - }, - { - "inputs": [], - "name": "TransactionShort", - "type": "error" - }, - { - "inputs": [], - "name": "UnknownTransactionType", - "type": "error" - }, - { - "inputs": [], - "name": "ValueSentTooLow", - "type": "error" - }, - { - "inputs": [], - "name": "ValueShouldBeGreaterThanFee", - "type": "error" - }, - { - "inputs": [], - "name": "WrongBytesLength", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddressNotAllowed", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "resettingAddress", - "type": "address" - } - ], - "name": "AmountUsedInPeriodReset", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "stateRootHash", - "type": "bytes32" - } - ], - "name": "BlockFinalized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "lastBlockFinalized", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "startingRootHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "finalRootHash", - "type": "bytes32" - } - ], - "name": "BlocksVerificationDone", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32[]", - "name": "messageHashes", - "type": "bytes32[]" - } - ], - "name": "L1L2MessagesReceivedOnL2", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "messageHash", - "type": "bytes32" - } - ], - "name": "L2L1MessageHashAddedToInbox", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "amountChangeBy", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bool", - "name": "amountUsedLoweredToLimit", - "type": "bool" - }, - { - "indexed": false, - "internalType": "bool", - "name": "usedAmountResetToZero", - "type": "bool" - } - ], - "name": "LimitAmountChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "_messageHash", - "type": "bytes32" - } - ], - "name": "MessageClaimed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "_from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "_to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "_fee", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "_value", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "_nonce", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "_calldata", - "type": "bytes" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "_messageHash", - "type": "bytes32" - } - ], - "name": "MessageSent", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "messageSender", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "pauseType", - "type": "bytes32" - } - ], - "name": "Paused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "messageSender", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "pauseType", - "type": "bytes32" - } - ], - "name": "UnPaused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "verifierAddress", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "proofType", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "verifierSetBy", - "type": "address" - } - ], - "name": "VerifierAddressChanged", - "type": "event" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "GENERAL_PAUSE_TYPE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "INBOX_STATUS_RECEIVED", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "INBOX_STATUS_UNKNOWN", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "L1_L2_PAUSE_TYPE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "L2_L1_PAUSE_TYPE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "OPERATOR_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "OUTBOX_STATUS_RECEIVED", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "OUTBOX_STATUS_SENT", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "OUTBOX_STATUS_UNKNOWN", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "PAUSE_MANAGER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "PROVING_SYSTEM_PAUSE_TYPE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "RATE_LIMIT_SETTER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_from", - "type": "address" - }, - { - "internalType": "address", - "name": "_to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_fee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_value", - "type": "uint256" - }, - { - "internalType": "address payable", - "name": "_feeRecipient", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_calldata", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "_nonce", - "type": "uint256" - } - ], - "name": "claimMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "currentL2BlockNumber", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "currentPeriodAmountInWei", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "currentPeriodEnd", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "currentTimestamp", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "blockRootHash", - "type": "bytes32" - }, - { - "internalType": "uint32", - "name": "l2BlockTimestamp", - "type": "uint32" - }, - { - "internalType": "bytes[]", - "name": "transactions", - "type": "bytes[]" - }, - { - "internalType": "bytes32[]", - "name": "l2ToL1MsgHashes", - "type": "bytes32[]" - }, - { - "internalType": "bytes", - "name": "fromAddresses", - "type": "bytes" - }, - { - "internalType": "uint16[]", - "name": "batchReceptionIndices", - "type": "uint16[]" - } - ], - "internalType": "struct IZkEvmV2.BlockData[]", - "name": "_blocksData", - "type": "tuple[]" - }, - { - "internalType": "bytes", - "name": "_proof", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "_proofType", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "_parentStateRootHash", - "type": "bytes32" - } - ], - "name": "finalizeBlocks", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "blockRootHash", - "type": "bytes32" - }, - { - "internalType": "uint32", - "name": "l2BlockTimestamp", - "type": "uint32" - }, - { - "internalType": "bytes[]", - "name": "transactions", - "type": "bytes[]" - }, - { - "internalType": "bytes32[]", - "name": "l2ToL1MsgHashes", - "type": "bytes32[]" - }, - { - "internalType": "bytes", - "name": "fromAddresses", - "type": "bytes" - }, - { - "internalType": "uint16[]", - "name": "batchReceptionIndices", - "type": "uint16[]" - } - ], - "internalType": "struct IZkEvmV2.BlockData[]", - "name": "_blocksData", - "type": "tuple[]" - } - ], - "name": "finalizeBlocksWithoutProof", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "inboxL2L1MessageStatus", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_initialStateRootHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_initialL2BlockNumber", - "type": "uint256" - }, - { - "internalType": "address", - "name": "_defaultVerifier", - "type": "address" - }, - { - "internalType": "address", - "name": "_securityCouncil", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_operators", - "type": "address[]" - }, - { - "internalType": "uint256", - "name": "_rateLimitPeriodInSeconds", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_rateLimitAmountInWei", - "type": "uint256" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "limitInWei", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "nextMessageNumber", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "outboxL1L2MessageStatus", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_pauseType", - "type": "bytes32" - } - ], - "name": "pauseByType", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "pauseTypeStatuses", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "periodInSeconds", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "resetAmountUsedInPeriod", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "resetRateLimitAmount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_fee", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_calldata", - "type": "bytes" - } - ], - "name": "sendMessage", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "sender", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_newVerifierAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_proofType", - "type": "uint256" - } - ], - "name": "setVerifierAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "stateRootHashes", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_pauseType", - "type": "bytes32" - } - ], - "name": "unPauseByType", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "verifiers", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "bytecode": "0x60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61403c80620000f46000396000f3fe6080604052600436106102d55760003560e01c80638be745d111610179578063b45a4f2c116100d6578063c1dc0f071161008a578063d547741f11610064578063d547741f1461085f578063d84f91e81461087f578063f5b541a6146108b357600080fd5b8063c1dc0f07146107f9578063c21169741461080f578063cc5782f61461082f57600080fd5b8063b837dbe9116100bb578063b837dbe914610799578063bf3e7505146107af578063c0729ab1146107e357600080fd5b8063b45a4f2c14610745578063b4a5a4b71461076557600080fd5b8063a217fddf1161012d578063ac1eff6811610112578063ac1eff68146106d6578063ad422ff01461071a578063aea4f7451461073057600080fd5b8063a217fddf1461068d578063abd6230d146106a257600080fd5b806391d148541161015e57806391d1485414610627578063986fcddd146105a45780639f3ce55a1461067a57600080fd5b80638be745d1146105d957806390dad3f61461060757600080fd5b8063557eac7311610232578063695378f5116101e65780637973ead6116101c05780637973ead6146105845780637d1e8c55146105a45780638264bd82146105b957600080fd5b8063695378f5146105245780636a6379671461053b57806373bd07b71461056f57600080fd5b80635b7eb4bd116102175780635b7eb4bd1461042e5780635c721a0c146104ab57806367e404ce146104d857600080fd5b8063557eac7314610475578063587944561461049557600080fd5b806336568abe116102895780634165d6dd1161026e5780634165d6dd1461040e57806348922ab71461042e578063491e09361461045557600080fd5b806336568abe146103c15780633fc08b65146103e157600080fd5b80631e2ff94f116102ba5780631e2ff94f14610358578063248a9ca31461036f5780632f2ff15d1461039f57600080fd5b806301ffc9a7146102e157806311314d0f1461031657600080fd5b366102dc57005b600080fd5b3480156102ed57600080fd5b506103016102fc3660046133d0565b6108e7565b60405190151581526020015b60405180910390f35b34801561032257600080fd5b5061034a7f9a80e24e463f00a8763c4dcec6a92d07d33272fa5db895d8589be70dccb002df81565b60405190815260200161030d565b34801561036457600080fd5b5061034a6101185481565b34801561037b57600080fd5b5061034a61038a366004613412565b60009081526065602052604090206001015490565b3480156103ab57600080fd5b506103bf6103ba36600461344d565b610980565b005b3480156103cd57600080fd5b506103bf6103dc36600461344d565b6109aa565b3480156103ed57600080fd5b5061034a6103fc366004613412565b60a56020526000908152604090205481565b34801561041a57600080fd5b506103bf61042936600461350b565b610a62565b34801561043a57600080fd5b50610443600181565b60405160ff909116815260200161030d565b34801561046157600080fd5b506103bf610470366004613589565b610b7e565b34801561048157600080fd5b506103bf610490366004613412565b610f26565b3480156104a157600080fd5b5061034a60995481565b3480156104b757600080fd5b5061034a6104c6366004613412565b60a66020526000908152604090205481565b3480156104e457600080fd5b5060e55473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161030d565b34801561053057600080fd5b5061034a6101195481565b34801561054757600080fd5b5061034a7f06193bb948d6b7a6fcbe51c193ccf2183bb5d979b6ae5d3a6971b8851461d3b081565b34801561057b57600080fd5b50610443600281565b34801561059057600080fd5b506103bf61059f36600461361f565b610fee565b3480156105b057600080fd5b50610443600081565b3480156105c557600080fd5b506103bf6105d4366004613412565b611334565b3480156105e557600080fd5b5061034a6105f4366004613412565b61011a6020526000908152604090205481565b34801561061357600080fd5b506103bf6106223660046136aa565b6113fa565b34801561063357600080fd5b5061030161064236600461344d565b600091825260656020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b6103bf6106883660046136ec565b611454565b34801561069957600080fd5b5061034a600081565b3480156106ae57600080fd5b5061034a7f21ea2f4fee4bcb623de15ac222ea5c1464307d884f23394b78ddc07f9c9c7cd881565b3480156106e257600080fd5b506104ff6106f1366004613412565b61011b6020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b34801561072657600080fd5b5061034a60985481565b34801561073c57600080fd5b506103bf61161d565b34801561075157600080fd5b506103bf610760366004613412565b611679565b34801561077157600080fd5b5061034a7f3a56b1bd788a764cbd923badb6d0719f21f520455285bf6877e636d08708878d81565b3480156107a557600080fd5b5061034a60e45481565b3480156107bb57600080fd5b5061034a7f1185e52d62bfbbea270e57d3d09733d221b53ab7a18bae82bb3c6c74bab16d8281565b3480156107ef57600080fd5b5061034a609a5481565b34801561080557600080fd5b5061034a60975481565b34801561081b57600080fd5b506103bf61082a366004613748565b611708565b34801561083b57600080fd5b5061030161084a366004613412565b60d96020526000908152604090205460ff1681565b34801561086b57600080fd5b506103bf61087a36600461344d565b6117fa565b34801561088b57600080fd5b5061034a7f356a809dfdea9198dd76fb76bf6d403ecf13ea675eb89e1eda2db2c4a4676a2681565b3480156108bf57600080fd5b5061034a7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92981565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061097a57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526065602052604090206001015461099b8161181f565b6109a5838361182c565b505050565b73ffffffffffffffffffffffffffffffffffffffff81163314610a54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b610a5e8282611920565b5050565b7f3a56b1bd788a764cbd923badb6d0719f21f520455285bf6877e636d08708878d610a8c816119db565b7f06193bb948d6b7a6fcbe51c193ccf2183bb5d979b6ae5d3a6971b8851461d3b0610ab6816119db565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929610ae08161181f565b61011954600090815261011a60205260409020548414610b2c576040517fead4c30e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610b73898989898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b92508a915060019050611a27565b505050505050505050565b8587848460005a9050610bb07f21ea2f4fee4bcb623de15ac222ea5c1464307d884f23394b78ddc07f9c9c7cd86119db565b610bd97f06193bb948d6b7a6fcbe51c193ccf2183bb5d979b6ae5d3a6971b8851461d3b06119db565b60008d8d8d8d8a8d8d604051602001610bf897969594939291906137bd565b604051602081830303815290604052805190602001209050610c1981611f04565b610c2b610c268c8e613845565b611f5d565b8d60e560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808e73ffffffffffffffffffffffffffffffffffffffff168d8c8c604051610c97929190613858565b60006040518083038185875af1925050503d8060008114610cd4576040519150601f19603f3d011682016040523d82523d6000602084013e610cd9565b606091505b509150915081610d4357805115610cf35780518082602001fd5b8e6040517f54613443000000000000000000000000000000000000000000000000000000008152600401610a4b919073ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b8d15610e2557600073ffffffffffffffffffffffffffffffffffffffff8d1615610d6d578c610d6f565b335b90508073ffffffffffffffffffffffffffffffffffffffff168f60405160006040518083038185875af1925050503d8060008114610dc9576040519150601f19603f3d011682016040523d82523d6000602084013e610dce565b606091505b50508093505082610e23576040517fa57c4df400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610a4b565b505b60e580547fffffffffffffffffffffffff00000000000000000000000000000000000000001663075bcd1517905560405183907fa4c827e719e911e8f19393ccdb85b5102f08f0910604d340ba38390b7ff2ab0e90600090a2505050600085118015610e8f575081155b15610f1757833b158015610f155760003a5a617d0085010302905080871115610f135760405173ffffffffffffffffffffffffffffffffffffffff87169082890390600081818185875af1925050503d8060008114610f0a576040519150601f19603f3d011682016040523d82523d6000602084013e610f0f565b606091505b5050505b505b505b50505050505050505050505050565b7f1185e52d62bfbbea270e57d3d09733d221b53ab7a18bae82bb3c6c74bab16d82610f508161181f565b6000806000426099541015610f7757609754610f6c9042613845565b609955506001610f89565b609a54851015610f8957849250600191505b60988590558080610f975750815b15610fa257609a8390555b60408051868152831515602082015282151581830152905133917fbc3dc0cb5c15c51c81316450d44048838bb478b9809447d01c766a06f3e9f2c8919081900360600190a25050505050565b600054610100900460ff161580801561100e5750600054600160ff909116105b806110285750303b158015611028575060005460ff166001145b6110b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610a4b565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561111257600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b73ffffffffffffffffffffffffffffffffffffffff871661115f576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8481101561123857600086868381811061117e5761117e613868565b90506020020160208101906111939190613897565b73ffffffffffffffffffffffffffffffffffffffff16036111e0576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6112307f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92987878481811061121657611216613868565b905060200201602081019061122b9190613897565b61182c565b600101611162565b5061124460008761182c565b61125086878585611fd3565b7f033d11f27e62ab919708ec716731da80d261a6e4253259b7acde9bf89d28ec1880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8916179055610119889055600088815261011a602052604090208990558015610b7357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050505050505050565b8061133e816119db565b7f356a809dfdea9198dd76fb76bf6d403ecf13ea675eb89e1eda2db2c4a4676a266113688161181f565b600083815260d96020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557fc343aefb875672fb1857ecda2bdf9fa822ff1e924e3714f6a3d88c5199dee2616113c73390565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252602082018690520160405180910390a1505050565b7f06193bb948d6b7a6fcbe51c193ccf2183bb5d979b6ae5d3a6971b8851461d3b0611424816119db565b600061142f8161181f565b6040805160008082526020820190925261144e91869186918080611a27565b50505050565b7f9a80e24e463f00a8763c4dcec6a92d07d33272fa5db895d8589be70dccb002df61147e816119db565b7f06193bb948d6b7a6fcbe51c193ccf2183bb5d979b6ae5d3a6971b8851461d3b06114a8816119db565b73ffffffffffffffffffffffffffffffffffffffff86166114f5576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3485111561152f576040517fb03b693200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60e454600061153e87346138e3565b9050600033898984868b8b60405160200161155f97969594939291906137bd565b60405160208183030381529060405280519060200120905061158f81600090815260a56020526040902060019055565b60e4805490600061159f836138f6565b9190505550808973ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe856c2b8bd4eb0027ce32eeaf595c21b0b6b4644b326e5b7bd80a1cf8db72e6c8b86888d8d60405161160a95949392919061392e565b60405180910390a4505050505050505050565b7f1185e52d62bfbbea270e57d3d09733d221b53ab7a18bae82bb3c6c74bab16d826116478161181f565b6000609a81905560405133917fba88c025b0cbb77022c0c487beef24f759f1e4be2f51a205bc427cee19c2eaa691a250565b80611683816121b3565b7f356a809dfdea9198dd76fb76bf6d403ecf13ea675eb89e1eda2db2c4a4676a266116ad8161181f565b600083815260d96020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557fb54c82d9fabaaa460c07181bb36c08c0e72d79293e77a42ac273c81d2a54281b336113c7565b60006117138161181f565b73ffffffffffffffffffffffffffffffffffffffff8316611760576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040513390839073ffffffffffffffffffffffffffffffffffffffff8616907f4ea861139068e7701a770b8975bb54b6f8f446897fac206dd29424035b4a61eb90600090a450600090815261011b6020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6000828152606560205260409020600101546118158161181f565b6109a58383611920565b61182981336121fe565b50565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610a5e57600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556118c23390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1615610a5e57600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600081815260d9602052604090205460ff1615611829576040517f8698dd2b00000000000000000000000000000000000000000000000000000000815260048101829052602401610a4b565b610119546000611a38826001613845565b905060008767ffffffffffffffff811115611a5557611a556138b4565b604051908082528060200260200182016040528015611a7e578160200160208202803683370190505b50905060008867ffffffffffffffff811115611a9c57611a9c6138b4565b604051908082528060200260200182016040528015611ac5578160200160208202803683370190505b5090506000611ad58a6001613845565b67ffffffffffffffff811115611aed57611aed6138b4565b604051908082528060200260200182016040528015611b16578160200160208202803683370190505b5090508681600081518110611b2d57611b2d613868565b60200260200101818152505060008060005b8c811015611d6b57368e8e83818110611b5a57611b5a613868565b9050602002810190611b6c919061395f565b905042611b7f604083016020840161399d565b63ffffffff1610611bbc576040517fd4a3081200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611bde611bcc60408301836139c3565b611bd960a08501856139c3565b6122b8565b9350611bf5611bf060608301836139c3565b612452565b9250611c00896138f6565b98508383611c1160a08401846139c3565b604051602001611c22929190613a42565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190528051602090910120611c656080850185613a7d565b604051611c73929190613858565b604051908190038120611ca19493929160200193845260208401929092526040830152606082015260800190565b60405160208183030381529060405280519060200120868381518110611cc957611cc9613868565b602002602001018181525050806020016020810190611ce8919061399d565b63ffffffff16878381518110611d0057611d00613868565b6020908102919091010152803585611d19846001613845565b81518110611d2957611d29613868565b60209081029190910101526040518135908a907ff2c535759092d16e9334a11dd9b52eca543f1d9cca5ba9d16c472aef009de43290600090a350600101611b3f565b508c8c611d796001826138e3565b818110611d8857611d88613868565b9050602002810190611d9a919061395f565b600088815261011a60205260409020903590558c8c611dba6001826138e3565b818110611dc957611dc9613868565b9050602002810190611ddb919061395f565b611dec90604081019060200161399d565b63ffffffff16610118556101198790558715610f1757610f177f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000185604051602001611e379190613ae2565b604051602081830303815290604052805190602001208888604051602001611e5f9190613ae2565b6040516020818303038152906040528051906020012087604051602001611e869190613ae2565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120908301959095528101929092526060820152608081019190915260a0016040516020818303038152906040528051906020012060001c611efc9190613b18565b8b8d8c6124b9565b600081815260a66020526040902054600114611f4c576040517fa273b9e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600090815260a66020526040812055565b6000426099541015611f8057609754611f769042613845565b6099555080611f91565b81609a54611f8e9190613845565b90505b609854811115611fcd576040517fa74c1c5f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b609a5550565b600054610100900460ff1661206a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a4b565b73ffffffffffffffffffffffffffffffffffffffff84166120b7576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8316612104576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61210c612683565b612114612683565b61211c612683565b612126828261271c565b6121507f1185e52d62bfbbea270e57d3d09733d221b53ab7a18bae82bb3c6c74bab16d828561182c565b61217a7f356a809dfdea9198dd76fb76bf6d403ecf13ea675eb89e1eda2db2c4a4676a268461182c565b5050600160e455505060e580547fffffffffffffffffffffffff00000000000000000000000000000000000000001663075bcd15179055565b600081815260d9602052604090205460ff16611829576040517f15d8d2e100000000000000000000000000000000000000000000000000000000815260048101829052602401610a4b565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610a5e5761223e81612842565b612249836020612861565b60405160200161225a929190613b77565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a0000000000000000000000000000000000000000000000000000000008252610a4b91600401613c42565b6000808467ffffffffffffffff8111156122d4576122d46138b4565b6040519080825280602002602001820160405280156122fd578160200160208202803683370190505b509050600085900361233b576040517f8999649c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b838110156123b4576123ac6123a76123a2898989898781811061236357612363613868565b90506020020160208101906123789190613c55565b61ffff1681811061238b5761238b613868565b905060200281019061239d9190613a7d565b612aab565b612c38565b612c7b565b60010161233e565b5060005b8581101561241f578686828181106123d2576123d2613868565b90506020028101906123e49190613a7d565b6040516123f2929190613858565b604051809103902082828151811061240c5761240c613868565b60209081029190910101526001016123b8565b50806040516020016124319190613ae2565b60405160208183030381529060405280519060200120915050949350505050565b6000805b828110156124875761247f84848381811061247357612473613868565b90506020020135612d56565b600101612456565b50828260405160200161249b929190613c70565b60405160208183030381529060405280519060200120905092915050565b6040805160018082528183019092526000916020808301908036833701905050905084816000815181106124ef576124ef613868565b602090810291909101810191909152600085815261011b909152604090205473ffffffffffffffffffffffffffffffffffffffff168061255b576040517f69ed70ab00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f7e4f7a8a00000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff831690637e4f7a8a906125b29088908790600401613cb2565b6020604051808303816000875af11580156125d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125f59190613d09565b90508061262e576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61011954600081815261011a6020908152604091829020548251888152918201527f5c885a794662ebe3b08ae0874fc2c88b5343b0223ba9cd2cad92b69c0d0c901f910160405180910390a250505050505050565b600054610100900460ff1661271a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a4b565b565b600054610100900460ff166127b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a4b565b816000036127ed576040517fb5ed5a3b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600003612827576040517fd10d72bb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6097829055609881905561283b8242613845565b6099555050565b606061097a73ffffffffffffffffffffffffffffffffffffffff831660145b60606000612870836002613d2b565b61287b906002613845565b67ffffffffffffffff811115612893576128936138b4565b6040519080825280601f01601f1916602001820160405280156128bd576020820181803683370190505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106128f4576128f4613868565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061295757612957613868565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000612993846002613d2b565b61299e906001613845565b90505b6001811115612a3b577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106129df576129df613868565b1a60f81b8282815181106129f5576129f5613868565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93612a3481613d42565b90506129a1565b508315612aa4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610a4b565b9392505050565b60606001821015612ae8576040517fbac5bf1b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600083836000818110612afd57612afd613868565b909101357fff00000000000000000000000000000000000000000000000000000000000000169150507f0100000000000000000000000000000000000000000000000000000000000000819003612b6057612b588484612ddb565b91505061097a565b7fff0000000000000000000000000000000000000000000000000000000000000081167f020000000000000000000000000000000000000000000000000000000000000003612bb357612b588484612e5a565b7fc0000000000000000000000000000000000000000000000000000000000000007fff00000000000000000000000000000000000000000000000000000000000000821610612c0657612b588484612eca565b6040517fe95a14a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8101600483019081529160609161097a9190810160200190602401613d77565b805160005b81811015612d1a576000838281518110612c9c57612c9c613868565b602090810291909101810151600081815260a590925260409091205490915080612cf5576040517f62a064c500000000000000000000000000000000000000000000000000000000815260048101839052602401610a4b565b60028114612d1057600082815260a560205260409020600290555b5050600101612c80565b507f95e84bb4317676921a29fd1d13f8f0153508473b899c12b3cd08314348801d6482604051612d4a9190613e53565b60405180910390a15050565b600081815260a6602052604090205415612d9f576040517fee49e00100000000000000000000000000000000000000000000000000000000815260048101829052602401610a4b565b600081815260a66020526040808220600190555182917f810484e22f73d8f099aaee1edb851ec6be6d84d43045d0a7803e5f7b3612edce91a250565b60606000612dec8360018187613e97565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250939450612e2e9250849150612f2f9050565b90506000612e3b82612f54565b9050612e50612e4b826007612fe3565b6130f7565b9695505050505050565b60606000612e6b8360018187613e97565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250939450612ead9250849150612f2f9050565b90506000612eba82612f54565b9050612e50612e4b826008612fe3565b6060600083838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250939450612f129250849150612f2f9050565b90506000612f1f82612f54565b9050612e50612e4b826006612fe3565b6040805180820190915260008082526020808301918252835183529290920190915290565b6040805160808101825260009181018281526060820183905281526020810191909152612f80826131a2565b612fb6576040517f0600783200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612fc583602001516131dd565b8360200151612fd49190613845565b92825250602081019190915290565b60408051808201909152600080825260208083018290528451015180518290811a8160f882106001811461301c57801561302757613041565b60c083039550613041565b60f783039150600185019450816020036101000a85510495505b5060208801518486019350600061305782613258565b90506130638183613845565b60208b015260005b61307660018b6138e3565b8110156130e3578a602001519250858311156130c1576040517f78268bbb00000000000000000000000000000000000000000000000000000000815260048101879052602401610a4b565b6130ca83613258565b91506130d68284613845565b60208c015260010161306b565b508752602087015250939695505050505050565b8051606090600003613135576040517f5780864900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008061314184613307565b915091508067ffffffffffffffff81111561315e5761315e6138b4565b6040519080825280601f01601f191660200182016040528015613188576020820181803683370190505b5092506020830161319a83828461334e565b505050919050565b805160009081036131b557506000919050565b6020820151805160001a9060c08210156131d3575060009392505050565b5060019392505050565b8051600090811a60808110156131f65750600092915050565b60b8811080613211575060c08110801590613211575060f881105b1561321f5750600192915050565b60c081101561324c57613234600160b8613ec1565b6132419060ff16826138e3565b612aa4906001613845565b613234600160f8613ec1565b805160009081908190811a608081101561327557600192506132fe565b60b881101561329b576132896080826138e3565b613294906001613845565b92506132fe565b60c08110156132c95760b78103600186019550806020036101000a86510492506001810183019350506132fe565b60f88110156132dd5761328960c0826138e3565b60f78103600186019550806020036101000a86510492506001810183019350505b50909392505050565b600080600061331984602001516131dd565b9050600081856020015161332d9190613845565b9050600082866000015161334191906138e3565b9196919550909350505050565b8060000361335b57505050565b602081106133935782518252613372602084613845565b925061337f602083613845565b915061338c6020826138e3565b905061335b565b80156109a557600060016133a88360206138e3565b6133b490610100613ffa565b6133be91906138e3565b84518451821691191617835250505050565b6000602082840312156133e257600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114612aa457600080fd5b60006020828403121561342457600080fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461182957600080fd5b6000806040838503121561346057600080fd5b8235915060208301356134728161342b565b809150509250929050565b60008083601f84011261348f57600080fd5b50813567ffffffffffffffff8111156134a757600080fd5b6020830191508360208260051b85010111156134c257600080fd5b9250929050565b60008083601f8401126134db57600080fd5b50813567ffffffffffffffff8111156134f357600080fd5b6020830191508360208285010111156134c257600080fd5b6000806000806000806080878903121561352457600080fd5b863567ffffffffffffffff8082111561353c57600080fd5b6135488a838b0161347d565b9098509650602089013591508082111561356157600080fd5b5061356e89828a016134c9565b979a9699509760408101359660609091013595509350505050565b60008060008060008060008060e0898b0312156135a557600080fd5b88356135b08161342b565b975060208901356135c08161342b565b9650604089013595506060890135945060808901356135de8161342b565b935060a089013567ffffffffffffffff8111156135fa57600080fd5b6136068b828c016134c9565b999c989b50969995989497949560c00135949350505050565b60008060008060008060008060e0898b03121561363b57600080fd5b883597506020890135965060408901356136548161342b565b955060608901356136648161342b565b9450608089013567ffffffffffffffff81111561368057600080fd5b61368c8b828c0161347d565b999c989b5096999598969760a08701359660c0013595509350505050565b600080602083850312156136bd57600080fd5b823567ffffffffffffffff8111156136d457600080fd5b6136e08582860161347d565b90969095509350505050565b6000806000806060858703121561370257600080fd5b843561370d8161342b565b935060208501359250604085013567ffffffffffffffff81111561373057600080fd5b61373c878288016134c9565b95989497509550505050565b6000806040838503121561375b57600080fd5b82356137668161342b565b946020939093013593505050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b600073ffffffffffffffffffffffffffffffffffffffff808a16835280891660208401525086604083015285606083015284608083015260c060a083015261380960c083018486613774565b9998505050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561097a5761097a613816565b8183823760009101908152919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000602082840312156138a957600080fd5b8135612aa48161342b565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b8181038181111561097a5761097a613816565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361392757613927613816565b5060010190565b858152846020820152836040820152608060608201526000613954608083018486613774565b979650505050505050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4183360301811261399357600080fd5b9190910192915050565b6000602082840312156139af57600080fd5b813563ffffffff81168114612aa457600080fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126139f857600080fd5b83018035915067ffffffffffffffff821115613a1357600080fd5b6020019150600581901b36038213156134c257600080fd5b803561ffff81168114613a3d57600080fd5b919050565b60008184825b85811015613a725761ffff613a5c83613a2b565b1683526020928301929190910190600101613a48565b509095945050505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613ab257600080fd5b83018035915067ffffffffffffffff821115613acd57600080fd5b6020019150368190038213156134c257600080fd5b815160009082906020808601845b83811015613b0c57815185529382019390820190600101613af0565b50929695505050505050565b600082613b4e577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500690565b60005b83811015613b6e578181015183820152602001613b56565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613baf816017850160208801613b53565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351613bec816028840160208801613b53565b01602801949350505050565b60008151808452613c10816020860160208601613b53565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000612aa46020830184613bf8565b600060208284031215613c6757600080fd5b612aa482613a2b565b60007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115613c9f57600080fd5b8260051b80858437919091019392505050565b604081526000613cc56040830185613bf8565b82810360208481019190915284518083528582019282019060005b81811015613cfc57845183529383019391830191600101613ce0565b5090979650505050505050565b600060208284031215613d1b57600080fd5b81518015158114612aa457600080fd5b808202811582820484141761097a5761097a613816565b600081613d5157613d51613816565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b60006020808385031215613d8a57600080fd5b825167ffffffffffffffff80821115613da257600080fd5b818501915085601f830112613db657600080fd5b815181811115613dc857613dc86138b4565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108582111715613e0b57613e0b6138b4565b604052918252848201925083810185019188831115613e2957600080fd5b938501935b82851015613e4757845184529385019392850192613e2e565b98975050505050505050565b6020808252825182820181905260009190848201906040850190845b81811015613e8b57835183529284019291840191600101613e6f565b50909695505050505050565b60008085851115613ea757600080fd5b83861115613eb457600080fd5b5050820193919092039150565b60ff828116828216039081111561097a5761097a613816565b600181815b80851115613f3357817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115613f1957613f19613816565b80851615613f2657918102915b93841c9390800290613edf565b509250929050565b600082613f4a5750600161097a565b81613f575750600061097a565b8160018114613f6d5760028114613f7757613f93565b600191505061097a565b60ff841115613f8857613f88613816565b50506001821b61097a565b5060208310610133831016604e8410600b8410161715613fb6575081810a61097a565b613fc08383613eda565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115613ff257613ff2613816565b029392505050565b6000612aa48383613f3b56fea2646970667358221220e920190dc5ee2650bee3330da3323ce884f941c79e220bdf0bff10056a7b632a64736f6c63430008130033", - "deployedBytecode": "0x6080604052600436106102d55760003560e01c80638be745d111610179578063b45a4f2c116100d6578063c1dc0f071161008a578063d547741f11610064578063d547741f1461085f578063d84f91e81461087f578063f5b541a6146108b357600080fd5b8063c1dc0f07146107f9578063c21169741461080f578063cc5782f61461082f57600080fd5b8063b837dbe9116100bb578063b837dbe914610799578063bf3e7505146107af578063c0729ab1146107e357600080fd5b8063b45a4f2c14610745578063b4a5a4b71461076557600080fd5b8063a217fddf1161012d578063ac1eff6811610112578063ac1eff68146106d6578063ad422ff01461071a578063aea4f7451461073057600080fd5b8063a217fddf1461068d578063abd6230d146106a257600080fd5b806391d148541161015e57806391d1485414610627578063986fcddd146105a45780639f3ce55a1461067a57600080fd5b80638be745d1146105d957806390dad3f61461060757600080fd5b8063557eac7311610232578063695378f5116101e65780637973ead6116101c05780637973ead6146105845780637d1e8c55146105a45780638264bd82146105b957600080fd5b8063695378f5146105245780636a6379671461053b57806373bd07b71461056f57600080fd5b80635b7eb4bd116102175780635b7eb4bd1461042e5780635c721a0c146104ab57806367e404ce146104d857600080fd5b8063557eac7314610475578063587944561461049557600080fd5b806336568abe116102895780634165d6dd1161026e5780634165d6dd1461040e57806348922ab71461042e578063491e09361461045557600080fd5b806336568abe146103c15780633fc08b65146103e157600080fd5b80631e2ff94f116102ba5780631e2ff94f14610358578063248a9ca31461036f5780632f2ff15d1461039f57600080fd5b806301ffc9a7146102e157806311314d0f1461031657600080fd5b366102dc57005b600080fd5b3480156102ed57600080fd5b506103016102fc3660046133d0565b6108e7565b60405190151581526020015b60405180910390f35b34801561032257600080fd5b5061034a7f9a80e24e463f00a8763c4dcec6a92d07d33272fa5db895d8589be70dccb002df81565b60405190815260200161030d565b34801561036457600080fd5b5061034a6101185481565b34801561037b57600080fd5b5061034a61038a366004613412565b60009081526065602052604090206001015490565b3480156103ab57600080fd5b506103bf6103ba36600461344d565b610980565b005b3480156103cd57600080fd5b506103bf6103dc36600461344d565b6109aa565b3480156103ed57600080fd5b5061034a6103fc366004613412565b60a56020526000908152604090205481565b34801561041a57600080fd5b506103bf61042936600461350b565b610a62565b34801561043a57600080fd5b50610443600181565b60405160ff909116815260200161030d565b34801561046157600080fd5b506103bf610470366004613589565b610b7e565b34801561048157600080fd5b506103bf610490366004613412565b610f26565b3480156104a157600080fd5b5061034a60995481565b3480156104b757600080fd5b5061034a6104c6366004613412565b60a66020526000908152604090205481565b3480156104e457600080fd5b5060e55473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161030d565b34801561053057600080fd5b5061034a6101195481565b34801561054757600080fd5b5061034a7f06193bb948d6b7a6fcbe51c193ccf2183bb5d979b6ae5d3a6971b8851461d3b081565b34801561057b57600080fd5b50610443600281565b34801561059057600080fd5b506103bf61059f36600461361f565b610fee565b3480156105b057600080fd5b50610443600081565b3480156105c557600080fd5b506103bf6105d4366004613412565b611334565b3480156105e557600080fd5b5061034a6105f4366004613412565b61011a6020526000908152604090205481565b34801561061357600080fd5b506103bf6106223660046136aa565b6113fa565b34801561063357600080fd5b5061030161064236600461344d565b600091825260656020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b6103bf6106883660046136ec565b611454565b34801561069957600080fd5b5061034a600081565b3480156106ae57600080fd5b5061034a7f21ea2f4fee4bcb623de15ac222ea5c1464307d884f23394b78ddc07f9c9c7cd881565b3480156106e257600080fd5b506104ff6106f1366004613412565b61011b6020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b34801561072657600080fd5b5061034a60985481565b34801561073c57600080fd5b506103bf61161d565b34801561075157600080fd5b506103bf610760366004613412565b611679565b34801561077157600080fd5b5061034a7f3a56b1bd788a764cbd923badb6d0719f21f520455285bf6877e636d08708878d81565b3480156107a557600080fd5b5061034a60e45481565b3480156107bb57600080fd5b5061034a7f1185e52d62bfbbea270e57d3d09733d221b53ab7a18bae82bb3c6c74bab16d8281565b3480156107ef57600080fd5b5061034a609a5481565b34801561080557600080fd5b5061034a60975481565b34801561081b57600080fd5b506103bf61082a366004613748565b611708565b34801561083b57600080fd5b5061030161084a366004613412565b60d96020526000908152604090205460ff1681565b34801561086b57600080fd5b506103bf61087a36600461344d565b6117fa565b34801561088b57600080fd5b5061034a7f356a809dfdea9198dd76fb76bf6d403ecf13ea675eb89e1eda2db2c4a4676a2681565b3480156108bf57600080fd5b5061034a7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92981565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061097a57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526065602052604090206001015461099b8161181f565b6109a5838361182c565b505050565b73ffffffffffffffffffffffffffffffffffffffff81163314610a54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b610a5e8282611920565b5050565b7f3a56b1bd788a764cbd923badb6d0719f21f520455285bf6877e636d08708878d610a8c816119db565b7f06193bb948d6b7a6fcbe51c193ccf2183bb5d979b6ae5d3a6971b8851461d3b0610ab6816119db565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929610ae08161181f565b61011954600090815261011a60205260409020548414610b2c576040517fead4c30e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610b73898989898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b92508a915060019050611a27565b505050505050505050565b8587848460005a9050610bb07f21ea2f4fee4bcb623de15ac222ea5c1464307d884f23394b78ddc07f9c9c7cd86119db565b610bd97f06193bb948d6b7a6fcbe51c193ccf2183bb5d979b6ae5d3a6971b8851461d3b06119db565b60008d8d8d8d8a8d8d604051602001610bf897969594939291906137bd565b604051602081830303815290604052805190602001209050610c1981611f04565b610c2b610c268c8e613845565b611f5d565b8d60e560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808e73ffffffffffffffffffffffffffffffffffffffff168d8c8c604051610c97929190613858565b60006040518083038185875af1925050503d8060008114610cd4576040519150601f19603f3d011682016040523d82523d6000602084013e610cd9565b606091505b509150915081610d4357805115610cf35780518082602001fd5b8e6040517f54613443000000000000000000000000000000000000000000000000000000008152600401610a4b919073ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b8d15610e2557600073ffffffffffffffffffffffffffffffffffffffff8d1615610d6d578c610d6f565b335b90508073ffffffffffffffffffffffffffffffffffffffff168f60405160006040518083038185875af1925050503d8060008114610dc9576040519150601f19603f3d011682016040523d82523d6000602084013e610dce565b606091505b50508093505082610e23576040517fa57c4df400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610a4b565b505b60e580547fffffffffffffffffffffffff00000000000000000000000000000000000000001663075bcd1517905560405183907fa4c827e719e911e8f19393ccdb85b5102f08f0910604d340ba38390b7ff2ab0e90600090a2505050600085118015610e8f575081155b15610f1757833b158015610f155760003a5a617d0085010302905080871115610f135760405173ffffffffffffffffffffffffffffffffffffffff87169082890390600081818185875af1925050503d8060008114610f0a576040519150601f19603f3d011682016040523d82523d6000602084013e610f0f565b606091505b5050505b505b505b50505050505050505050505050565b7f1185e52d62bfbbea270e57d3d09733d221b53ab7a18bae82bb3c6c74bab16d82610f508161181f565b6000806000426099541015610f7757609754610f6c9042613845565b609955506001610f89565b609a54851015610f8957849250600191505b60988590558080610f975750815b15610fa257609a8390555b60408051868152831515602082015282151581830152905133917fbc3dc0cb5c15c51c81316450d44048838bb478b9809447d01c766a06f3e9f2c8919081900360600190a25050505050565b600054610100900460ff161580801561100e5750600054600160ff909116105b806110285750303b158015611028575060005460ff166001145b6110b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610a4b565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561111257600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b73ffffffffffffffffffffffffffffffffffffffff871661115f576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8481101561123857600086868381811061117e5761117e613868565b90506020020160208101906111939190613897565b73ffffffffffffffffffffffffffffffffffffffff16036111e0576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6112307f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92987878481811061121657611216613868565b905060200201602081019061122b9190613897565b61182c565b600101611162565b5061124460008761182c565b61125086878585611fd3565b7f033d11f27e62ab919708ec716731da80d261a6e4253259b7acde9bf89d28ec1880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8916179055610119889055600088815261011a602052604090208990558015610b7357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050505050505050565b8061133e816119db565b7f356a809dfdea9198dd76fb76bf6d403ecf13ea675eb89e1eda2db2c4a4676a266113688161181f565b600083815260d96020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557fc343aefb875672fb1857ecda2bdf9fa822ff1e924e3714f6a3d88c5199dee2616113c73390565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252602082018690520160405180910390a1505050565b7f06193bb948d6b7a6fcbe51c193ccf2183bb5d979b6ae5d3a6971b8851461d3b0611424816119db565b600061142f8161181f565b6040805160008082526020820190925261144e91869186918080611a27565b50505050565b7f9a80e24e463f00a8763c4dcec6a92d07d33272fa5db895d8589be70dccb002df61147e816119db565b7f06193bb948d6b7a6fcbe51c193ccf2183bb5d979b6ae5d3a6971b8851461d3b06114a8816119db565b73ffffffffffffffffffffffffffffffffffffffff86166114f5576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3485111561152f576040517fb03b693200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60e454600061153e87346138e3565b9050600033898984868b8b60405160200161155f97969594939291906137bd565b60405160208183030381529060405280519060200120905061158f81600090815260a56020526040902060019055565b60e4805490600061159f836138f6565b9190505550808973ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe856c2b8bd4eb0027ce32eeaf595c21b0b6b4644b326e5b7bd80a1cf8db72e6c8b86888d8d60405161160a95949392919061392e565b60405180910390a4505050505050505050565b7f1185e52d62bfbbea270e57d3d09733d221b53ab7a18bae82bb3c6c74bab16d826116478161181f565b6000609a81905560405133917fba88c025b0cbb77022c0c487beef24f759f1e4be2f51a205bc427cee19c2eaa691a250565b80611683816121b3565b7f356a809dfdea9198dd76fb76bf6d403ecf13ea675eb89e1eda2db2c4a4676a266116ad8161181f565b600083815260d96020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557fb54c82d9fabaaa460c07181bb36c08c0e72d79293e77a42ac273c81d2a54281b336113c7565b60006117138161181f565b73ffffffffffffffffffffffffffffffffffffffff8316611760576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040513390839073ffffffffffffffffffffffffffffffffffffffff8616907f4ea861139068e7701a770b8975bb54b6f8f446897fac206dd29424035b4a61eb90600090a450600090815261011b6020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6000828152606560205260409020600101546118158161181f565b6109a58383611920565b61182981336121fe565b50565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610a5e57600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556118c23390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1615610a5e57600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600081815260d9602052604090205460ff1615611829576040517f8698dd2b00000000000000000000000000000000000000000000000000000000815260048101829052602401610a4b565b610119546000611a38826001613845565b905060008767ffffffffffffffff811115611a5557611a556138b4565b604051908082528060200260200182016040528015611a7e578160200160208202803683370190505b50905060008867ffffffffffffffff811115611a9c57611a9c6138b4565b604051908082528060200260200182016040528015611ac5578160200160208202803683370190505b5090506000611ad58a6001613845565b67ffffffffffffffff811115611aed57611aed6138b4565b604051908082528060200260200182016040528015611b16578160200160208202803683370190505b5090508681600081518110611b2d57611b2d613868565b60200260200101818152505060008060005b8c811015611d6b57368e8e83818110611b5a57611b5a613868565b9050602002810190611b6c919061395f565b905042611b7f604083016020840161399d565b63ffffffff1610611bbc576040517fd4a3081200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611bde611bcc60408301836139c3565b611bd960a08501856139c3565b6122b8565b9350611bf5611bf060608301836139c3565b612452565b9250611c00896138f6565b98508383611c1160a08401846139c3565b604051602001611c22929190613a42565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190528051602090910120611c656080850185613a7d565b604051611c73929190613858565b604051908190038120611ca19493929160200193845260208401929092526040830152606082015260800190565b60405160208183030381529060405280519060200120868381518110611cc957611cc9613868565b602002602001018181525050806020016020810190611ce8919061399d565b63ffffffff16878381518110611d0057611d00613868565b6020908102919091010152803585611d19846001613845565b81518110611d2957611d29613868565b60209081029190910101526040518135908a907ff2c535759092d16e9334a11dd9b52eca543f1d9cca5ba9d16c472aef009de43290600090a350600101611b3f565b508c8c611d796001826138e3565b818110611d8857611d88613868565b9050602002810190611d9a919061395f565b600088815261011a60205260409020903590558c8c611dba6001826138e3565b818110611dc957611dc9613868565b9050602002810190611ddb919061395f565b611dec90604081019060200161399d565b63ffffffff16610118556101198790558715610f1757610f177f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000185604051602001611e379190613ae2565b604051602081830303815290604052805190602001208888604051602001611e5f9190613ae2565b6040516020818303038152906040528051906020012087604051602001611e869190613ae2565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120908301959095528101929092526060820152608081019190915260a0016040516020818303038152906040528051906020012060001c611efc9190613b18565b8b8d8c6124b9565b600081815260a66020526040902054600114611f4c576040517fa273b9e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600090815260a66020526040812055565b6000426099541015611f8057609754611f769042613845565b6099555080611f91565b81609a54611f8e9190613845565b90505b609854811115611fcd576040517fa74c1c5f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b609a5550565b600054610100900460ff1661206a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a4b565b73ffffffffffffffffffffffffffffffffffffffff84166120b7576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8316612104576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61210c612683565b612114612683565b61211c612683565b612126828261271c565b6121507f1185e52d62bfbbea270e57d3d09733d221b53ab7a18bae82bb3c6c74bab16d828561182c565b61217a7f356a809dfdea9198dd76fb76bf6d403ecf13ea675eb89e1eda2db2c4a4676a268461182c565b5050600160e455505060e580547fffffffffffffffffffffffff00000000000000000000000000000000000000001663075bcd15179055565b600081815260d9602052604090205460ff16611829576040517f15d8d2e100000000000000000000000000000000000000000000000000000000815260048101829052602401610a4b565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610a5e5761223e81612842565b612249836020612861565b60405160200161225a929190613b77565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a0000000000000000000000000000000000000000000000000000000008252610a4b91600401613c42565b6000808467ffffffffffffffff8111156122d4576122d46138b4565b6040519080825280602002602001820160405280156122fd578160200160208202803683370190505b509050600085900361233b576040517f8999649c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b838110156123b4576123ac6123a76123a2898989898781811061236357612363613868565b90506020020160208101906123789190613c55565b61ffff1681811061238b5761238b613868565b905060200281019061239d9190613a7d565b612aab565b612c38565b612c7b565b60010161233e565b5060005b8581101561241f578686828181106123d2576123d2613868565b90506020028101906123e49190613a7d565b6040516123f2929190613858565b604051809103902082828151811061240c5761240c613868565b60209081029190910101526001016123b8565b50806040516020016124319190613ae2565b60405160208183030381529060405280519060200120915050949350505050565b6000805b828110156124875761247f84848381811061247357612473613868565b90506020020135612d56565b600101612456565b50828260405160200161249b929190613c70565b60405160208183030381529060405280519060200120905092915050565b6040805160018082528183019092526000916020808301908036833701905050905084816000815181106124ef576124ef613868565b602090810291909101810191909152600085815261011b909152604090205473ffffffffffffffffffffffffffffffffffffffff168061255b576040517f69ed70ab00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f7e4f7a8a00000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff831690637e4f7a8a906125b29088908790600401613cb2565b6020604051808303816000875af11580156125d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125f59190613d09565b90508061262e576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61011954600081815261011a6020908152604091829020548251888152918201527f5c885a794662ebe3b08ae0874fc2c88b5343b0223ba9cd2cad92b69c0d0c901f910160405180910390a250505050505050565b600054610100900460ff1661271a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a4b565b565b600054610100900460ff166127b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a4b565b816000036127ed576040517fb5ed5a3b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600003612827576040517fd10d72bb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6097829055609881905561283b8242613845565b6099555050565b606061097a73ffffffffffffffffffffffffffffffffffffffff831660145b60606000612870836002613d2b565b61287b906002613845565b67ffffffffffffffff811115612893576128936138b4565b6040519080825280601f01601f1916602001820160405280156128bd576020820181803683370190505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106128f4576128f4613868565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061295757612957613868565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000612993846002613d2b565b61299e906001613845565b90505b6001811115612a3b577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106129df576129df613868565b1a60f81b8282815181106129f5576129f5613868565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93612a3481613d42565b90506129a1565b508315612aa4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610a4b565b9392505050565b60606001821015612ae8576040517fbac5bf1b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600083836000818110612afd57612afd613868565b909101357fff00000000000000000000000000000000000000000000000000000000000000169150507f0100000000000000000000000000000000000000000000000000000000000000819003612b6057612b588484612ddb565b91505061097a565b7fff0000000000000000000000000000000000000000000000000000000000000081167f020000000000000000000000000000000000000000000000000000000000000003612bb357612b588484612e5a565b7fc0000000000000000000000000000000000000000000000000000000000000007fff00000000000000000000000000000000000000000000000000000000000000821610612c0657612b588484612eca565b6040517fe95a14a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8101600483019081529160609161097a9190810160200190602401613d77565b805160005b81811015612d1a576000838281518110612c9c57612c9c613868565b602090810291909101810151600081815260a590925260409091205490915080612cf5576040517f62a064c500000000000000000000000000000000000000000000000000000000815260048101839052602401610a4b565b60028114612d1057600082815260a560205260409020600290555b5050600101612c80565b507f95e84bb4317676921a29fd1d13f8f0153508473b899c12b3cd08314348801d6482604051612d4a9190613e53565b60405180910390a15050565b600081815260a6602052604090205415612d9f576040517fee49e00100000000000000000000000000000000000000000000000000000000815260048101829052602401610a4b565b600081815260a66020526040808220600190555182917f810484e22f73d8f099aaee1edb851ec6be6d84d43045d0a7803e5f7b3612edce91a250565b60606000612dec8360018187613e97565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250939450612e2e9250849150612f2f9050565b90506000612e3b82612f54565b9050612e50612e4b826007612fe3565b6130f7565b9695505050505050565b60606000612e6b8360018187613e97565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250939450612ead9250849150612f2f9050565b90506000612eba82612f54565b9050612e50612e4b826008612fe3565b6060600083838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250939450612f129250849150612f2f9050565b90506000612f1f82612f54565b9050612e50612e4b826006612fe3565b6040805180820190915260008082526020808301918252835183529290920190915290565b6040805160808101825260009181018281526060820183905281526020810191909152612f80826131a2565b612fb6576040517f0600783200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612fc583602001516131dd565b8360200151612fd49190613845565b92825250602081019190915290565b60408051808201909152600080825260208083018290528451015180518290811a8160f882106001811461301c57801561302757613041565b60c083039550613041565b60f783039150600185019450816020036101000a85510495505b5060208801518486019350600061305782613258565b90506130638183613845565b60208b015260005b61307660018b6138e3565b8110156130e3578a602001519250858311156130c1576040517f78268bbb00000000000000000000000000000000000000000000000000000000815260048101879052602401610a4b565b6130ca83613258565b91506130d68284613845565b60208c015260010161306b565b508752602087015250939695505050505050565b8051606090600003613135576040517f5780864900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008061314184613307565b915091508067ffffffffffffffff81111561315e5761315e6138b4565b6040519080825280601f01601f191660200182016040528015613188576020820181803683370190505b5092506020830161319a83828461334e565b505050919050565b805160009081036131b557506000919050565b6020820151805160001a9060c08210156131d3575060009392505050565b5060019392505050565b8051600090811a60808110156131f65750600092915050565b60b8811080613211575060c08110801590613211575060f881105b1561321f5750600192915050565b60c081101561324c57613234600160b8613ec1565b6132419060ff16826138e3565b612aa4906001613845565b613234600160f8613ec1565b805160009081908190811a608081101561327557600192506132fe565b60b881101561329b576132896080826138e3565b613294906001613845565b92506132fe565b60c08110156132c95760b78103600186019550806020036101000a86510492506001810183019350506132fe565b60f88110156132dd5761328960c0826138e3565b60f78103600186019550806020036101000a86510492506001810183019350505b50909392505050565b600080600061331984602001516131dd565b9050600081856020015161332d9190613845565b9050600082866000015161334191906138e3565b9196919550909350505050565b8060000361335b57505050565b602081106133935782518252613372602084613845565b925061337f602083613845565b915061338c6020826138e3565b905061335b565b80156109a557600060016133a88360206138e3565b6133b490610100613ffa565b6133be91906138e3565b84518451821691191617835250505050565b6000602082840312156133e257600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114612aa457600080fd5b60006020828403121561342457600080fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461182957600080fd5b6000806040838503121561346057600080fd5b8235915060208301356134728161342b565b809150509250929050565b60008083601f84011261348f57600080fd5b50813567ffffffffffffffff8111156134a757600080fd5b6020830191508360208260051b85010111156134c257600080fd5b9250929050565b60008083601f8401126134db57600080fd5b50813567ffffffffffffffff8111156134f357600080fd5b6020830191508360208285010111156134c257600080fd5b6000806000806000806080878903121561352457600080fd5b863567ffffffffffffffff8082111561353c57600080fd5b6135488a838b0161347d565b9098509650602089013591508082111561356157600080fd5b5061356e89828a016134c9565b979a9699509760408101359660609091013595509350505050565b60008060008060008060008060e0898b0312156135a557600080fd5b88356135b08161342b565b975060208901356135c08161342b565b9650604089013595506060890135945060808901356135de8161342b565b935060a089013567ffffffffffffffff8111156135fa57600080fd5b6136068b828c016134c9565b999c989b50969995989497949560c00135949350505050565b60008060008060008060008060e0898b03121561363b57600080fd5b883597506020890135965060408901356136548161342b565b955060608901356136648161342b565b9450608089013567ffffffffffffffff81111561368057600080fd5b61368c8b828c0161347d565b999c989b5096999598969760a08701359660c0013595509350505050565b600080602083850312156136bd57600080fd5b823567ffffffffffffffff8111156136d457600080fd5b6136e08582860161347d565b90969095509350505050565b6000806000806060858703121561370257600080fd5b843561370d8161342b565b935060208501359250604085013567ffffffffffffffff81111561373057600080fd5b61373c878288016134c9565b95989497509550505050565b6000806040838503121561375b57600080fd5b82356137668161342b565b946020939093013593505050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b600073ffffffffffffffffffffffffffffffffffffffff808a16835280891660208401525086604083015285606083015284608083015260c060a083015261380960c083018486613774565b9998505050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561097a5761097a613816565b8183823760009101908152919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000602082840312156138a957600080fd5b8135612aa48161342b565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b8181038181111561097a5761097a613816565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361392757613927613816565b5060010190565b858152846020820152836040820152608060608201526000613954608083018486613774565b979650505050505050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4183360301811261399357600080fd5b9190910192915050565b6000602082840312156139af57600080fd5b813563ffffffff81168114612aa457600080fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126139f857600080fd5b83018035915067ffffffffffffffff821115613a1357600080fd5b6020019150600581901b36038213156134c257600080fd5b803561ffff81168114613a3d57600080fd5b919050565b60008184825b85811015613a725761ffff613a5c83613a2b565b1683526020928301929190910190600101613a48565b509095945050505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613ab257600080fd5b83018035915067ffffffffffffffff821115613acd57600080fd5b6020019150368190038213156134c257600080fd5b815160009082906020808601845b83811015613b0c57815185529382019390820190600101613af0565b50929695505050505050565b600082613b4e577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500690565b60005b83811015613b6e578181015183820152602001613b56565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613baf816017850160208801613b53565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351613bec816028840160208801613b53565b01602801949350505050565b60008151808452613c10816020860160208601613b53565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000612aa46020830184613bf8565b600060208284031215613c6757600080fd5b612aa482613a2b565b60007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115613c9f57600080fd5b8260051b80858437919091019392505050565b604081526000613cc56040830185613bf8565b82810360208481019190915284518083528582019282019060005b81811015613cfc57845183529383019391830191600101613ce0565b5090979650505050505050565b600060208284031215613d1b57600080fd5b81518015158114612aa457600080fd5b808202811582820484141761097a5761097a613816565b600081613d5157613d51613816565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b60006020808385031215613d8a57600080fd5b825167ffffffffffffffff80821115613da257600080fd5b818501915085601f830112613db657600080fd5b815181811115613dc857613dc86138b4565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108582111715613e0b57613e0b6138b4565b604052918252848201925083810185019188831115613e2957600080fd5b938501935b82851015613e4757845184529385019392850192613e2e565b98975050505050505050565b6020808252825182820181905260009190848201906040850190845b81811015613e8b57835183529284019291840191600101613e6f565b50909695505050505050565b60008085851115613ea757600080fd5b83861115613eb457600080fd5b5050820193919092039150565b60ff828116828216039081111561097a5761097a613816565b600181815b80851115613f3357817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115613f1957613f19613816565b80851615613f2657918102915b93841c9390800290613edf565b509250929050565b600082613f4a5750600161097a565b81613f575750600061097a565b8160018114613f6d5760028114613f7757613f93565b600191505061097a565b60ff841115613f8857613f88613816565b50506001821b61097a565b5060208310610133831016604e8410600b8410161715613fb6575081810a61097a565b613fc08383613eda565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115613ff257613ff2613816565b029392505050565b6000612aa48383613f3b56fea2646970667358221220e920190dc5ee2650bee3330da3323ce884f941c79e220bdf0bff10056a7b632a64736f6c63430008130033" -} diff --git a/sdk/src/clients/blockchain/linea/L2ChainQuerier.ts b/sdk/src/clients/blockchain/linea/L2ChainQuerier.ts deleted file mode 100644 index 71f5f18bd..000000000 --- a/sdk/src/clients/blockchain/linea/L2ChainQuerier.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { BlockTag, JsonRpcProvider, Signer, dataSlice, toNumber } from "ethers"; -import { ChainQuerier } from "../ChainQuerier"; -import { BlockExtraData } from "../../../core/clients/blockchain/linea/IL2ChainQuerier"; - -export class L2ChainQuerier extends ChainQuerier { - private blockExtraDataCache: BlockExtraData; - private cacheIsValidForBlockNumber: bigint; - - /** - * Creates an instance of `L2ChainQuerier`. - * - * @param {JsonRpcProvider} provider - The JSON RPC provider for interacting with the Ethereum network. - * @param {Signer} [signer] - An optional Ethers.js signer object for signing transactions. - */ - constructor(provider: JsonRpcProvider, signer?: Signer) { - super(provider, signer); - } - - /** - * Fetches and format extra data from a block. - * - * @param {BlockTag} blockNumber - The block number or tag to fetch extra data for. - * @returns {Promise} A promise that resolves to an object containing the formatted block's extra data, or null if the block is not found. - */ - public async getBlockExtraData(blockNumber: BlockTag): Promise { - if (typeof blockNumber === "number" && this.isCacheValid(blockNumber)) { - return this.blockExtraDataCache; - } - - const block = await this.getBlock(blockNumber); - - if (!block) { - return null; - } - - const version = dataSlice(block.extraData, 0, 1); - const fixedCost = dataSlice(block.extraData, 1, 5); - const variableCost = dataSlice(block.extraData, 5, 9); - const ethGasPrice = dataSlice(block.extraData, 9, 13); - - // original values are in Kwei and here we convert them back to wei - const extraData = { - version: toNumber(version), - fixedCost: toNumber(fixedCost) * 1000, - variableCost: toNumber(variableCost) * 1000, - ethGasPrice: toNumber(ethGasPrice) * 1000, - }; - - if (typeof blockNumber === "number") { - this.cacheIsValidForBlockNumber = BigInt(blockNumber); - this.blockExtraDataCache = extraData; - } - return extraData; - } - - /** - * Checks if the cached block extra data is still valid based on the current block number. - * - * @private - * @param {number} currentBlockNumber - The current block number. - * @returns {boolean} True if the cache is valid, false otherwise. - */ - private isCacheValid(currentBlockNumber: number): boolean { - return this.cacheIsValidForBlockNumber >= BigInt(currentBlockNumber); - } -} diff --git a/sdk/src/clients/blockchain/linea/__tests__/L2ChainQuerier.test.ts b/sdk/src/clients/blockchain/linea/__tests__/L2ChainQuerier.test.ts deleted file mode 100644 index d463fc212..000000000 --- a/sdk/src/clients/blockchain/linea/__tests__/L2ChainQuerier.test.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { Block, JsonRpcProvider, Wallet } from "ethers"; -import { describe, afterEach, it, beforeEach } from "@jest/globals"; -import { MockProxy, mock, mockClear } from "jest-mock-extended"; -import { L2ChainQuerier } from "../L2ChainQuerier"; -import { TEST_L1_SIGNER_PRIVATE_KEY } from "../../../../utils/testing/constants"; - -describe("L2ChainQuerier", () => { - let providerMock: MockProxy; - let chainQuerier: L2ChainQuerier; - beforeEach(() => { - providerMock = mock(); - chainQuerier = new L2ChainQuerier(providerMock, new Wallet(TEST_L1_SIGNER_PRIVATE_KEY, providerMock)); - }); - - afterEach(() => { - mockClear(providerMock); - }); - - describe("getBlockExtraData", () => { - it("should return block extraData", async () => { - const blockMocked: Block = { - baseFeePerGas: 7n, - difficulty: 2n, - extraData: - "0x0100989680015eb3c80000ea600000000000000000000000000000000000000024997ceb570c667b9c369d351b384ce97dcfe0dda90696fc3b007b8d7160672548a6716cc33ffe0e4004c555a0c7edd9ddc2545a630f2276a2964dcf856e6ab501", - gasLimit: 61000000n, - gasUsed: 138144n, - hash: "0xc53d0f6b65feabf0422bb897d3f5de2c32d57612f88eb4a366d8076a040a715a", - miner: "0x0000000000000000000000000000000000000000", - nonce: "0x0000000000000000", - number: 1635519, - parentHash: "0xecc7bd0b6d533b13fc65529e5da174062d93f8f426c32929914a375f00a19cc3", - receiptsRoot: "0x0cfd91942f25f029d50078225749dbd8601dd922713e783e4210568ed45b6cd3", - stateRoot: "0xad1346e81f574b511c917cd76c5b70f1d6852b871569bedd9ef02160746e3ffa", - timestamp: 1718030601, - transactions: [], - provider: providerMock, - parentBeaconBlockRoot: null, - blobGasUsed: null, - excessBlobGas: null, - } as unknown as Block; - jest.spyOn(providerMock, "getBlock").mockResolvedValue(blockMocked); - - expect(await chainQuerier.getBlockExtraData("latest")).toStrictEqual({ - version: 1, - fixedCost: 10000000000, - variableCost: 22983624000, - ethGasPrice: 60000000, - }); - }); - }); -}); diff --git a/sdk/src/clients/blockchain/ethereum/EthersLineaRollupLogClient.ts b/sdk/src/clients/ethereum/EthersLineaRollupLogClient.ts similarity index 92% rename from sdk/src/clients/blockchain/ethereum/EthersLineaRollupLogClient.ts rename to sdk/src/clients/ethereum/EthersLineaRollupLogClient.ts index b314b08ab..2e2500e52 100644 --- a/sdk/src/clients/blockchain/ethereum/EthersLineaRollupLogClient.ts +++ b/sdk/src/clients/ethereum/EthersLineaRollupLogClient.ts @@ -1,15 +1,19 @@ -import { JsonRpcProvider } from "ethers"; import { MessageSentEventFilters, ILineaRollupLogClient, L2MessagingBlockAnchoredFilters, MessageClaimedFilters, -} from "../../../core/clients/blockchain/ethereum/ILineaRollupLogClient"; -import { L2MessagingBlockAnchored, MessageClaimed, MessageSent } from "../../../core/types/Events"; -import { LineaRollup, LineaRollup__factory } from "../typechain"; -import { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog } from "../typechain/common"; -import { L2MessagingBlockAnchoredEvent, MessageClaimedEvent, MessageSentEvent } from "../typechain/LineaRollup"; -import { isUndefined } from "../../../core/utils/shared"; +} from "../../core/clients/ethereum"; +import { L2MessagingBlockAnchored, MessageClaimed, MessageSent } from "../../core/types"; +import { LineaRollup, LineaRollup__factory } from "../../contracts/typechain"; +import { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog } from "../../contracts/typechain/common"; +import { + L2MessagingBlockAnchoredEvent, + MessageClaimedEvent, + MessageSentEvent, +} from "../../contracts/typechain/LineaRollup"; +import { isUndefined } from "../../core/utils"; +import { BrowserProvider, Provider } from "../providers"; export class EthersLineaRollupLogClient implements ILineaRollupLogClient { private lineaRollup: LineaRollup; @@ -17,10 +21,10 @@ export class EthersLineaRollupLogClient implements ILineaRollupLogClient { /** * Initializes a new instance of the `EthersLineaRollupLogClient`. * - * @param {JsonRpcProvider} provider - The JSON RPC provider for interacting with the Ethereum network. + * @param {Provider | BrowserProvider} provider - The JSON RPC provider for interacting with the Ethereum network. * @param {string} contractAddress - The address of the Linea Rollup contract. */ - constructor(provider: JsonRpcProvider, contractAddress: string) { + constructor(provider: Provider | BrowserProvider, contractAddress: string) { this.lineaRollup = LineaRollup__factory.connect(contractAddress, provider); } diff --git a/sdk/src/sdk/claiming/L1ClaimingService.ts b/sdk/src/clients/ethereum/L1ClaimingService.ts similarity index 92% rename from sdk/src/sdk/claiming/L1ClaimingService.ts rename to sdk/src/clients/ethereum/L1ClaimingService.ts index 2562e01f6..aacfacedc 100644 --- a/sdk/src/sdk/claiming/L1ClaimingService.ts +++ b/sdk/src/clients/ethereum/L1ClaimingService.ts @@ -1,13 +1,18 @@ -import { Overrides, ContractTransactionResponse, Signer, TransactionReceipt, TransactionResponse } from "ethers"; -import { OnChainMessageStatus } from "../../core/enums/MessageEnums"; -import { Cache } from "../Cache"; -import { ILineaRollupClient } from "../../core/clients/blockchain/ethereum/ILineaRollupClient"; -import { IL2MessageServiceClient } from "../../core/clients/blockchain/linea/IL2MessageServiceClient"; -import { IL2MessageServiceLogClient } from "../../core/clients/blockchain/linea/IL2MessageServiceLogClient"; -import { MessageSent } from "../../core/types/Events"; -import { BaseError } from "../../core/errors/Base"; -import { Network } from "../config"; -import { FinalizationMessagingInfo, Proof } from "../../core/clients/blockchain/ethereum/IMerkleTreeService"; +import { + Overrides, + ContractTransactionResponse, + Signer, + TransactionReceipt, + TransactionResponse, + ErrorDescription, +} from "ethers"; +import { OnChainMessageStatus } from "../../core/enums/message"; +import { Cache } from "../../utils/Cache"; +import { ILineaRollupClient } from "../../core/clients/ethereum"; +import { IL2MessageServiceClient, IL2MessageServiceLogClient } from "../../core/clients/linea"; +import { MessageSent, Network } from "../../core/types"; +import { BaseError } from "../../core/errors"; +import { FinalizationMessagingInfo, Proof } from "../../core/clients/ethereum/IMerkleTreeService"; export class L1ClaimingService { private cache: Cache; @@ -25,14 +30,16 @@ export class L1ClaimingService { Overrides, TransactionReceipt, TransactionResponse, - ContractTransactionResponse + ContractTransactionResponse, + ErrorDescription >, public readonly l2ContractClient: IL2MessageServiceClient< Overrides, TransactionReceipt, TransactionResponse, ContractTransactionResponse, - Signer + Signer, + ErrorDescription >, public readonly l2EventLogClient: IL2MessageServiceLogClient, private readonly network: Network, diff --git a/sdk/src/clients/blockchain/ethereum/LineaRollupClient.ts b/sdk/src/clients/ethereum/LineaRollupClient.ts similarity index 88% rename from sdk/src/clients/blockchain/ethereum/LineaRollupClient.ts rename to sdk/src/clients/ethereum/LineaRollupClient.ts index 3d5e775f7..81e157cec 100644 --- a/sdk/src/clients/blockchain/ethereum/LineaRollupClient.ts +++ b/sdk/src/clients/ethereum/LineaRollupClient.ts @@ -1,48 +1,53 @@ import { Overrides, ContractTransactionResponse, - JsonRpcProvider, TransactionRequest, TransactionResponse, Signer, TransactionReceipt, Block, + ErrorDescription, } from "ethers"; -import { LineaRollup, LineaRollup__factory } from "../typechain"; -import { GasEstimationError } from "../../../core/errors/GasFeeErrors"; -import { Message, MessageProps } from "../../../core/entities/Message"; -import { OnChainMessageStatus } from "../../../core/enums/MessageEnums"; +import { LineaRollup, LineaRollup__factory } from "../../contracts/typechain"; +import { BaseError, GasEstimationError } from "../../core/errors"; +import { Message, SDKMode, MessageSent } from "../../core/types"; +import { OnChainMessageStatus } from "../../core/enums"; import { MESSAGE_UNKNOWN_STATUS, MESSAGE_CLAIMED_STATUS, ZERO_ADDRESS, DEFAULT_RATE_LIMIT_MARGIN, -} from "../../../core/constants"; -import { ILineaRollupClient } from "../../../core/clients/blockchain/ethereum/ILineaRollupClient"; -import { ILineaRollupLogClient } from "../../../core/clients/blockchain/ethereum/ILineaRollupLogClient"; -import { IL2MessageServiceLogClient } from "../../../core/clients/blockchain/linea/IL2MessageServiceLogClient"; -import { BaseError } from "../../../core/errors/Base"; -import { SDKMode } from "../../../sdk/config"; -import { formatMessageStatus } from "../../../core/utils/message"; -import { GasFees, IEthereumGasProvider } from "../../../core/clients/blockchain/IGasProvider"; -import { IMessageRetriever } from "../../../core/clients/blockchain/IMessageRetriever"; +} from "../../core/constants"; import { + ILineaRollupClient, + ILineaRollupLogClient, FinalizationMessagingInfo, IMerkleTreeService, Proof, -} from "../../../core/clients/blockchain/ethereum/IMerkleTreeService"; -import { MessageSent } from "../../../core/types/Events"; -import { IChainQuerier } from "../../../core/clients/blockchain/IChainQuerier"; +} from "../../core/clients/ethereum"; +import { IL2MessageServiceLogClient } from "../../core/clients/linea"; +import { formatMessageStatus, isString } from "../../core/utils"; +import { GasFees, IEthereumGasProvider } from "../../core/clients/IGasProvider"; +import { IMessageRetriever } from "../../core/clients/IMessageRetriever"; +import { IProvider } from "../../core/clients/IProvider"; +import { BrowserProvider, Provider } from "../providers"; export class LineaRollupClient - implements ILineaRollupClient + implements + ILineaRollupClient< + Overrides, + TransactionReceipt, + TransactionResponse, + ContractTransactionResponse, + ErrorDescription + > { private readonly contract: LineaRollup; /** * @notice Initializes a new instance of the `LineaRollupClient`. * @dev This constructor sets up the Linea Rollup Client with the necessary dependencies and configurations. - * @param {IChainQuerier} chainQuerier The chain querier for interacting with the blockchain. + * @param {ethers.Provider} provider The provider for interacting with the blockchain. * @param {string} contractAddress The address of the Linea Rollup contract. * @param {ILineaRollupLogClient} lineaRollupLogClient An instance of a class implementing the `ILineaRollupLogClient` interface for fetching events from the blockchain. * @param {IL2MessageServiceLogClient} l2MessageServiceLogClient An instance of a class implementing the `IL2MessageServiceLogClient` interface for fetching events from the blockchain. @@ -53,12 +58,12 @@ export class LineaRollupClient * @param {Signer} signer An optional Ethers.js signer object for signing transactions. */ constructor( - private readonly chainQuerier: IChainQuerier< + private readonly provider: IProvider< TransactionReceipt, Block, TransactionRequest, TransactionResponse, - JsonRpcProvider + Provider | BrowserProvider >, private readonly contractAddress: string, private readonly lineaRollupLogClient: ILineaRollupLogClient, @@ -154,7 +159,7 @@ export class LineaRollupClient */ private getContract(contractAddress: string, signer?: Signer): LineaRollup { if (this.mode === "read-only") { - return LineaRollup__factory.connect(contractAddress, this.chainQuerier.getProvider()); + return LineaRollup__factory.connect(contractAddress, this.provider); } if (!signer) { @@ -234,12 +239,12 @@ export class LineaRollupClient /** * Estimates the gas required for the claimMessage transaction. - * @param {MessageProps & { feeRecipient?: string }} message - The message information. + * @param {Message & { feeRecipient?: string }} message - The message information. * @param {Overrides} [overrides={}] - Ethers payable overrides. Defaults to `{}` if not specified. * @returns {Promise} The estimated transaction gas. */ public async estimateClaimWithoutProofGas( - message: MessageProps & { feeRecipient?: string }, + message: Message & { feeRecipient?: string }, overrides: Overrides = {}, ): Promise { if (this.mode === "read-only") { @@ -270,12 +275,12 @@ export class LineaRollupClient /** * Claims the message on L1 without merkle tree (for message sent before the migration). - * @param {MessageProps & { feeRecipient?: string }} message - The message information. + * @param {Message & { feeRecipient?: string }} message - The message information. * @param {Overrides} [overrides={}] - Ethers payable overrides. Defaults to `{}` if not specified. * @returns {Promise} The transaction response. */ public async claimWithoutProof( - message: MessageProps & { feeRecipient?: string }, + message: Message & { feeRecipient?: string }, overrides: Overrides = {}, ): Promise { if (this.mode === "read-only") { @@ -403,7 +408,7 @@ export class LineaRollupClient throw new BaseError("'retryTransactionWithHigherFee' function not callable using readOnly mode."); } - const transaction = await this.chainQuerier.getTransaction(transactionHash); + const transaction = await this.provider.getTransaction(transactionHash); if (!transaction) { throw new BaseError(`Transaction with hash ${transactionHash} not found.`); @@ -440,7 +445,7 @@ export class LineaRollupClient maxFeePerGas, }; const signedTransaction = await this.signer!.signTransaction(updatedTransaction); - return await this.chainQuerier.broadcastTransaction(signedTransaction); + return await this.provider.broadcastTransaction(signedTransaction); } /** @@ -460,14 +465,15 @@ export class LineaRollupClient } /** - * Checks if an error is of type 'RateLimitExceeded'. + * Parses the error from the transaction. * @param {string} transactionHash - The transaction hash. - * @returns {Promise} True if the error type is 'RateLimitExceeded', false otherwise. + * @returns {Promise} The error description or the error bytes. */ - public async isRateLimitExceededError(transactionHash: string): Promise { + public async parseTransactionError(transactionHash: string): Promise { + let errorEncodedData = "0x"; try { - const tx = await this.chainQuerier.getTransaction(transactionHash); - const errorEncodedData = await this.chainQuerier.ethCall({ + const tx = await this.provider.getTransaction(transactionHash); + errorEncodedData = await this.provider.call({ to: tx?.to, from: tx?.from, nonce: tx?.nonce, @@ -481,9 +487,28 @@ export class LineaRollupClient }); const error = this.contract.interface.parseError(errorEncodedData); - return error?.name === "RateLimitExceeded"; + if (!error) { + return errorEncodedData; + } + + return error; } catch (e) { + return errorEncodedData; + } + } + + /** + * Checks if an error is of type 'RateLimitExceeded'. + * @param {string} transactionHash - The transaction hash. + * @returns {Promise} True if the error type is 'RateLimitExceeded', false otherwise. + */ + public async isRateLimitExceededError(transactionHash: string): Promise { + const parsedError = await this.parseTransactionError(transactionHash); + + if (isString(parsedError)) { return false; } + + return parsedError.name === "RateLimitExceeded"; } } diff --git a/sdk/src/clients/blockchain/ethereum/LineaRollupMessageRetriever.ts b/sdk/src/clients/ethereum/LineaRollupMessageRetriever.ts similarity index 73% rename from sdk/src/clients/blockchain/ethereum/LineaRollupMessageRetriever.ts rename to sdk/src/clients/ethereum/LineaRollupMessageRetriever.ts index ae0040765..f1413891d 100644 --- a/sdk/src/clients/blockchain/ethereum/LineaRollupMessageRetriever.ts +++ b/sdk/src/clients/ethereum/LineaRollupMessageRetriever.ts @@ -1,11 +1,12 @@ -import { ILineaRollupLogClient } from "../../../core/clients/blockchain/ethereum/ILineaRollupLogClient"; -import { Block, JsonRpcProvider, TransactionReceipt, TransactionRequest, TransactionResponse } from "ethers"; -import { MessageSent } from "../../../core/types/Events"; -import { MESSAGE_SENT_EVENT_SIGNATURE } from "../../../core/constants"; -import { isNull } from "../../../core/utils/shared"; -import { LineaRollup, LineaRollup__factory } from "../typechain"; -import { IMessageRetriever } from "../../../core/clients/blockchain/IMessageRetriever"; -import { IChainQuerier } from "sdk/src/core/clients/blockchain/IChainQuerier"; +import { Block, TransactionReceipt, TransactionRequest, TransactionResponse } from "ethers"; +import { ILineaRollupLogClient } from "../../core/clients/ethereum"; +import { MessageSent } from "../../core/types"; +import { MESSAGE_SENT_EVENT_SIGNATURE } from "../../core/constants"; +import { isNull } from "../../core/utils"; +import { LineaRollup, LineaRollup__factory } from "../../contracts/typechain"; +import { IMessageRetriever } from "../../core/clients/IMessageRetriever"; +import { IProvider } from "../../core/clients/IProvider"; +import { BrowserProvider, Provider } from "../providers"; export class LineaRollupMessageRetriever implements IMessageRetriever { private readonly contract: LineaRollup; @@ -13,22 +14,22 @@ export class LineaRollupMessageRetriever implements IMessageRetriever, private readonly lineaRollupLogClient: ILineaRollupLogClient, private readonly contractAddress: string, ) { - this.contract = LineaRollup__factory.connect(contractAddress, this.chainQuerier.getProvider()); + this.contract = LineaRollup__factory.connect(contractAddress, this.provider); } /** @@ -51,7 +52,7 @@ export class LineaRollupMessageRetriever implements IMessageRetriever} An array of message information or null if not found. */ public async getMessagesByTransactionHash(transactionHash: string): Promise { - const receipt = await this.chainQuerier.getTransactionReceipt(transactionHash); + const receipt = await this.provider.getTransactionReceipt(transactionHash); if (!receipt) { return null; } @@ -82,7 +83,7 @@ export class LineaRollupMessageRetriever implements IMessageRetriever, private readonly contractAddress: string, private readonly lineaRollupLogClient: ILineaRollupLogClient, private readonly l2MessageServiceLogClient: IL2MessageServiceLogClient, private readonly l2MessageTreeDepth: number, ) { - this.contract = LineaRollup__factory.connect(contractAddress, this.chainQuerier.getProvider()); + this.contract = LineaRollup__factory.connect(contractAddress, this.provider); } /** @@ -89,7 +90,7 @@ export class MerkleTreeService implements IMerkleTreeService { * @returns {Promise} The finalization messaging info: l2MessagingBlocksRange, l2MerkleRoots, treeDepth. */ public async getFinalizationMessagingInfo(transactionHash: string): Promise { - const receipt = await this.chainQuerier.getTransactionReceipt(transactionHash); + const receipt = await this.provider.getTransactionReceipt(transactionHash); if (!receipt || receipt.logs.length === 0) { throw new BaseError(`Transaction does not exist or no logs found in this transaction: ${transactionHash}.`); diff --git a/sdk/src/clients/blockchain/ethereum/__tests__/EthersLineaRollupLogClient.test.ts b/sdk/src/clients/ethereum/__tests__/EthersLineaRollupLogClient.test.ts similarity index 84% rename from sdk/src/clients/blockchain/ethereum/__tests__/EthersLineaRollupLogClient.test.ts rename to sdk/src/clients/ethereum/__tests__/EthersLineaRollupLogClient.test.ts index 7476037c5..4f6a2a4c6 100644 --- a/sdk/src/clients/blockchain/ethereum/__tests__/EthersLineaRollupLogClient.test.ts +++ b/sdk/src/clients/ethereum/__tests__/EthersLineaRollupLogClient.test.ts @@ -1,26 +1,26 @@ import { describe, afterEach, it, expect, beforeEach } from "@jest/globals"; import { MockProxy, mock, mockClear } from "jest-mock-extended"; -import { JsonRpcProvider } from "ethers"; import { EthersLineaRollupLogClient } from "../EthersLineaRollupLogClient"; +import { TEST_CONTRACT_ADDRESS_1 } from "../../../utils/testing/constants/common"; import { - testL1NetworkConfig, testL2MessagingBlockAnchoredEvent, testL2MessagingBlockAnchoredEventLog, testMessageClaimedEvent, testMessageClaimedEventLog, testMessageSentEvent, testMessageSentEventLog, -} from "../../../../utils/testing/constants"; -import { LineaRollup, LineaRollup__factory } from "../../typechain"; -import { mockProperty } from "../../../../utils/testing/helpers"; +} from "../../../utils/testing/constants/events"; +import { LineaRollup, LineaRollup__factory } from "../../../contracts/typechain"; +import { mockProperty } from "../../../utils/testing/helpers"; +import { Provider } from "../../providers"; describe("TestEthersLineaRollupLogClient", () => { - let providerMock: MockProxy; + let providerMock: MockProxy; let lineaRollupMock: MockProxy; let lineaRollupLogClient: EthersLineaRollupLogClient; beforeEach(() => { - providerMock = mock(); + providerMock = mock(); lineaRollupMock = mock(); mockProperty(lineaRollupMock, "filters", { ...lineaRollupMock.filters, @@ -31,10 +31,7 @@ describe("TestEthersLineaRollupLogClient", () => { } as any); jest.spyOn(LineaRollup__factory, "connect").mockReturnValue(lineaRollupMock); - lineaRollupLogClient = new EthersLineaRollupLogClient( - providerMock, - testL1NetworkConfig.messageServiceContractAddress, - ); + lineaRollupLogClient = new EthersLineaRollupLogClient(providerMock, TEST_CONTRACT_ADDRESS_1); }); afterEach(() => { diff --git a/sdk/src/sdk/claiming/__tests__/L1ClaimingService.test.ts b/sdk/src/clients/ethereum/__tests__/L1ClaimingService.test.ts similarity index 96% rename from sdk/src/sdk/claiming/__tests__/L1ClaimingService.test.ts rename to sdk/src/clients/ethereum/__tests__/L1ClaimingService.test.ts index aa6663890..cd418ec06 100644 --- a/sdk/src/sdk/claiming/__tests__/L1ClaimingService.test.ts +++ b/sdk/src/clients/ethereum/__tests__/L1ClaimingService.test.ts @@ -1,9 +1,9 @@ import { describe, it } from "@jest/globals"; -import { ContractTransactionResponse, ethers, JsonRpcProvider } from "ethers"; +import { ContractTransactionResponse, ethers } from "ethers"; import { MockProxy, mock, mockClear } from "jest-mock-extended"; import { L1ClaimingService } from "../L1ClaimingService"; -import { LineaRollupClient } from "../../../clients/blockchain/ethereum/LineaRollupClient"; -import { L2MessageServiceClient } from "../../../clients/blockchain/linea/L2MessageServiceClient"; +import { LineaRollupClient } from "../LineaRollupClient"; +import { L2MessageServiceClient } from "../../linea"; import { generateHexString, generateL2MerkleTreeAddedLog, @@ -20,17 +20,20 @@ import { TEST_MESSAGE_HASH, TEST_MESSAGE_HASH_2, TEST_TRANSACTION_HASH, +} from "../../../utils/testing/constants/common"; +import { testL2MessagingBlockAnchoredEvent, testMessageSentEvent, testServiceVersionMigratedEvent, -} from "../../../utils/testing/constants"; -import { EthersL2MessageServiceLogClient } from "../../../clients/blockchain/linea/EthersL2MessageServiceLogClient"; -import { EthersLineaRollupLogClient } from "../../../clients/blockchain/ethereum/EthersLineaRollupLogClient"; +} from "../../../utils/testing/constants/events"; +import { EthersL2MessageServiceLogClient } from "../../linea/EthersL2MessageServiceLogClient"; +import { EthersLineaRollupLogClient } from "../EthersLineaRollupLogClient"; import { ZERO_ADDRESS } from "../../../core/constants"; +import { LineaProvider, Provider } from "../../providers"; describe("L1ClaimingService", () => { - let l1Provider: MockProxy; - let l2Provider: MockProxy; + let l1Provider: MockProxy; + let l2Provider: MockProxy; let l1ClaimingService: L1ClaimingService; let lineaRollupClient: LineaRollupClient; @@ -40,8 +43,8 @@ describe("L1ClaimingService", () => { let l1LogClient: EthersLineaRollupLogClient; beforeEach(() => { - l1Provider = mock(); - l2Provider = mock(); + l1Provider = mock(); + l2Provider = mock(); const clients = generateLineaRollupClient( l1Provider, diff --git a/sdk/src/clients/blockchain/ethereum/__tests__/LineaRollupClient.test.ts b/sdk/src/clients/ethereum/__tests__/LineaRollupClient.test.ts similarity index 97% rename from sdk/src/clients/blockchain/ethereum/__tests__/LineaRollupClient.test.ts rename to sdk/src/clients/ethereum/__tests__/LineaRollupClient.test.ts index 69bad706c..f804ed896 100644 --- a/sdk/src/clients/blockchain/ethereum/__tests__/LineaRollupClient.test.ts +++ b/sdk/src/clients/ethereum/__tests__/LineaRollupClient.test.ts @@ -1,19 +1,22 @@ import { describe, afterEach, it, expect, beforeEach } from "@jest/globals"; import { MockProxy, mock, mockClear, mockDeep } from "jest-mock-extended"; -import { ContractTransactionResponse, JsonRpcProvider, Wallet } from "ethers"; +import { ContractTransactionResponse, Wallet } from "ethers"; import { - testMessageSentEvent, TEST_MESSAGE_HASH, TEST_CONTRACT_ADDRESS_1, TEST_TRANSACTION_HASH, TEST_ADDRESS_2, - testMessageClaimedEvent, - testL2MessagingBlockAnchoredEvent, TEST_MERKLE_ROOT, TEST_CONTRACT_ADDRESS_2, TEST_ADDRESS_1, -} from "../../../../utils/testing/constants"; -import { LineaRollup, LineaRollup__factory } from "../../typechain"; + DEFAULT_MAX_FEE_PER_GAS, +} from "../../../utils/testing/constants/common"; +import { + testMessageSentEvent, + testMessageClaimedEvent, + testL2MessagingBlockAnchoredEvent, +} from "../../../utils/testing/constants/events"; +import { LineaRollup, LineaRollup__factory } from "../../../contracts/typechain"; import { generateL2MerkleTreeAddedLog, generateL2MessagingBlockAnchoredLog, @@ -23,19 +26,20 @@ import { generateTransactionReceiptWithLogs, generateTransactionResponse, mockProperty, -} from "../../../../utils/testing/helpers"; +} from "../../../utils/testing/helpers"; import { LineaRollupClient } from "../LineaRollupClient"; -import { DEFAULT_MAX_FEE_PER_GAS, ZERO_ADDRESS } from "../../../../core/constants"; -import { OnChainMessageStatus } from "../../../../core/enums/MessageEnums"; -import { GasEstimationError } from "../../../../core/errors/GasFeeErrors"; -import { BaseError } from "../../../../core/errors/Base"; +import { ZERO_ADDRESS } from "../../../core/constants"; +import { OnChainMessageStatus } from "../../../core/enums/message"; +import { GasEstimationError } from "../../../core/errors/GasFeeErrors"; +import { BaseError } from "../../../core/errors"; import { EthersL2MessageServiceLogClient } from "../../linea/EthersL2MessageServiceLogClient"; import { EthersLineaRollupLogClient } from "../EthersLineaRollupLogClient"; import { DefaultGasProvider } from "../../gas/DefaultGasProvider"; +import { LineaProvider, Provider } from "../../providers"; describe("TestLineaRollupClient", () => { - let providerMock: MockProxy; - let l2ProviderMock: MockProxy; + let providerMock: MockProxy; + let l2ProviderMock: MockProxy; let walletMock: MockProxy; let lineaRollupMock: MockProxy; @@ -45,8 +49,8 @@ describe("TestLineaRollupClient", () => { let gasFeeProvider: DefaultGasProvider; beforeEach(() => { - providerMock = mock(); - l2ProviderMock = mock(); + providerMock = mock(); + l2ProviderMock = mock(); walletMock = mock(); lineaRollupMock = mockDeep(); jest.spyOn(LineaRollup__factory, "connect").mockReturnValue(lineaRollupMock); @@ -595,7 +599,7 @@ describe("TestLineaRollupClient", () => { "read-write", walletMock, { - maxFeePerGas: 500000000n, + maxFeePerGasCap: 500000000n, enforceMaxGasFee: true, }, ).lineaRollupClient; @@ -633,7 +637,7 @@ describe("TestLineaRollupClient", () => { "read-write", walletMock, { - maxFeePerGas: 500000000n, + maxFeePerGasCap: 500000000n, enforceMaxGasFee: true, }, ).lineaRollupClient; @@ -818,7 +822,7 @@ describe("TestLineaRollupClient", () => { "read-write", walletMock, { - maxFeePerGas: 500000000n, + maxFeePerGasCap: 500000000n, }, ).lineaRollupClient; @@ -856,7 +860,7 @@ describe("TestLineaRollupClient", () => { "read-write", walletMock, { - maxFeePerGas: 500000000n, + maxFeePerGasCap: 500000000n, enforceMaxGasFee: true, }, ).lineaRollupClient; diff --git a/sdk/src/clients/blockchain/ethereum/__tests__/LineaRollupMessageRetriever.test.ts b/sdk/src/clients/ethereum/__tests__/LineaRollupMessageRetriever.test.ts similarity index 90% rename from sdk/src/clients/blockchain/ethereum/__tests__/LineaRollupMessageRetriever.test.ts rename to sdk/src/clients/ethereum/__tests__/LineaRollupMessageRetriever.test.ts index 730347922..b2a957dec 100644 --- a/sdk/src/clients/blockchain/ethereum/__tests__/LineaRollupMessageRetriever.test.ts +++ b/sdk/src/clients/ethereum/__tests__/LineaRollupMessageRetriever.test.ts @@ -1,28 +1,29 @@ import { describe, beforeEach } from "@jest/globals"; -import { JsonRpcProvider, Wallet } from "ethers"; +import { Wallet } from "ethers"; import { MockProxy, mock } from "jest-mock-extended"; import { TEST_CONTRACT_ADDRESS_1, TEST_CONTRACT_ADDRESS_2, TEST_MESSAGE_HASH, TEST_TRANSACTION_HASH, - testMessageSentEvent, -} from "../../../../utils/testing/constants"; -import { generateLineaRollupClient, generateTransactionReceipt } from "../../../../utils/testing/helpers"; +} from "../../../utils/testing/constants/common"; +import { testMessageSentEvent } from "../../../utils/testing/constants/events"; +import { generateLineaRollupClient, generateTransactionReceipt } from "../../../utils/testing/helpers"; import { EthersLineaRollupLogClient } from "../EthersLineaRollupLogClient"; import { LineaRollupMessageRetriever } from "../LineaRollupMessageRetriever"; +import { LineaProvider, Provider } from "../../providers"; describe("LineaRollupMessageRetriever", () => { - let providerMock: MockProxy; - let l2ProviderMock: MockProxy; + let providerMock: MockProxy; + let l2ProviderMock: MockProxy; let walletMock: MockProxy; let messageRetriever: LineaRollupMessageRetriever; let lineaRollupLogClient: EthersLineaRollupLogClient; beforeEach(() => { - providerMock = mock(); - l2ProviderMock = mock(); + providerMock = mock(); + l2ProviderMock = mock(); walletMock = mock(); const clients = generateLineaRollupClient( diff --git a/sdk/src/clients/blockchain/ethereum/__tests__/MerkleTreeService.test.ts b/sdk/src/clients/ethereum/__tests__/MerkleTreeService.test.ts similarity index 84% rename from sdk/src/clients/blockchain/ethereum/__tests__/MerkleTreeService.test.ts rename to sdk/src/clients/ethereum/__tests__/MerkleTreeService.test.ts index 66b211054..7a730da4e 100644 --- a/sdk/src/clients/blockchain/ethereum/__tests__/MerkleTreeService.test.ts +++ b/sdk/src/clients/ethereum/__tests__/MerkleTreeService.test.ts @@ -1,5 +1,5 @@ import { describe, beforeEach } from "@jest/globals"; -import { JsonRpcProvider, Wallet } from "ethers"; +import { Wallet } from "ethers"; import { MockProxy, mock } from "jest-mock-extended"; import { TEST_CONTRACT_ADDRESS_1, @@ -7,23 +7,23 @@ import { TEST_MERKLE_ROOT_2, TEST_MESSAGE_HASH, TEST_MESSAGE_HASH_2, - testL2MessagingBlockAnchoredEvent, - testMessageSentEvent, -} from "../../../../utils/testing/constants"; +} from "../../../utils/testing/constants/common"; +import { testL2MessagingBlockAnchoredEvent, testMessageSentEvent } from "../../../utils/testing/constants/events"; import { generateL2MerkleTreeAddedLog, generateL2MessagingBlockAnchoredLog, generateLineaRollupClient, generateTransactionReceiptWithLogs, -} from "../../../../utils/testing/helpers"; -import { LineaRollup, LineaRollup__factory } from "../../typechain"; +} from "../../../utils/testing/helpers"; +import { LineaRollup, LineaRollup__factory } from "../../../contracts/typechain"; import { EthersL2MessageServiceLogClient } from "../../linea/EthersL2MessageServiceLogClient"; import { EthersLineaRollupLogClient } from "../EthersLineaRollupLogClient"; import { MerkleTreeService } from "../MerkleTreeService"; +import { LineaProvider, Provider } from "../../providers"; describe("MerkleTreeService", () => { - let providerMock: MockProxy; - let l2ProviderMock: MockProxy; + let providerMock: MockProxy; + let l2ProviderMock: MockProxy; let walletMock: MockProxy; let lineaRollupMock: MockProxy; @@ -32,8 +32,8 @@ describe("MerkleTreeService", () => { let l2MessageServiceLogClient: EthersL2MessageServiceLogClient; beforeEach(() => { - providerMock = mock(); - l2ProviderMock = mock(); + providerMock = mock(); + l2ProviderMock = mock(); walletMock = mock(); lineaRollupMock = mock(); diff --git a/sdk/src/clients/ethereum/index.ts b/sdk/src/clients/ethereum/index.ts new file mode 100644 index 000000000..05f19ae13 --- /dev/null +++ b/sdk/src/clients/ethereum/index.ts @@ -0,0 +1,5 @@ +export { EthersLineaRollupLogClient } from "./EthersLineaRollupLogClient"; +export { LineaRollupClient } from "./LineaRollupClient"; +export { LineaRollupMessageRetriever } from "./LineaRollupMessageRetriever"; +export { MerkleTreeService } from "./MerkleTreeService"; +export { L1ClaimingService } from "./L1ClaimingService"; diff --git a/sdk/src/clients/blockchain/gas/DefaultGasProvider.ts b/sdk/src/clients/gas/DefaultGasProvider.ts similarity index 73% rename from sdk/src/clients/blockchain/gas/DefaultGasProvider.ts rename to sdk/src/clients/gas/DefaultGasProvider.ts index 3f291dc89..a9d3bbca3 100644 --- a/sdk/src/clients/blockchain/gas/DefaultGasProvider.ts +++ b/sdk/src/clients/gas/DefaultGasProvider.ts @@ -1,12 +1,8 @@ -import { Block, JsonRpcProvider, TransactionReceipt, TransactionRequest, TransactionResponse } from "ethers"; -import { FeeEstimationError } from "../../../core/errors/GasFeeErrors"; -import { - DefaultGasProviderConfig, - FeeHistory, - GasFees, - IEthereumGasProvider, -} from "../../../core/clients/blockchain/IGasProvider"; -import { IChainQuerier } from "../../../core/clients/blockchain/IChainQuerier"; +import { Block, TransactionReceipt, TransactionRequest, TransactionResponse } from "ethers"; +import { FeeEstimationError } from "../../core/errors"; +import { DefaultGasProviderConfig, FeeHistory, GasFees, IEthereumGasProvider } from "../../core/clients/IGasProvider"; +import { IProvider } from "../../core/clients/IProvider"; +import { BrowserProvider, LineaBrowserProvider, LineaProvider, Provider } from "../providers"; export class DefaultGasProvider implements IEthereumGasProvider { private gasFeesCache: GasFees; @@ -15,21 +11,24 @@ export class DefaultGasProvider implements IEthereumGasProvider, private readonly config: DefaultGasProviderConfig, ) { this.cacheIsValidForBlockNumber = 0n; - this.gasFeesCache = { maxFeePerGas: this.config.maxFeePerGas, maxPriorityFeePerGas: this.config.maxFeePerGas }; + this.gasFeesCache = { + maxFeePerGas: this.config.maxFeePerGasCap, + maxPriorityFeePerGas: this.config.maxFeePerGasCap, + }; } /** @@ -49,12 +48,12 @@ export class DefaultGasProvider implements IEthereumGasProvider { if (this.config.enforceMaxGasFee) { return { - maxPriorityFeePerGas: this.config.maxFeePerGas, - maxFeePerGas: this.config.maxFeePerGas, + maxPriorityFeePerGas: this.config.maxFeePerGasCap, + maxFeePerGas: this.config.maxFeePerGasCap, }; } - const currentBlockNumber = await this.chainQuerier.getCurrentBlockNumber(); + const currentBlockNumber = await this.provider.getBlockNumber(); if (this.isCacheValid(currentBlockNumber)) { return this.gasFeesCache; } @@ -62,9 +61,9 @@ export class DefaultGasProvider implements IEthereumGasProvider this.config.maxFeePerGas) { + if (maxPriorityFeePerGas > this.config.maxFeePerGasCap) { throw new FeeEstimationError( - `Estimated miner tip of ${maxPriorityFeePerGas} exceeds configured max fee per gas of ${this.config.maxFeePerGas}!`, + `Estimated miner tip of ${maxPriorityFeePerGas} exceeds configured max fee per gas of ${this.config.maxFeePerGasCap}!`, ); } @@ -79,7 +78,7 @@ export class DefaultGasProvider implements IEthereumGasProvider} A promise that resolves to the fee history. */ private async fetchFeeHistory(): Promise { - return this.chainQuerier.sendRequest("eth_feeHistory", ["0x4", "latest", [this.config.gasEstimationPercentile]]); + return this.provider.send("eth_feeHistory", ["0x4", "latest", [this.config.gasEstimationPercentile]]); } /** @@ -120,12 +119,12 @@ export class DefaultGasProvider implements IEthereumGasProvider 0n && maxPriorityFeePerGas > 0n) { this.gasFeesCache = { maxPriorityFeePerGas, - maxFeePerGas: maxFeePerGas > this.config.maxFeePerGas ? this.config.maxFeePerGas : maxFeePerGas, + maxFeePerGas: maxFeePerGas > this.config.maxFeePerGasCap ? this.config.maxFeePerGasCap : maxFeePerGas, }; } else { this.gasFeesCache = { - maxPriorityFeePerGas: this.config.maxFeePerGas, - maxFeePerGas: this.config.maxFeePerGas, + maxPriorityFeePerGas: this.config.maxFeePerGasCap, + maxFeePerGas: this.config.maxFeePerGasCap, }; } } @@ -136,6 +135,6 @@ export class DefaultGasProvider implements IEthereumGasProvider { private defaultGasProvider: DefaultGasProvider; @@ -13,26 +14,26 @@ export class GasProvider implements IGasProvider { /** * Creates an instance of `GasProvider`. * - * @param {IChainQuerier} chainQuerier - The chain querier for interacting with the blockchain. + * @param {IProvider} provider - The provider for interacting with the blockchain. * @param {GasProviderConfig} config - The configuration for the gas provider. */ constructor( - private chainQuerier: IChainQuerier< + private provider: IProvider< TransactionReceipt, Block, TransactionRequest, TransactionResponse, - JsonRpcProvider + Provider | LineaProvider | LineaBrowserProvider | BrowserProvider >, private readonly config: GasProviderConfig, ) { - this.defaultGasProvider = new DefaultGasProvider(this.chainQuerier, { - maxFeePerGas: config.maxFeePerGas, + this.defaultGasProvider = new DefaultGasProvider(this.provider, { + maxFeePerGasCap: config.maxFeePerGasCap, gasEstimationPercentile: config.gasEstimationPercentile, enforceMaxGasFee: config.enforceMaxGasFee, }); - this.lineaGasProvider = new LineaGasProvider(this.chainQuerier, { - maxFeePerGas: config.maxFeePerGas, + this.lineaGasProvider = new LineaGasProvider(this.provider, { + maxFeePerGasCap: config.maxFeePerGasCap, enforceMaxGasFee: config.enforceMaxGasFee, }); } @@ -56,7 +57,7 @@ export class GasProvider implements IGasProvider { return this.lineaGasProvider.getGasFees(transactionRequest); } else { const fees = await this.defaultGasProvider.getGasFees(); - const gasLimit = await this.chainQuerier.estimateGas({ + const gasLimit = await this.provider.estimateGas({ ...transactionRequest, maxPriorityFeePerGas: fees.maxPriorityFeePerGas, maxFeePerGas: fees.maxFeePerGas, diff --git a/sdk/src/clients/blockchain/gas/LineaGasProvider.ts b/sdk/src/clients/gas/LineaGasProvider.ts similarity index 83% rename from sdk/src/clients/blockchain/gas/LineaGasProvider.ts rename to sdk/src/clients/gas/LineaGasProvider.ts index 898de0863..f87b2b536 100644 --- a/sdk/src/clients/blockchain/gas/LineaGasProvider.ts +++ b/sdk/src/clients/gas/LineaGasProvider.ts @@ -1,11 +1,12 @@ -import { Block, JsonRpcProvider, TransactionReceipt, TransactionRequest, TransactionResponse } from "ethers"; +import { Block, TransactionReceipt, TransactionRequest, TransactionResponse } from "ethers"; import { LineaEstimateGasResponse, LineaGasFees, ILineaGasProvider, LineaGasProviderConfig, -} from "../../../core/clients/blockchain/IGasProvider"; -import { IChainQuerier } from "../../../core/clients/blockchain/IChainQuerier"; +} from "../../core/clients/IGasProvider"; +import { IProvider } from "../../core/clients/IProvider"; +import { BrowserProvider, LineaBrowserProvider, LineaProvider, Provider } from "../providers"; const BASE_FEE_MULTIPLIER = 1.35; const PRIORITY_FEE_MULTIPLIER = 1.05; @@ -14,16 +15,16 @@ export class LineaGasProvider implements ILineaGasProvider { /** * Creates an instance of `LineaGasProvider`. * - * @param {IChainQuerier} chainQuerier - The chain querier for interacting with the blockchain. + * @param {IProvider} provider - The provider for interacting with the blockchain. * @param {LineaGasProviderConfig} config - The configuration for the Linea gas provider. */ constructor( - protected readonly chainQuerier: IChainQuerier< + protected readonly provider: IProvider< TransactionReceipt, Block, TransactionRequest, TransactionResponse, - JsonRpcProvider + LineaProvider | LineaBrowserProvider | Provider | BrowserProvider >, private readonly config: LineaGasProviderConfig, ) {} @@ -40,8 +41,8 @@ export class LineaGasProvider implements ILineaGasProvider { if (this.config.enforceMaxGasFee) { return { ...gasFees, - maxPriorityFeePerGas: this.config.maxFeePerGas, - maxFeePerGas: this.config.maxFeePerGas, + maxPriorityFeePerGas: this.config.maxFeePerGasCap, + maxFeePerGas: this.config.maxFeePerGasCap, }; } return gasFees; @@ -87,7 +88,7 @@ export class LineaGasProvider implements ILineaGasProvider { data: transactionRequest.data, }; - return this.chainQuerier.sendRequest("linea_estimateGas", [params]); + return this.provider.send("linea_estimateGas", [params]); } /** @@ -120,6 +121,6 @@ export class LineaGasProvider implements ILineaGasProvider { * @returns {bigint} The maximum fee per gas. */ public getMaxFeePerGas(): bigint { - return this.config.maxFeePerGas; + return this.config.maxFeePerGasCap; } } diff --git a/sdk/src/clients/blockchain/gas/__tests__/DefaultGasProvider.test.ts b/sdk/src/clients/gas/__tests__/DefaultGasProvider.test.ts similarity index 61% rename from sdk/src/clients/blockchain/gas/__tests__/DefaultGasProvider.test.ts rename to sdk/src/clients/gas/__tests__/DefaultGasProvider.test.ts index d5cd08149..4bcfb609b 100644 --- a/sdk/src/clients/blockchain/gas/__tests__/DefaultGasProvider.test.ts +++ b/sdk/src/clients/gas/__tests__/DefaultGasProvider.test.ts @@ -1,40 +1,42 @@ import { describe, afterEach, jest, it, expect, beforeEach } from "@jest/globals"; import { MockProxy, mock, mockClear } from "jest-mock-extended"; import { DefaultGasProvider } from "../DefaultGasProvider"; -import { FeeEstimationError } from "../../../../core/errors/GasFeeErrors"; -import { testL1NetworkConfig } from "../../../../utils/testing/constants"; -import { ChainQuerier } from "../../ChainQuerier"; +import { FeeEstimationError } from "../../../core/errors/GasFeeErrors"; +import { Provider } from "../../providers/provider"; +import { DEFAULT_GAS_ESTIMATION_PERCENTILE } from "../../../core/constants"; + +const MAX_FEE_PER_GAS = 100_000_000n; describe("DefaultGasProvider", () => { - let chainQuerierMock: MockProxy; + let providerMock: MockProxy; let eip1559GasProvider: DefaultGasProvider; beforeEach(() => { - chainQuerierMock = mock(); - eip1559GasProvider = new DefaultGasProvider(chainQuerierMock, { - maxFeePerGas: testL1NetworkConfig.claiming.maxFeePerGas, - gasEstimationPercentile: testL1NetworkConfig.claiming.gasEstimationPercentile, + providerMock = mock(); + eip1559GasProvider = new DefaultGasProvider(providerMock, { + maxFeePerGasCap: MAX_FEE_PER_GAS, + gasEstimationPercentile: DEFAULT_GAS_ESTIMATION_PERCENTILE, enforceMaxGasFee: false, }); }); afterEach(() => { - mockClear(chainQuerierMock); + mockClear(providerMock); }); describe("getGasFees", () => { it("should return fee from cache if currentBlockNumber == cacheIsValidForBlockNumber", async () => { - jest.spyOn(chainQuerierMock, "getCurrentBlockNumber").mockResolvedValueOnce(0); + jest.spyOn(providerMock, "getBlockNumber").mockResolvedValueOnce(0); const fees = await eip1559GasProvider.getGasFees(); expect(fees).toStrictEqual({ - maxFeePerGas: testL1NetworkConfig.claiming.maxFeePerGas, - maxPriorityFeePerGas: testL1NetworkConfig.claiming.maxFeePerGas, + maxFeePerGas: MAX_FEE_PER_GAS, + maxPriorityFeePerGas: MAX_FEE_PER_GAS, }); }); it("should throw an error 'FeeEstimationError' if maxPriorityFee is greater than maxFeePerGas", async () => { - jest.spyOn(chainQuerierMock, "getCurrentBlockNumber").mockResolvedValueOnce(1); - const sendSpy = jest.spyOn(chainQuerierMock, "sendRequest").mockResolvedValueOnce({ + jest.spyOn(providerMock, "getBlockNumber").mockResolvedValueOnce(1); + const sendSpy = jest.spyOn(providerMock, "send").mockResolvedValueOnce({ baseFeePerGas: ["0x3da8e7618", "0x3e1ba3b1b", "0x3dfd72b90", "0x3d64eee76", "0x3d4da2da0", "0x3ccbcac6b"], gasUsedRatio: [0.5290747666666666, 0.49240453333333334, 0.4615576, 0.49407083333333335, 0.4669053], oldestBlock: "0xfab8ac", @@ -51,9 +53,9 @@ describe("DefaultGasProvider", () => { }); it("should return maxFeePerGas and maxPriorityFeePerGas", async () => { - jest.spyOn(chainQuerierMock, "getCurrentBlockNumber").mockResolvedValueOnce(1); - const sendSpy = jest.spyOn(chainQuerierMock, "sendRequest").mockResolvedValueOnce({ - baseFeePerGas: ["0x3da8e7618", "0x3e1ba3b1b", "0x3dfd72b90", "0x3d64eee76", "0x3d4da2da0", "0x3ccbcac6b"], + jest.spyOn(providerMock, "getBlockNumber").mockResolvedValueOnce(1); + const sendSpy = jest.spyOn(providerMock, "send").mockResolvedValueOnce({ + baseFeePerGas: ["0x3da8e", "0x3e1ba", "0x3dfd7", "0x3d64e", "0x3d4da", "0x3ccbc"], gasUsedRatio: [0.5290747666666666, 0.49240453333333334, 0.4615576, 0.49407083333333335, 0.4669053], oldestBlock: "0xfab8ac", reward: [ @@ -68,7 +70,7 @@ describe("DefaultGasProvider", () => { const fees = await eip1559GasProvider.getGasFees(); expect(fees).toStrictEqual({ - maxFeePerGas: BigInt(testL1NetworkConfig.claiming.maxFeePerGas!), + maxFeePerGas: 32_217_395n, maxPriorityFeePerGas: 31_719_355n, }); @@ -76,9 +78,9 @@ describe("DefaultGasProvider", () => { }); it("should return maxFeePerGas from config when maxFeePerGas and maxPriorityFeePerGas === 0", async () => { - jest.spyOn(chainQuerierMock, "getCurrentBlockNumber").mockResolvedValueOnce(1); + jest.spyOn(providerMock, "getBlockNumber").mockResolvedValueOnce(1); - const sendSpy = jest.spyOn(chainQuerierMock, "sendRequest").mockResolvedValueOnce({ + const sendSpy = jest.spyOn(providerMock, "send").mockResolvedValueOnce({ baseFeePerGas: ["0x0", "0x0", "0x0", "0x0", "0x0", "0x0"], gasUsedRatio: [0, 0, 0, 0, 0], oldestBlock: "0xfab8ac", @@ -94,8 +96,8 @@ describe("DefaultGasProvider", () => { const fees = await eip1559GasProvider.getGasFees(); expect(fees).toStrictEqual({ - maxFeePerGas: testL1NetworkConfig.claiming.maxFeePerGas!, - maxPriorityFeePerGas: testL1NetworkConfig.claiming.maxFeePerGas!, + maxFeePerGas: MAX_FEE_PER_GAS, + maxPriorityFeePerGas: MAX_FEE_PER_GAS, }); expect(sendSpy).toHaveBeenCalledTimes(1); diff --git a/sdk/src/clients/blockchain/gas/__tests__/GasProvider.test.ts b/sdk/src/clients/gas/__tests__/GasProvider.test.ts similarity index 74% rename from sdk/src/clients/blockchain/gas/__tests__/GasProvider.test.ts rename to sdk/src/clients/gas/__tests__/GasProvider.test.ts index f91439a7c..e4f045354 100644 --- a/sdk/src/clients/blockchain/gas/__tests__/GasProvider.test.ts +++ b/sdk/src/clients/gas/__tests__/GasProvider.test.ts @@ -1,11 +1,12 @@ import { describe, afterEach, it, expect, beforeEach } from "@jest/globals"; import { MockProxy, mock, mockClear } from "jest-mock-extended"; -import { ChainQuerier } from "../../ChainQuerier"; +import { Provider } from "../../providers/provider"; import { GasProvider } from "../GasProvider"; -import { Direction } from "../../../../core/enums/MessageEnums"; -import { DEFAULT_GAS_ESTIMATION_PERCENTILE, DEFAULT_MAX_FEE_PER_GAS } from "../../../../core/constants"; -import { generateTransactionRequest } from "../../../../utils/testing/helpers"; +import { Direction } from "../../../core/enums/message"; +import { DEFAULT_GAS_ESTIMATION_PERCENTILE, DEFAULT_MAX_FEE_PER_GAS_CAP } from "../../../core/constants"; +import { generateTransactionRequest } from "../../../utils/testing/helpers"; import { toBeHex } from "ethers"; +import { DEFAULT_MAX_FEE_PER_GAS } from "../../../utils/testing/constants/common"; const testFeeHistory = { baseFeePerGas: ["0x3da8e7618", "0x3e1ba3b1b", "0x3dfd72b90", "0x3d64eee76", "0x3d4da2da0", "0x3ccbcac6b"], @@ -21,22 +22,22 @@ const testFeeHistory = { }; describe("GasProvider", () => { - let chainQuerierMock: MockProxy; + let providerMock: MockProxy; let gasProvider: GasProvider; beforeEach(() => { - chainQuerierMock = mock(); - gasProvider = new GasProvider(chainQuerierMock, { + providerMock = mock(); + gasProvider = new GasProvider(providerMock, { enableLineaEstimateGas: true, direction: Direction.L1_TO_L2, enforceMaxGasFee: false, - maxFeePerGas: DEFAULT_MAX_FEE_PER_GAS, + maxFeePerGasCap: DEFAULT_MAX_FEE_PER_GAS_CAP, gasEstimationPercentile: DEFAULT_GAS_ESTIMATION_PERCENTILE, }); }); afterEach(() => { - mockClear(chainQuerierMock); + mockClear(providerMock); jest.clearAllMocks(); }); @@ -49,7 +50,7 @@ describe("GasProvider", () => { }); it("should use LineaGasProvider when enableLineaEstimateGas is enabled", async () => { - jest.spyOn(chainQuerierMock, "sendRequest").mockResolvedValueOnce({ + jest.spyOn(providerMock, "send").mockResolvedValueOnce({ gasLimit: "0x300000", baseFeePerGas: "0x7", priorityFeePerGas: toBeHex(DEFAULT_MAX_FEE_PER_GAS), @@ -68,18 +69,18 @@ describe("GasProvider", () => { }); it("should use DefaultGasProvider when enableLineaEstimateGas is disabled", async () => { - gasProvider = new GasProvider(chainQuerierMock, { + gasProvider = new GasProvider(providerMock, { enableLineaEstimateGas: false, direction: Direction.L1_TO_L2, enforceMaxGasFee: false, - maxFeePerGas: DEFAULT_MAX_FEE_PER_GAS, + maxFeePerGasCap: DEFAULT_MAX_FEE_PER_GAS_CAP, gasEstimationPercentile: DEFAULT_GAS_ESTIMATION_PERCENTILE, }); - jest.spyOn(chainQuerierMock, "getCurrentBlockNumber").mockResolvedValueOnce(1); + jest.spyOn(providerMock, "getBlockNumber").mockResolvedValueOnce(1); const estimatedGasLimit = 50_000n; - jest.spyOn(chainQuerierMock, "estimateGas").mockResolvedValueOnce(estimatedGasLimit); - jest.spyOn(chainQuerierMock, "sendRequest").mockResolvedValueOnce(testFeeHistory); + jest.spyOn(providerMock, "estimateGas").mockResolvedValueOnce(estimatedGasLimit); + jest.spyOn(providerMock, "send").mockResolvedValueOnce(testFeeHistory); const gasFees = await gasProvider.getGasFees(); @@ -93,16 +94,16 @@ describe("GasProvider", () => { describe("L2 to L1", () => { it("should use DefaultGasProvider", async () => { - gasProvider = new GasProvider(chainQuerierMock, { + gasProvider = new GasProvider(providerMock, { enableLineaEstimateGas: false, direction: Direction.L2_TO_L1, enforceMaxGasFee: false, - maxFeePerGas: DEFAULT_MAX_FEE_PER_GAS, + maxFeePerGasCap: DEFAULT_MAX_FEE_PER_GAS_CAP, gasEstimationPercentile: DEFAULT_GAS_ESTIMATION_PERCENTILE, }); - jest.spyOn(chainQuerierMock, "getCurrentBlockNumber").mockResolvedValueOnce(1); - jest.spyOn(chainQuerierMock, "sendRequest").mockResolvedValueOnce(testFeeHistory); + jest.spyOn(providerMock, "getBlockNumber").mockResolvedValueOnce(1); + jest.spyOn(providerMock, "send").mockResolvedValueOnce(testFeeHistory); const gasFees = await gasProvider.getGasFees(); @@ -120,11 +121,11 @@ describe("GasProvider", () => { }); it("should use DefaultGasProvider if direction == L2_TO_L1", () => { - gasProvider = new GasProvider(chainQuerierMock, { + gasProvider = new GasProvider(providerMock, { enableLineaEstimateGas: false, direction: Direction.L2_TO_L1, enforceMaxGasFee: false, - maxFeePerGas: DEFAULT_MAX_FEE_PER_GAS, + maxFeePerGasCap: DEFAULT_MAX_FEE_PER_GAS_CAP, gasEstimationPercentile: DEFAULT_GAS_ESTIMATION_PERCENTILE, }); expect(gasProvider.getMaxFeePerGas()).toStrictEqual(DEFAULT_MAX_FEE_PER_GAS); diff --git a/sdk/src/clients/blockchain/gas/__tests__/LineaGasProvider.test.ts b/sdk/src/clients/gas/__tests__/LineaGasProvider.test.ts similarity index 55% rename from sdk/src/clients/blockchain/gas/__tests__/LineaGasProvider.test.ts rename to sdk/src/clients/gas/__tests__/LineaGasProvider.test.ts index c4eb6dcb5..7936754f8 100644 --- a/sdk/src/clients/blockchain/gas/__tests__/LineaGasProvider.test.ts +++ b/sdk/src/clients/gas/__tests__/LineaGasProvider.test.ts @@ -1,37 +1,38 @@ import { describe, afterEach, jest, it, expect, beforeEach } from "@jest/globals"; import { MockProxy, mock, mockClear } from "jest-mock-extended"; -import { testL1NetworkConfig } from "../../../../utils/testing/constants"; import { LineaGasProvider } from "../LineaGasProvider"; -import { ChainQuerier } from "../../ChainQuerier"; -import { generateTransactionRequest } from "../../../../utils/testing/helpers"; +import { generateTransactionRequest } from "../../../utils/testing/helpers"; import { toBeHex } from "ethers"; +import { LineaProvider } from "../../providers"; + +const MAX_FEE_PER_GAS = 100_000_000n; describe("LineaGasProvider", () => { - let chainQuerierMock: MockProxy; + let providerMock: MockProxy; let lineaGasProvider: LineaGasProvider; beforeEach(() => { - chainQuerierMock = mock(); - lineaGasProvider = new LineaGasProvider(chainQuerierMock, { - maxFeePerGas: testL1NetworkConfig.claiming.maxFeePerGas, + providerMock = mock(); + lineaGasProvider = new LineaGasProvider(providerMock, { + maxFeePerGasCap: MAX_FEE_PER_GAS, enforceMaxGasFee: false, }); }); afterEach(() => { - mockClear(chainQuerierMock); + mockClear(providerMock); }); describe("getGasFees", () => { it("should return maxFeePerGas, maxPriorityFeePerGas from config when enforceMaxGasFee option is enabled", async () => { - lineaGasProvider = new LineaGasProvider(chainQuerierMock, { - maxFeePerGas: testL1NetworkConfig.claiming.maxFeePerGas, + lineaGasProvider = new LineaGasProvider(providerMock, { + maxFeePerGasCap: MAX_FEE_PER_GAS, enforceMaxGasFee: true, }); - jest.spyOn(chainQuerierMock, "getCurrentBlockNumber").mockResolvedValueOnce(1); - const sendRequestSpy = jest.spyOn(chainQuerierMock, "sendRequest").mockResolvedValueOnce({ + jest.spyOn(providerMock, "getBlockNumber").mockResolvedValueOnce(1); + const sendRequestSpy = jest.spyOn(providerMock, "send").mockResolvedValueOnce({ baseFeePerGas: "0x7", - priorityFeePerGas: toBeHex(testL1NetworkConfig.claiming.maxFeePerGas), + priorityFeePerGas: toBeHex(MAX_FEE_PER_GAS), gasLimit: toBeHex(50_000n), }); @@ -40,18 +41,18 @@ describe("LineaGasProvider", () => { const fees = await lineaGasProvider.getGasFees(transactionRequest); expect(fees).toStrictEqual({ - maxFeePerGas: testL1NetworkConfig.claiming.maxFeePerGas, - maxPriorityFeePerGas: testL1NetworkConfig.claiming.maxFeePerGas, + maxFeePerGas: MAX_FEE_PER_GAS, + maxPriorityFeePerGas: MAX_FEE_PER_GAS, gasLimit: 50_000n, }); expect(sendRequestSpy).toHaveBeenCalledTimes(1); }); it("should return maxFeePerGas, maxPriorityFeePerGas and gasLimit", async () => { - jest.spyOn(chainQuerierMock, "getCurrentBlockNumber").mockResolvedValueOnce(1); - const sendRequestSpy = jest.spyOn(chainQuerierMock, "sendRequest").mockResolvedValueOnce({ + jest.spyOn(providerMock, "getBlockNumber").mockResolvedValueOnce(1); + const sendRequestSpy = jest.spyOn(providerMock, "send").mockResolvedValueOnce({ baseFeePerGas: "0x7", - priorityFeePerGas: toBeHex(testL1NetworkConfig.claiming.maxFeePerGas), + priorityFeePerGas: toBeHex(MAX_FEE_PER_GAS), gasLimit: toBeHex(50_000n), }); @@ -60,7 +61,7 @@ describe("LineaGasProvider", () => { const fees = await lineaGasProvider.getGasFees(transactionRequest); const expectedBaseFee = (BigInt("0x7") * BigInt(1.35 * 100)) / 100n; - const expectedPriorityFeePerGas = (testL1NetworkConfig.claiming.maxFeePerGas * BigInt(1.05 * 100)) / 100n; + const expectedPriorityFeePerGas = (MAX_FEE_PER_GAS * BigInt(1.05 * 100)) / 100n; const expectedMaxFeePerGas = expectedBaseFee + expectedPriorityFeePerGas; expect(fees).toStrictEqual({ diff --git a/sdk/src/clients/gas/index.ts b/sdk/src/clients/gas/index.ts new file mode 100644 index 000000000..b2fa56c8a --- /dev/null +++ b/sdk/src/clients/gas/index.ts @@ -0,0 +1,3 @@ +export { DefaultGasProvider } from "./DefaultGasProvider"; +export { GasProvider } from "./GasProvider"; +export { LineaGasProvider } from "./LineaGasProvider"; diff --git a/sdk/src/clients/blockchain/linea/EthersL2MessageServiceLogClient.ts b/sdk/src/clients/linea/EthersL2MessageServiceLogClient.ts similarity index 93% rename from sdk/src/clients/blockchain/linea/EthersL2MessageServiceLogClient.ts rename to sdk/src/clients/linea/EthersL2MessageServiceLogClient.ts index f26a62572..7e758197f 100644 --- a/sdk/src/clients/blockchain/linea/EthersL2MessageServiceLogClient.ts +++ b/sdk/src/clients/linea/EthersL2MessageServiceLogClient.ts @@ -1,13 +1,10 @@ -import { JsonRpcProvider } from "ethers"; -import { MessageSent, ServiceVersionMigrated } from "../../../core/types/Events"; -import { L2MessageService, L2MessageService__factory } from "../typechain"; -import { - IL2MessageServiceLogClient, - MessageSentEventFilters, -} from "../../../core/clients/blockchain/linea/IL2MessageServiceLogClient"; -import { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog } from "../typechain/common"; -import { MessageSentEvent, ServiceVersionMigratedEvent } from "../typechain/L2MessageService"; -import { isUndefined } from "../../../core/utils/shared"; +import { MessageSent, ServiceVersionMigrated } from "../../core/types"; +import { L2MessageService, L2MessageService__factory } from "../../contracts/typechain"; +import { IL2MessageServiceLogClient, MessageSentEventFilters } from "../../core/clients/linea"; +import { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog } from "../../contracts/typechain/common"; +import { MessageSentEvent, ServiceVersionMigratedEvent } from "../../contracts/typechain/L2MessageService"; +import { isUndefined } from "../../core/utils"; +import { LineaBrowserProvider, LineaProvider } from "../providers"; export class EthersL2MessageServiceLogClient implements IL2MessageServiceLogClient { private l2MessageService: L2MessageService; @@ -15,10 +12,10 @@ export class EthersL2MessageServiceLogClient implements IL2MessageServiceLogClie /** * Constructs a new instance of the `EthersL2MessageServiceLogClient`. * - * @param {JsonRpcProvider} provider - The JSON RPC provider for interacting with the Ethereum network. + * @param {LineaProvider | LineaBrowserProvider} provider - The JSON RPC provider for interacting with the Ethereum network. * @param {string} contractAddress - The address of the L2 Message Service contract. */ - constructor(provider: JsonRpcProvider, contractAddress: string) { + constructor(provider: LineaProvider | LineaBrowserProvider, contractAddress: string) { this.l2MessageService = L2MessageService__factory.connect(contractAddress, provider); } diff --git a/sdk/src/clients/blockchain/linea/L2MessageServiceClient.ts b/sdk/src/clients/linea/L2MessageServiceClient.ts similarity index 77% rename from sdk/src/clients/blockchain/linea/L2MessageServiceClient.ts rename to sdk/src/clients/linea/L2MessageServiceClient.ts index 1ba988416..80b138165 100644 --- a/sdk/src/clients/blockchain/linea/L2MessageServiceClient.ts +++ b/sdk/src/clients/linea/L2MessageServiceClient.ts @@ -1,37 +1,41 @@ import { Overrides, ContractTransactionResponse, - JsonRpcProvider, TransactionReceipt, TransactionRequest, TransactionResponse, Signer, Block, + ErrorDescription, } from "ethers"; -import { L2MessageService, L2MessageService__factory } from "../typechain"; -import { GasEstimationError } from "../../../core/errors/GasFeeErrors"; -import { MessageProps } from "../../../core/entities/Message"; -import { OnChainMessageStatus } from "../../../core/enums/MessageEnums"; -import { IL2MessageServiceClient } from "../../../core/clients/blockchain/linea/IL2MessageServiceClient"; -import { ZERO_ADDRESS } from "../../../core/constants"; -import { BaseError } from "../../../core/errors/Base"; -import { SDKMode } from "../../../sdk/config"; -import { formatMessageStatus } from "../../../core/utils/message"; -import { IGasProvider, LineaGasFees } from "../../../core/clients/blockchain/IGasProvider"; -import { IMessageRetriever } from "../../../core/clients/blockchain/IMessageRetriever"; -import { MessageSent } from "../../../core/types/Events"; -import { IL2ChainQuerier } from "../../../core/clients/blockchain/linea/IL2ChainQuerier"; +import { L2MessageService, L2MessageService__factory } from "../../contracts/typechain"; +import { GasEstimationError, BaseError } from "../../core/errors"; +import { Message, SDKMode, MessageSent } from "../../core/types"; +import { OnChainMessageStatus } from "../../core/enums"; +import { IL2MessageServiceClient, ILineaProvider } from "../../core/clients/linea"; +import { ZERO_ADDRESS } from "../../core/constants"; +import { formatMessageStatus, isString } from "../../core/utils"; +import { IGasProvider, LineaGasFees } from "../../core/clients/IGasProvider"; +import { IMessageRetriever } from "../../core/clients/IMessageRetriever"; +import { LineaBrowserProvider, LineaProvider } from "../providers"; export class L2MessageServiceClient implements - IL2MessageServiceClient + IL2MessageServiceClient< + Overrides, + TransactionReceipt, + TransactionResponse, + ContractTransactionResponse, + Signer, + ErrorDescription + > { private readonly contract: L2MessageService; /** * Initializes a new instance of the `L2MessageServiceClient`. * - * @param {IL2ChainQuerier} chainQuerier - The chain querier for interacting with the blockchain. + * @param {ILineaProvider} provider - The provider for interacting with the blockchain. * @param {string} contractAddress - The address of the L2 message service contract. * @param {IMessageRetriever} messageRetriever - An instance of a class implementing the `IMessageRetriever` interface for retrieving messages. * @param {IGasProvider} gasFeeProvider - An instance of a class implementing the `IGasProvider` interface for providing gas fee estimates. @@ -39,12 +43,12 @@ export class L2MessageServiceClient * @param {Signer} [signer] - An optional Ethers.js signer object for signing transactions. */ constructor( - private readonly chainQuerier: IL2ChainQuerier< + private readonly provider: ILineaProvider< TransactionReceipt, Block, TransactionRequest, TransactionResponse, - JsonRpcProvider + LineaProvider | LineaBrowserProvider >, private readonly contractAddress: string, private readonly messageRetriever: IMessageRetriever, @@ -103,7 +107,7 @@ export class L2MessageServiceClient */ private getContract(contractAddress: string, signer?: Signer): L2MessageService { if (this.mode === "read-only") { - return L2MessageService__factory.connect(contractAddress, this.chainQuerier.getProvider()); + return L2MessageService__factory.connect(contractAddress, this.provider); } if (!signer) { @@ -128,12 +132,12 @@ export class L2MessageServiceClient /** * Estimates the gas required for the `claimMessage` transaction. * - * @param {MessageProps & { feeRecipient?: string }} message - The message information object. + * @param {Message & { feeRecipient?: string }} message - The message information object. * @param {Overrides} [overrides={}] - Ethers payable overrides. Defaults to `{}` if not specified. * @returns {Promise} The `claimMessage` transaction gas estimation. */ public async estimateClaimGasFees( - message: MessageProps & { feeRecipient?: string }, + message: Message & { feeRecipient?: string }, overrides: Overrides = {}, ): Promise { if (this.mode === "read-only") { @@ -160,12 +164,12 @@ export class L2MessageServiceClient /** * Claims the message on L2. * - * @param {MessageProps & { feeRecipient?: string }} message - The message information object. + * @param {Message & { feeRecipient?: string }} message - The message information object. * @param {Overrides} [overrides] - Ethers payable overrides. Defaults to `{}` if not specified. * @returns {Promise} The claimMessage transaction info. */ public async claim( - message: MessageProps & { feeRecipient?: string }, + message: Message & { feeRecipient?: string }, overrides: Overrides = {}, ): Promise { if (this.mode === "read-only") { @@ -208,7 +212,7 @@ export class L2MessageServiceClient throw new BaseError("'retryTransactionWithHigherFee' function not callable using readOnly mode."); } - const transaction = await this.chainQuerier.getTransaction(transactionHash); + const transaction = await this.provider.getTransaction(transactionHash); if (!transaction) { throw new BaseError(`Transaction with hash ${transactionHash} not found.`); @@ -218,18 +222,18 @@ export class L2MessageServiceClient let maxFeePerGas; if (!transaction.maxPriorityFeePerGas || !transaction.maxFeePerGas) { - const txFees = await this.chainQuerier.getFees(); + const txFees = await this.provider.getFees(); maxPriorityFeePerGas = txFees.maxPriorityFeePerGas; maxFeePerGas = txFees.maxFeePerGas; } else { maxPriorityFeePerGas = (transaction.maxPriorityFeePerGas * (BigInt(priceBumpPercent) + 100n)) / 100n; maxFeePerGas = (transaction.maxFeePerGas * (BigInt(priceBumpPercent) + 100n)) / 100n; - const maxFeePerGasFromConfig = this.gasFeeProvider.getMaxFeePerGas(); - if (maxPriorityFeePerGas > maxFeePerGasFromConfig) { - maxPriorityFeePerGas = maxFeePerGasFromConfig; + const maxFeePerGasCap = this.gasFeeProvider.getMaxFeePerGas(); + if (maxPriorityFeePerGas > maxFeePerGasCap) { + maxPriorityFeePerGas = maxFeePerGasCap; } - if (maxFeePerGas > maxFeePerGasFromConfig) { - maxFeePerGas = maxFeePerGasFromConfig; + if (maxFeePerGas > maxFeePerGasCap) { + maxFeePerGas = maxFeePerGasCap; } } @@ -246,7 +250,7 @@ export class L2MessageServiceClient }; const signedTransaction = await this.signer!.signTransaction(updatedTransaction); - return await this.chainQuerier.broadcastTransaction(signedTransaction); + return await this.provider.broadcastTransaction(signedTransaction); } /** @@ -262,15 +266,15 @@ export class L2MessageServiceClient } /** - * Determines if a transaction failed due to exceeding the rate limit. - * - * @param {string} transactionHash - The hash of the transaction to check. - * @returns {Promise} A promise that resolves to `true` if the transaction failed due to a rate limit exceedance, otherwise `false`. + * Parses the error from the transaction. + * @param {string} transactionHash - The transaction hash. + * @returns {Promise} The error description or the error bytes. */ - public async isRateLimitExceededError(transactionHash: string): Promise { + public async parseTransactionError(transactionHash: string): Promise { + let errorEncodedData = "0x"; try { - const tx = await this.chainQuerier.getTransaction(transactionHash); - const errorEncodedData = await this.chainQuerier.ethCall({ + const tx = await this.provider.getTransaction(transactionHash); + errorEncodedData = await this.provider.call({ to: tx?.to, from: tx?.from, nonce: tx?.nonce, @@ -283,16 +287,36 @@ export class L2MessageServiceClient maxFeePerGas: tx?.maxFeePerGas, }); const error = this.contract.interface.parseError(errorEncodedData); - return error?.name === "RateLimitExceeded"; + + if (!error) { + return errorEncodedData; + } + + return error; } catch (e) { + return errorEncodedData; + } + } + + /** + * Checks if an error is of type 'RateLimitExceeded'. + * @param {string} transactionHash - The transaction hash. + * @returns {Promise} True if the error type is 'RateLimitExceeded', false otherwise. + */ + public async isRateLimitExceededError(transactionHash: string): Promise { + const parsedError = await this.parseTransactionError(transactionHash); + + if (isString(parsedError)) { return false; } + + return parsedError.name === "RateLimitExceeded"; } /** * Encodes the transaction data for claiming a message. * - * @param {MessageProps & { feeRecipient?: string }} message - The message properties including an optional fee recipient. + * @param {Message & { feeRecipient?: string }} message - The message properties including an optional fee recipient. * @param {string} message.messageSender - The address of the message sender. * @param {string} message.destination - The destination address of the message. * @param {bigint} message.fee - The fee associated with the message. @@ -302,7 +326,7 @@ export class L2MessageServiceClient * @param {string} [message.feeRecipient] - The optional address of the fee recipient. Defaults to ZERO_ADDRESS if not provided. * @returns {string} The encoded transaction data for claiming the message. */ - public encodeClaimMessageTransactionData(message: MessageProps & { feeRecipient?: string }): string { + public encodeClaimMessageTransactionData(message: Message & { feeRecipient?: string }): string { const { messageSender, destination, fee, value, calldata, messageNonce, feeRecipient } = message; const l2FeeRecipient = feeRecipient ?? ZERO_ADDRESS; diff --git a/sdk/src/clients/blockchain/linea/L2MessageServiceMessageRetriever.ts b/sdk/src/clients/linea/L2MessageServiceMessageRetriever.ts similarity index 74% rename from sdk/src/clients/blockchain/linea/L2MessageServiceMessageRetriever.ts rename to sdk/src/clients/linea/L2MessageServiceMessageRetriever.ts index 5d7884394..119b7dbff 100644 --- a/sdk/src/clients/blockchain/linea/L2MessageServiceMessageRetriever.ts +++ b/sdk/src/clients/linea/L2MessageServiceMessageRetriever.ts @@ -1,11 +1,11 @@ -import { Block, JsonRpcProvider, TransactionReceipt, TransactionRequest, TransactionResponse } from "ethers"; -import { MessageSent } from "../../../core/types/Events"; -import { MESSAGE_SENT_EVENT_SIGNATURE } from "../../../core/constants"; -import { isNull } from "../../../core/utils/shared"; -import { L2MessageService, L2MessageService__factory } from "../typechain"; -import { IMessageRetriever } from "../../../core/clients/blockchain/IMessageRetriever"; -import { IL2MessageServiceLogClient } from "../../../core/clients/blockchain/linea/IL2MessageServiceLogClient"; -import { IL2ChainQuerier } from "../../../core/clients/blockchain/linea/IL2ChainQuerier"; +import { Block, TransactionReceipt, TransactionRequest, TransactionResponse } from "ethers"; +import { MessageSent } from "../../core/types"; +import { MESSAGE_SENT_EVENT_SIGNATURE } from "../../core/constants"; +import { isNull } from "../../core/utils"; +import { L2MessageService, L2MessageService__factory } from "../../contracts/typechain"; +import { IMessageRetriever } from "../../core/clients/IMessageRetriever"; +import { ILineaProvider, IL2MessageServiceLogClient } from "../../core/clients/linea"; +import { LineaBrowserProvider, LineaProvider } from "../providers"; export class L2MessageServiceMessageRetriever implements IMessageRetriever { private readonly contract: L2MessageService; @@ -13,22 +13,22 @@ export class L2MessageServiceMessageRetriever implements IMessageRetriever, private readonly l2MessageServiceLogClient: IL2MessageServiceLogClient, private readonly contractAddress: string, ) { - this.contract = L2MessageService__factory.connect(contractAddress, this.chainQuerier.getProvider()); + this.contract = L2MessageService__factory.connect(contractAddress, this.provider); } /** @@ -53,7 +53,7 @@ export class L2MessageServiceMessageRetriever implements IMessageRetriever} An array of message information or null if not found. */ public async getMessagesByTransactionHash(transactionHash: string): Promise { - const receipt = await this.chainQuerier.getTransactionReceipt(transactionHash); + const receipt = await this.provider.getTransactionReceipt(transactionHash); if (!receipt) { return null; } @@ -85,7 +85,7 @@ export class L2MessageServiceMessageRetriever implements IMessageRetriever { - let providerMock: MockProxy; + let providerMock: MockProxy; let l2MessgaeServiceMock: MockProxy; let l2MessgaeServiceLogClient: EthersL2MessageServiceLogClient; beforeEach(() => { - providerMock = mock(); + providerMock = mock(); l2MessgaeServiceMock = mock(); mockProperty(l2MessgaeServiceMock, "filters", { ...l2MessgaeServiceMock.filters, @@ -29,10 +28,7 @@ describe("TestEthersL2MessgaeServiceLogClient", () => { } as any); jest.spyOn(L2MessageService__factory, "connect").mockReturnValue(l2MessgaeServiceMock); - l2MessgaeServiceLogClient = new EthersL2MessageServiceLogClient( - providerMock, - testL2NetworkConfig.messageServiceContractAddress, - ); + l2MessgaeServiceLogClient = new EthersL2MessageServiceLogClient(providerMock, TEST_CONTRACT_ADDRESS_2); }); afterEach(() => { diff --git a/sdk/src/clients/blockchain/linea/__tests__/L2MessageServiceClient.test.ts b/sdk/src/clients/linea/__tests__/L2MessageServiceClient.test.ts similarity index 94% rename from sdk/src/clients/blockchain/linea/__tests__/L2MessageServiceClient.test.ts rename to sdk/src/clients/linea/__tests__/L2MessageServiceClient.test.ts index 3b5c20a54..b6943f31c 100644 --- a/sdk/src/clients/blockchain/linea/__tests__/L2MessageServiceClient.test.ts +++ b/sdk/src/clients/linea/__tests__/L2MessageServiceClient.test.ts @@ -1,37 +1,39 @@ import { describe, afterEach, it, expect, beforeEach } from "@jest/globals"; import { MockProxy, mock, mockClear, mockDeep } from "jest-mock-extended"; -import { ContractTransactionResponse, FeeData, JsonRpcProvider, Wallet } from "ethers"; +import { ContractTransactionResponse, Wallet } from "ethers"; import { TEST_MESSAGE_HASH, TEST_CONTRACT_ADDRESS_1, TEST_TRANSACTION_HASH, TEST_ADDRESS_2, TEST_ADDRESS_1, -} from "../../../../utils/testing/constants"; -import { L2MessageService, L2MessageService__factory } from "../../typechain"; + DEFAULT_MAX_FEE_PER_GAS, +} from "../../../utils/testing/constants/common"; +import { L2MessageService, L2MessageService__factory } from "../../../contracts/typechain"; import { generateL2MessageServiceClient, generateMessage, generateTransactionResponse, mockProperty, -} from "../../../../utils/testing/helpers"; +} from "../../../utils/testing/helpers"; import { L2MessageServiceClient } from "../L2MessageServiceClient"; -import { DEFAULT_MAX_FEE_PER_GAS, ZERO_ADDRESS } from "../../../../core/constants"; -import { OnChainMessageStatus } from "../../../../core/enums/MessageEnums"; -import { GasEstimationError } from "../../../../core/errors/GasFeeErrors"; -import { BaseError } from "../../../../core/errors/Base"; -import { LineaGasProvider } from "../../gas/LineaGasProvider"; +import { ZERO_ADDRESS } from "../../../core/constants"; +import { OnChainMessageStatus } from "../../../core/enums/message"; +import { GasEstimationError } from "../../../core/errors/GasFeeErrors"; +import { BaseError } from "../../../core/errors"; +import { LineaProvider } from "../../providers"; +import { GasProvider } from "../../gas"; describe("TestL2MessageServiceClient", () => { - let providerMock: MockProxy; + let providerMock: MockProxy; let walletMock: MockProxy; let l2MessageServiceMock: MockProxy; let l2MessageServiceClient: L2MessageServiceClient; - let gasFeeProvider: LineaGasProvider; + let gasFeeProvider: GasProvider; beforeEach(() => { - providerMock = mock(); + providerMock = mock(); walletMock = mock(); l2MessageServiceMock = mockDeep(); @@ -317,7 +319,7 @@ describe("TestL2MessageServiceClient", () => { TEST_CONTRACT_ADDRESS_1, "read-write", walletMock, - { maxFeePerGas: 500000000n }, + { maxFeePerGasCap: 500000000n }, ).l2MessageServiceClient; await l2MessageServiceClient.retryTransactionWithHigherFee(TEST_TRANSACTION_HASH, 1000); @@ -346,14 +348,13 @@ describe("TestL2MessageServiceClient", () => { const getTransactionSpy = jest.spyOn(providerMock, "getTransaction").mockResolvedValue(transactionResponse); const signTransactionSpy = jest.spyOn(walletMock, "signTransaction").mockResolvedValue(""); const sendTransactionSpy = jest.spyOn(providerMock, "broadcastTransaction"); - const getFeeDataSpy = jest.spyOn(providerMock, "getFeeData").mockResolvedValueOnce({ + const getFeeDataSpy = jest.spyOn(providerMock, "getFees").mockResolvedValueOnce({ maxFeePerGas: DEFAULT_MAX_FEE_PER_GAS, maxPriorityFeePerGas: DEFAULT_MAX_FEE_PER_GAS, - gasPrice: 1n, - } as FeeData); + }); const clients = generateL2MessageServiceClient(providerMock, TEST_CONTRACT_ADDRESS_1, "read-write", walletMock, { - maxFeePerGas: 500000000n, + maxFeePerGasCap: 500000000n, enforceMaxGasFee: true, }); diff --git a/sdk/src/clients/blockchain/linea/__tests__/L2MessageServiceMessageRetriever.test.ts b/sdk/src/clients/linea/__tests__/L2MessageServiceMessageRetriever.test.ts similarity index 92% rename from sdk/src/clients/blockchain/linea/__tests__/L2MessageServiceMessageRetriever.test.ts rename to sdk/src/clients/linea/__tests__/L2MessageServiceMessageRetriever.test.ts index 1ffe89247..6d7cb64e5 100644 --- a/sdk/src/clients/blockchain/linea/__tests__/L2MessageServiceMessageRetriever.test.ts +++ b/sdk/src/clients/linea/__tests__/L2MessageServiceMessageRetriever.test.ts @@ -1,25 +1,26 @@ import { describe, beforeEach } from "@jest/globals"; -import { JsonRpcProvider, Wallet } from "ethers"; +import { Wallet } from "ethers"; import { MockProxy, mock } from "jest-mock-extended"; import { TEST_CONTRACT_ADDRESS_1, TEST_MESSAGE_HASH, TEST_TRANSACTION_HASH, - testMessageSentEvent, -} from "../../../../utils/testing/constants"; -import { generateL2MessageServiceClient, generateTransactionReceipt } from "../../../../utils/testing/helpers"; +} from "../../../utils/testing/constants/common"; +import { testMessageSentEvent } from "../../../utils/testing/constants/events"; +import { generateL2MessageServiceClient, generateTransactionReceipt } from "../../../utils/testing/helpers"; import { L2MessageServiceMessageRetriever } from "../L2MessageServiceMessageRetriever"; import { EthersL2MessageServiceLogClient } from "../EthersL2MessageServiceLogClient"; +import { LineaProvider } from "../../providers"; describe("L2MessageServiceMessageRetriever", () => { - let providerMock: MockProxy; + let providerMock: MockProxy; let walletMock: MockProxy; let messageRetriever: L2MessageServiceMessageRetriever; let l2MessageServiceLogClient: EthersL2MessageServiceLogClient; beforeEach(() => { - providerMock = mock(); + providerMock = mock(); walletMock = mock(); const clients = generateL2MessageServiceClient(providerMock, TEST_CONTRACT_ADDRESS_1, "read-write", walletMock); diff --git a/sdk/src/clients/linea/index.ts b/sdk/src/clients/linea/index.ts new file mode 100644 index 000000000..e261f9e8a --- /dev/null +++ b/sdk/src/clients/linea/index.ts @@ -0,0 +1,3 @@ +export { EthersL2MessageServiceLogClient } from "./EthersL2MessageServiceLogClient"; +export { L2MessageServiceClient } from "./L2MessageServiceClient"; +export { L2MessageServiceMessageRetriever } from "./L2MessageServiceMessageRetriever"; diff --git a/sdk/src/clients/providers/__tests__/LineaProvider.test.ts b/sdk/src/clients/providers/__tests__/LineaProvider.test.ts new file mode 100644 index 000000000..275edc1fb --- /dev/null +++ b/sdk/src/clients/providers/__tests__/LineaProvider.test.ts @@ -0,0 +1,142 @@ +import { Block, FeeData } from "ethers"; +import { describe, afterEach, it, beforeEach } from "@jest/globals"; +import { LineaProvider } from ".."; +import { DEFAULT_MAX_FEE_PER_GAS } from "../../../utils/testing/constants/common"; + +describe("LineaProvider", () => { + let lineaProvider: LineaProvider; + + beforeEach(() => { + lineaProvider = new LineaProvider(); + }); + + afterEach(() => { + jest.resetAllMocks(); + }); + + describe("getFees", () => { + it("should throw an error when getFeeData function does not return `maxPriorityFeePerGas` or `maxFeePerGas` values", async () => { + jest.spyOn(lineaProvider, "getFeeData").mockResolvedValue({ + maxPriorityFeePerGas: null, + maxFeePerGas: null, + gasPrice: 10n, + } as FeeData); + + await expect(lineaProvider.getFees()).rejects.toThrow("Error getting fee data"); + }); + + it("should return `maxPriorityFeePerGas` and `maxFeePerGas` values", async () => { + jest.spyOn(lineaProvider, "getFeeData").mockResolvedValue({ + maxPriorityFeePerGas: DEFAULT_MAX_FEE_PER_GAS, + maxFeePerGas: DEFAULT_MAX_FEE_PER_GAS, + gasPrice: 10n, + } as FeeData); + + expect(await lineaProvider.getFees()).toStrictEqual({ + maxPriorityFeePerGas: DEFAULT_MAX_FEE_PER_GAS, + maxFeePerGas: DEFAULT_MAX_FEE_PER_GAS, + }); + }); + }); + + describe("getBlockExtraData", () => { + it("should return null if getBlock returns null", async () => { + const blockMocked = null; + jest.spyOn(lineaProvider, "getBlock").mockResolvedValue(blockMocked); + + expect(await lineaProvider.getBlockExtraData("latest")).toBeNull(); + }); + + it("should put requested block number in cache if type of blockNumber param is `number`", async () => { + const blockMocked: Block = { + baseFeePerGas: 7n, + difficulty: 2n, + extraData: + "0x0100989680015eb3c80000ea600000000000000000000000000000000000000024997ceb570c667b9c369d351b384ce97dcfe0dda90696fc3b007b8d7160672548a6716cc33ffe0e4004c555a0c7edd9ddc2545a630f2276a2964dcf856e6ab501", + gasLimit: 61000000n, + gasUsed: 138144n, + hash: "0xc53d0f6b65feabf0422bb897d3f5de2c32d57612f88eb4a366d8076a040a715a", + miner: "0x0000000000000000000000000000000000000000", + nonce: "0x0000000000000000", + number: 1635519, + parentHash: "0xecc7bd0b6d533b13fc65529e5da174062d93f8f426c32929914a375f00a19cc3", + receiptsRoot: "0x0cfd91942f25f029d50078225749dbd8601dd922713e783e4210568ed45b6cd3", + stateRoot: "0xad1346e81f574b511c917cd76c5b70f1d6852b871569bedd9ef02160746e3ffa", + timestamp: 1718030601, + transactions: [], + parentBeaconBlockRoot: null, + blobGasUsed: null, + excessBlobGas: null, + } as unknown as Block; + jest.spyOn(lineaProvider, "getBlock").mockResolvedValue(blockMocked); + + await lineaProvider.getBlockExtraData(10); + + expect(lineaProvider.isCacheValid(10)).toBeTruthy(); + }); + + it("should return extraData from cache if requested blockNumber param type is `number`", async () => { + const blockMocked: Block = { + baseFeePerGas: 7n, + difficulty: 2n, + extraData: + "0x0100989680015eb3c80000ea600000000000000000000000000000000000000024997ceb570c667b9c369d351b384ce97dcfe0dda90696fc3b007b8d7160672548a6716cc33ffe0e4004c555a0c7edd9ddc2545a630f2276a2964dcf856e6ab501", + gasLimit: 61000000n, + gasUsed: 138144n, + hash: "0xc53d0f6b65feabf0422bb897d3f5de2c32d57612f88eb4a366d8076a040a715a", + miner: "0x0000000000000000000000000000000000000000", + nonce: "0x0000000000000000", + number: 1635519, + parentHash: "0xecc7bd0b6d533b13fc65529e5da174062d93f8f426c32929914a375f00a19cc3", + receiptsRoot: "0x0cfd91942f25f029d50078225749dbd8601dd922713e783e4210568ed45b6cd3", + stateRoot: "0xad1346e81f574b511c917cd76c5b70f1d6852b871569bedd9ef02160746e3ffa", + timestamp: 1718030601, + transactions: [], + parentBeaconBlockRoot: null, + blobGasUsed: null, + excessBlobGas: null, + } as unknown as Block; + const getBlockSpy = jest.spyOn(lineaProvider, "getBlock").mockResolvedValue(blockMocked); + + await lineaProvider.getBlockExtraData(10); + + expect(lineaProvider.isCacheValid(10)).toBeTruthy(); + + await lineaProvider.getBlockExtraData(10); + + expect(getBlockSpy).toHaveBeenCalledTimes(1); + }); + + it("should return block extraData", async () => { + const blockMocked: Block = { + baseFeePerGas: 7n, + difficulty: 2n, + extraData: + "0x0100989680015eb3c80000ea600000000000000000000000000000000000000024997ceb570c667b9c369d351b384ce97dcfe0dda90696fc3b007b8d7160672548a6716cc33ffe0e4004c555a0c7edd9ddc2545a630f2276a2964dcf856e6ab501", + gasLimit: 61000000n, + gasUsed: 138144n, + hash: "0xc53d0f6b65feabf0422bb897d3f5de2c32d57612f88eb4a366d8076a040a715a", + miner: "0x0000000000000000000000000000000000000000", + nonce: "0x0000000000000000", + number: 1635519, + parentHash: "0xecc7bd0b6d533b13fc65529e5da174062d93f8f426c32929914a375f00a19cc3", + receiptsRoot: "0x0cfd91942f25f029d50078225749dbd8601dd922713e783e4210568ed45b6cd3", + stateRoot: "0xad1346e81f574b511c917cd76c5b70f1d6852b871569bedd9ef02160746e3ffa", + timestamp: 1718030601, + transactions: [], + parentBeaconBlockRoot: null, + blobGasUsed: null, + excessBlobGas: null, + } as unknown as Block; + + jest.spyOn(lineaProvider, "getBlock").mockResolvedValue(blockMocked); + + expect(await lineaProvider.getBlockExtraData("latest")).toStrictEqual({ + version: 1, + fixedCost: 10000000000, + variableCost: 22983624000, + ethGasPrice: 60000000, + }); + }); + }); +}); diff --git a/sdk/src/clients/providers/__tests__/Provider.test.ts b/sdk/src/clients/providers/__tests__/Provider.test.ts new file mode 100644 index 000000000..b64b17e88 --- /dev/null +++ b/sdk/src/clients/providers/__tests__/Provider.test.ts @@ -0,0 +1,41 @@ +import { FeeData } from "ethers"; +import { describe, afterEach, it, beforeEach } from "@jest/globals"; +import { Provider } from ".."; +import { DEFAULT_MAX_FEE_PER_GAS } from "../../../utils/testing/constants/common"; + +describe("Provider", () => { + let provider: Provider; + + beforeEach(() => { + provider = new Provider(); + }); + + afterEach(() => { + jest.resetAllMocks(); + }); + + describe("getFees", () => { + it("should throw an error when getFeeData function does not return `maxPriorityFeePerGas` or `maxFeePerGas` values", async () => { + jest.spyOn(provider, "getFeeData").mockResolvedValue({ + maxPriorityFeePerGas: null, + maxFeePerGas: null, + gasPrice: 10n, + } as FeeData); + + await expect(provider.getFees()).rejects.toThrow("Error getting fee data"); + }); + + it("should return `maxPriorityFeePerGas` and `maxFeePerGas` values", async () => { + jest.spyOn(provider, "getFeeData").mockResolvedValue({ + maxPriorityFeePerGas: DEFAULT_MAX_FEE_PER_GAS, + maxFeePerGas: DEFAULT_MAX_FEE_PER_GAS, + gasPrice: 10n, + } as FeeData); + + expect(await provider.getFees()).toStrictEqual({ + maxPriorityFeePerGas: DEFAULT_MAX_FEE_PER_GAS, + maxFeePerGas: DEFAULT_MAX_FEE_PER_GAS, + }); + }); + }); +}); diff --git a/sdk/src/clients/providers/index.ts b/sdk/src/clients/providers/index.ts new file mode 100644 index 000000000..d77aa1a02 --- /dev/null +++ b/sdk/src/clients/providers/index.ts @@ -0,0 +1,2 @@ +export { Provider, BrowserProvider } from "./provider"; +export { LineaProvider, LineaBrowserProvider } from "./lineaProvider"; diff --git a/sdk/src/clients/providers/lineaProvider.ts b/sdk/src/clients/providers/lineaProvider.ts new file mode 100644 index 000000000..6be28da84 --- /dev/null +++ b/sdk/src/clients/providers/lineaProvider.ts @@ -0,0 +1,82 @@ +import { BlockTag, dataSlice, ethers, toNumber } from "ethers"; +import { BlockExtraData } from "../../core/clients/linea"; +import { GasFees } from "../../core/clients/IGasProvider"; +import { BaseError } from "../../core/errors"; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +type Constructor = new (...args: any[]) => T; + +function LineaProviderMixIn>(Base: TBase) { + return class extends Base { + public blockExtraDataCache: BlockExtraData; + public cacheIsValidForBlockNumber: bigint; + + /** + * Retrieves the current gas fees. + * + * @returns {Promise} A promise that resolves to an object containing the current gas fees. + * @throws {BaseError} If there is an error getting the fee data. + */ + public async getFees(): Promise { + const { maxPriorityFeePerGas, maxFeePerGas } = await this.getFeeData(); + + if (!maxPriorityFeePerGas || !maxFeePerGas) { + throw new BaseError("Error getting fee data"); + } + + return { maxPriorityFeePerGas, maxFeePerGas }; + } + + /** + * Fetches and formats extra data from a block. + * + * @param {BlockTag} blockNumber - The block number or tag to fetch extra data for. + * @returns {Promise} A promise that resolves to an object containing the formatted block's extra data, or null if the block is not found. + */ + public async getBlockExtraData(blockNumber: BlockTag): Promise { + if (typeof blockNumber === "number" && this.isCacheValid(blockNumber)) { + return this.blockExtraDataCache; + } + + const block = await this.getBlock(blockNumber); + + if (!block) { + return null; + } + + const version = dataSlice(block.extraData, 0, 1); + const fixedCost = dataSlice(block.extraData, 1, 5); + const variableCost = dataSlice(block.extraData, 5, 9); + const ethGasPrice = dataSlice(block.extraData, 9, 13); + + // Original values are in Kwei; convert them back to wei + const extraData = { + version: toNumber(version), + fixedCost: toNumber(fixedCost) * 1000, + variableCost: toNumber(variableCost) * 1000, + ethGasPrice: toNumber(ethGasPrice) * 1000, + }; + + if (typeof blockNumber === "number") { + this.cacheIsValidForBlockNumber = BigInt(blockNumber); + this.blockExtraDataCache = extraData; + } + return extraData; + } + + /** + * Checks if the cached block extra data is still valid based on the current block number. + * + * @private + * @param {number} currentBlockNumber - The current block number. + * @returns {boolean} True if the cache is valid, false otherwise. + */ + public isCacheValid(currentBlockNumber: number): boolean { + return this.cacheIsValidForBlockNumber >= BigInt(currentBlockNumber); + } + }; +} + +export class LineaProvider extends LineaProviderMixIn(ethers.JsonRpcProvider) {} + +export class LineaBrowserProvider extends LineaProviderMixIn(ethers.BrowserProvider) {} diff --git a/sdk/src/clients/providers/provider.ts b/sdk/src/clients/providers/provider.ts new file mode 100644 index 000000000..34d659cce --- /dev/null +++ b/sdk/src/clients/providers/provider.ts @@ -0,0 +1,34 @@ +import { ethers } from "ethers"; +import { BaseError } from "../../core/errors"; +import { GasFees } from "../../core/clients/IGasProvider"; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +type Constructor = new (...args: any[]) => T; + +export function ProviderMixIn>(Base: TBase) { + return class Provider extends Base { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + constructor(...args: any[]) { + super(...args); + } + + /** + * Retrieves the current gas fees. + * + * @returns {Promise} A promise that resolves to an object containing the current gas fees. + * @throws {BaseError} If there is an error getting the fee data. + */ + public async getFees(): Promise { + const { maxPriorityFeePerGas, maxFeePerGas } = await this.getFeeData(); + + if (!maxPriorityFeePerGas || !maxFeePerGas) { + throw new BaseError("Error getting fee data"); + } + + return { maxPriorityFeePerGas, maxFeePerGas }; + } + }; +} + +export class Provider extends ProviderMixIn(ethers.JsonRpcProvider) {} +export class BrowserProvider extends ProviderMixIn(ethers.BrowserProvider) {} diff --git a/sdk/src/contracts/abis/L2MessageService.abi b/sdk/src/contracts/abis/L2MessageService.abi new file mode 100644 index 000000000..5673358be --- /dev/null +++ b/sdk/src/contracts/abis/L2MessageService.abi @@ -0,0 +1,1297 @@ +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ArrayLengthsDoNotMatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "FeePaymentFailed", + "type": "error" + }, + { + "inputs": [], + "name": "FeeTooLow", + "type": "error" + }, + { + "inputs": [], + "name": "FinalRollingHashIsZero", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + } + ], + "name": "IsNotPaused", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + } + ], + "name": "IsPaused", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "found", + "type": "uint256" + } + ], + "name": "L1MessageNumberSynchronizationWrong", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "found", + "type": "bytes32" + } + ], + "name": "L1RollingHashSynchronizationWrong", + "type": "error" + }, + { + "inputs": [], + "name": "LimitIsZero", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "messageHash", + "type": "bytes32" + } + ], + "name": "MessageDoesNotExistOrHasAlreadyBeenClaimed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "MessageHashesListLengthHigherThanOneHundred", + "type": "error" + }, + { + "inputs": [], + "name": "MessageHashesListLengthIsZero", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "name": "MessageSendingFailed", + "type": "error" + }, + { + "inputs": [], + "name": "PeriodIsZero", + "type": "error" + }, + { + "inputs": [], + "name": "RateLimitExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "ValueSentTooLow", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroHashNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "resettingAddress", + "type": "address" + } + ], + "name": "AmountUsedInPeriodReset", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32[]", + "name": "messageHashes", + "type": "bytes32[]" + } + ], + "name": "L1L2MessageHashesAddedToInbox", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "amountChangeBy", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "amountUsedLoweredToLimit", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "usedAmountResetToZero", + "type": "bool" + } + ], + "name": "LimitAmountChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "_messageHash", + "type": "bytes32" + } + ], + "name": "MessageClaimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "_messageHash", + "type": "bytes32" + } + ], + "name": "MessageSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "previousMinimumFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMinimumFee", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "calledBy", + "type": "address" + } + ], + "name": "MinimumFeeChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "PauseTypeRoleSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "messageSender", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "periodInSeconds", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "limitInWei", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentPeriodEnd", + "type": "uint256" + } + ], + "name": "RateLimitInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "messageNumber", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "rollingHash", + "type": "bytes32" + } + ], + "name": "RollingHashUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "version", + "type": "uint256" + } + ], + "name": "ServiceVersionMigrated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IPauseManager.PauseType", + "name": "unPauseType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "UnPauseTypeRoleSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "messageSender", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + } + ], + "name": "UnPaused", + "type": "event" + }, + { + "inputs": [], + "name": "CONTRACT_VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "INBOX_STATUS_CLAIMED", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "INBOX_STATUS_RECEIVED", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "INBOX_STATUS_UNKNOWN", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "L1_L2_MESSAGE_SETTER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MINIMUM_FEE_SETTER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PAUSE_ALL_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PAUSE_L1_L2_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PAUSE_L2_L1_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "RATE_LIMIT_SETTER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UNPAUSE_ALL_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UNPAUSE_L1_L2_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UNPAUSE_L2_L1_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "USED_RATE_LIMIT_RESETTER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "_messageHashes", + "type": "bytes32[]" + }, + { + "internalType": "uint256", + "name": "_startingMessageNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_finalMessageNumber", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_finalRollingHash", + "type": "bytes32" + } + ], + "name": "anchorL1L2MessageHashes", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_feeRecipient", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "claimMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "currentPeriodAmountInWei", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentPeriodEnd", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "messageHash", + "type": "bytes32" + } + ], + "name": "inboxL1L2MessageStatus", + "outputs": [ + { + "internalType": "uint256", + "name": "messageStatus", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_rateLimitPeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_rateLimitAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_defaultAdmin", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "addressWithRole", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "internalType": "struct IPermissionsManager.RoleAddress[]", + "name": "_roleAddresses", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "internalType": "struct IPauseManager.PauseTypeRole[]", + "name": "_pauseTypeRoles", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "internalType": "struct IPauseManager.PauseTypeRole[]", + "name": "_unpauseTypeRoles", + "type": "tuple[]" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "_pauseType", + "type": "uint8" + } + ], + "name": "isPaused", + "outputs": [ + { + "internalType": "bool", + "name": "pauseTypeIsPaused", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "messageNumber", + "type": "uint256" + } + ], + "name": "l1RollingHashes", + "outputs": [ + { + "internalType": "bytes32", + "name": "rollingHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastAnchoredL1MessageNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "limitInWei", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minimumFeeInWei", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nextMessageNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "_pauseType", + "type": "uint8" + } + ], + "name": "pauseByType", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "pauseType", + "type": "bytes32" + } + ], + "name": "pauseTypeStatuses", + "outputs": [ + { + "internalType": "bool", + "name": "pauseStatus", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periodInSeconds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "addressWithRole", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "internalType": "struct IPermissionsManager.RoleAddress[]", + "name": "_roleAddresses", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "internalType": "struct IPauseManager.PauseTypeRole[]", + "name": "_pauseTypeRoles", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "internalType": "struct IPauseManager.PauseTypeRole[]", + "name": "_unpauseTypeRoles", + "type": "tuple[]" + } + ], + "name": "reinitializePauseTypesAndPermissions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "resetAmountUsedInPeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "resetRateLimitAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + } + ], + "name": "sendMessage", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "sender", + "outputs": [ + { + "internalType": "address", + "name": "originalSender", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_feeInWei", + "type": "uint256" + } + ], + "name": "setMinimumFee", + "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": "enum IPauseManager.PauseType", + "name": "_pauseType", + "type": "uint8" + } + ], + "name": "unPauseByType", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/sdk/src/contracts/abis/LineaRollup.abi b/sdk/src/contracts/abis/LineaRollup.abi new file mode 100644 index 000000000..481271af0 --- /dev/null +++ b/sdk/src/contracts/abis/LineaRollup.abi @@ -0,0 +1,2445 @@ +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ArrayLengthsDoNotMatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "emptyBlobIndex", + "type": "uint256" + } + ], + "name": "BlobSubmissionDataEmpty", + "type": "error" + }, + { + "inputs": [], + "name": "BlobSubmissionDataIsMissing", + "type": "error" + }, + { + "inputs": [], + "name": "BytesLengthNotMultipleOf32", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "bytesLength", + "type": "uint256" + } + ], + "name": "BytesLengthNotMultipleOfTwo", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "currentDataHash", + "type": "bytes32" + } + ], + "name": "DataAlreadySubmitted", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "EmptyBlobDataAtIndex", + "type": "error" + }, + { + "inputs": [], + "name": "EmptySubmissionData", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "FeePaymentFailed", + "type": "error" + }, + { + "inputs": [], + "name": "FeeTooLow", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "shnarf", + "type": "bytes32" + } + ], + "name": "FinalBlobNotSubmitted", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "finalBlockNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastFinalizedBlock", + "type": "uint256" + } + ], + "name": "FinalBlockNumberLessThanOrEqualToLastFinalizedBlock", + "type": "error" + }, + { + "inputs": [], + "name": "FinalBlockStateEqualsZeroHash", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ], + "name": "FinalShnarfWrong", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "l2BlockTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "currentBlockTimestamp", + "type": "uint256" + } + ], + "name": "FinalizationInTheFuture", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ], + "name": "FinalizationStateIncorrect", + "type": "error" + }, + { + "inputs": [], + "name": "FirstByteIsNotZero", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidMerkleProof", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidProof", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "errorReason", + "type": "string" + } + ], + "name": "InvalidProofOrProofVerificationRanOutOfGas", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidProofType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + } + ], + "name": "IsNotPaused", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + } + ], + "name": "IsPaused", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "messageNumber", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "rollingHash", + "type": "bytes32" + } + ], + "name": "L1RollingHashDoesNotExistOnL1", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "merkleRoot", + "type": "bytes32" + } + ], + "name": "L2MerkleRootAlreadyAnchored", + "type": "error" + }, + { + "inputs": [], + "name": "L2MerkleRootDoesNotExist", + "type": "error" + }, + { + "inputs": [], + "name": "LastFinalizationTimeNotLapsed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "leafIndex", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "maxAllowedIndex", + "type": "uint32" + } + ], + "name": "LeafIndexOutOfBounds", + "type": "error" + }, + { + "inputs": [], + "name": "LimitIsZero", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "messageIndex", + "type": "uint256" + } + ], + "name": "MessageAlreadyClaimed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "messageHash", + "type": "bytes32" + } + ], + "name": "MessageDoesNotExistOrHasAlreadyBeenClaimed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "name": "MessageSendingFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "rollingHash", + "type": "bytes32" + } + ], + "name": "MissingMessageNumberForRollingHash", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "messageNumber", + "type": "uint256" + } + ], + "name": "MissingRollingHashForMessageNumber", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyNonFallbackOperator", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "shnarf", + "type": "bytes32" + } + ], + "name": "ParentBlobNotSubmitted", + "type": "error" + }, + { + "inputs": [], + "name": "PeriodIsZero", + "type": "error" + }, + { + "inputs": [], + "name": "PointEvaluationFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "fieldElements", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "blsCurveModulus", + "type": "uint256" + } + ], + "name": "PointEvaluationResponseInvalid", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actual", + "type": "uint256" + } + ], + "name": "PrecompileReturnDataLengthWrong", + "type": "error" + }, + { + "inputs": [], + "name": "ProofIsEmpty", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "actual", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + } + ], + "name": "ProofLengthDifferentThanMerkleDepth", + "type": "error" + }, + { + "inputs": [], + "name": "RateLimitExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "ReentrantCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "bits", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "SafeCastOverflowedUintDowncast", + "type": "error" + }, + { + "inputs": [], + "name": "StartingRootHashDoesNotMatch", + "type": "error" + }, + { + "inputs": [], + "name": "ValueSentTooLow", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroHashNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "resettingAddress", + "type": "address" + } + ], + "name": "AmountUsedInPeriodReset", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "startBlockNumber", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "endBlockNumber", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "shnarf", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "parentStateRootHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "finalStateRootHash", + "type": "bytes32" + } + ], + "name": "DataFinalizedV3", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "parentShnarf", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "shnarf", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "finalStateRootHash", + "type": "bytes32" + } + ], + "name": "DataSubmittedV3", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fallbackOperator", + "type": "address" + } + ], + "name": "FallbackOperatorAddressSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fallbackOperator", + "type": "address" + } + ], + "name": "FallbackOperatorRoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "l2MerkleRoot", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "treeDepth", + "type": "uint256" + } + ], + "name": "L2MerkleRootAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "l2Block", + "type": "uint256" + } + ], + "name": "L2MessagingBlockAnchored", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "amountChangeBy", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "amountUsedLoweredToLimit", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "usedAmountResetToZero", + "type": "bool" + } + ], + "name": "LimitAmountChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes8", + "name": "previousVersion", + "type": "bytes8" + }, + { + "indexed": true, + "internalType": "bytes8", + "name": "newVersion", + "type": "bytes8" + } + ], + "name": "LineaRollupVersionChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "_messageHash", + "type": "bytes32" + } + ], + "name": "MessageClaimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "_messageHash", + "type": "bytes32" + } + ], + "name": "MessageSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "PauseTypeRoleSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "messageSender", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "periodInSeconds", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "limitInWei", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentPeriodEnd", + "type": "uint256" + } + ], + "name": "RateLimitInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "messageNumber", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "rollingHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "messageHash", + "type": "bytes32" + } + ], + "name": "RollingHashUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IPauseManager.PauseType", + "name": "unPauseType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "UnPauseTypeRoleSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "messageSender", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + } + ], + "name": "UnPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "verifierAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "proofType", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifierSetBy", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldVerifierAddress", + "type": "address" + } + ], + "name": "VerifierAddressChanged", + "type": "event" + }, + { + "inputs": [], + "name": "CONTRACT_VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "GENESIS_SHNARF", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "INBOX_STATUS_RECEIVED", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "INBOX_STATUS_UNKNOWN", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "OPERATOR_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "OUTBOX_STATUS_RECEIVED", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "OUTBOX_STATUS_SENT", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "OUTBOX_STATUS_UNKNOWN", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PAUSE_ALL_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PAUSE_BLOB_SUBMISSION_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PAUSE_FINALIZATION_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PAUSE_L1_L2_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PAUSE_L2_L1_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "RATE_LIMIT_SETTER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UNPAUSE_ALL_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UNPAUSE_BLOB_SUBMISSION_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UNPAUSE_FINALIZATION_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UNPAUSE_L1_L2_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UNPAUSE_L2_L1_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "USED_RATE_LIMIT_RESETTER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "VERIFIER_SETTER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "VERIFIER_UNSETTER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "shnarf", + "type": "bytes32" + } + ], + "name": "blobShnarfExists", + "outputs": [ + { + "internalType": "uint256", + "name": "exists", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_feeRecipient", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "claimMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32[]", + "name": "proof", + "type": "bytes32[]" + }, + { + "internalType": "uint256", + "name": "messageNumber", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "leafIndex", + "type": "uint32" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "fee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "feeRecipient", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "merkleRoot", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct IL1MessageService.ClaimMessageWithProofParams", + "name": "_params", + "type": "tuple" + } + ], + "name": "claimMessageWithProof", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "currentFinalizedShnarf", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentFinalizedState", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentL2BlockNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentL2StoredL1MessageNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentL2StoredL1RollingHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentPeriodAmountInWei", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentPeriodEnd", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentTimestamp", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dataHash", + "type": "bytes32" + } + ], + "name": "dataEndingBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "endingBlock", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dataHash", + "type": "bytes32" + } + ], + "name": "dataFinalStateRootHashes", + "outputs": [ + { + "internalType": "bytes32", + "name": "finalStateRootHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dataHash", + "type": "bytes32" + } + ], + "name": "dataParents", + "outputs": [ + { + "internalType": "bytes32", + "name": "parentHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dataHash", + "type": "bytes32" + } + ], + "name": "dataShnarfHashes", + "outputs": [ + { + "internalType": "bytes32", + "name": "shnarfHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dataHash", + "type": "bytes32" + } + ], + "name": "dataStartingBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "startingBlock", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "fallbackOperator", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_aggregatedProof", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_proofType", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "parentStateRootHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "endBlockNumber", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "parentShnarf", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "snarkHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "finalStateRootHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "dataEvaluationPoint", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "dataEvaluationClaim", + "type": "bytes32" + } + ], + "internalType": "struct ILineaRollup.ShnarfData", + "name": "shnarfData", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "lastFinalizedTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "finalTimestamp", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "lastFinalizedL1RollingHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "l1RollingHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "lastFinalizedL1RollingHashMessageNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "l1RollingHashMessageNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "l2MerkleTreesDepth", + "type": "uint256" + }, + { + "internalType": "bytes32[]", + "name": "l2MerkleRoots", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "l2MessagingBlocksOffsets", + "type": "bytes" + } + ], + "internalType": "struct ILineaRollup.FinalizationDataV3", + "name": "_finalizationData", + "type": "tuple" + } + ], + "name": "finalizeBlocks", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "messageHash", + "type": "bytes32" + } + ], + "name": "inboxL2L1MessageStatus", + "outputs": [ + { + "internalType": "uint256", + "name": "messageStatus", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "initialStateRootHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "initialL2BlockNumber", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "genesisTimestamp", + "type": "uint256" + }, + { + "internalType": "address", + "name": "defaultVerifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "rateLimitPeriodInSeconds", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rateLimitAmountInWei", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "addressWithRole", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "internalType": "struct IPermissionsManager.RoleAddress[]", + "name": "roleAddresses", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "internalType": "struct IPauseManager.PauseTypeRole[]", + "name": "pauseTypeRoles", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "internalType": "struct IPauseManager.PauseTypeRole[]", + "name": "unpauseTypeRoles", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "fallbackOperator", + "type": "address" + }, + { + "internalType": "address", + "name": "defaultAdmin", + "type": "address" + } + ], + "internalType": "struct ILineaRollup.InitializationData", + "name": "_initializationData", + "type": "tuple" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_messageNumber", + "type": "uint256" + } + ], + "name": "isMessageClaimed", + "outputs": [ + { + "internalType": "bool", + "name": "isClaimed", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "_pauseType", + "type": "uint8" + } + ], + "name": "isPaused", + "outputs": [ + { + "internalType": "bool", + "name": "pauseTypeIsPaused", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "merkleRoot", + "type": "bytes32" + } + ], + "name": "l2MerkleRootsDepths", + "outputs": [ + { + "internalType": "uint256", + "name": "treeDepth", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "limitInWei", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nextMessageNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "messageHash", + "type": "bytes32" + } + ], + "name": "outboxL1L2MessageStatus", + "outputs": [ + { + "internalType": "uint256", + "name": "messageStatus", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "_pauseType", + "type": "uint8" + } + ], + "name": "pauseByType", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "pauseType", + "type": "bytes32" + } + ], + "name": "pauseTypeStatuses", + "outputs": [ + { + "internalType": "bool", + "name": "pauseStatus", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periodInSeconds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "addressWithRole", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "internalType": "struct IPermissionsManager.RoleAddress[]", + "name": "_roleAddresses", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "internalType": "struct IPauseManager.PauseTypeRole[]", + "name": "_pauseTypeRoles", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "internalType": "struct IPauseManager.PauseTypeRole[]", + "name": "_unpauseTypeRoles", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "_fallbackOperator", + "type": "address" + } + ], + "name": "reinitializeLineaRollupV6", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "resetAmountUsedInPeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "resetRateLimitAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "messageNumber", + "type": "uint256" + } + ], + "name": "rollingHashes", + "outputs": [ + { + "internalType": "bytes32", + "name": "rollingHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + } + ], + "name": "sendMessage", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "sender", + "outputs": [ + { + "internalType": "address", + "name": "originalSender", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_messageNumber", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_rollingHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_lastFinalizedTimestamp", + "type": "uint256" + } + ], + "name": "setFallbackOperator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newVerifierAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_proofType", + "type": "uint256" + } + ], + "name": "setVerifierAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "name": "stateRootHashes", + "outputs": [ + { + "internalType": "bytes32", + "name": "stateRootHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "dataEvaluationClaim", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "kzgCommitment", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "kzgProof", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "finalStateRootHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "snarkHash", + "type": "bytes32" + } + ], + "internalType": "struct ILineaRollup.BlobSubmission[]", + "name": "_blobSubmissions", + "type": "tuple[]" + }, + { + "internalType": "bytes32", + "name": "_parentShnarf", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_finalBlobShnarf", + "type": "bytes32" + } + ], + "name": "submitBlobs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "finalStateRootHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "snarkHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "compressedData", + "type": "bytes" + } + ], + "internalType": "struct ILineaRollup.CompressedCalldataSubmission", + "name": "_submission", + "type": "tuple" + }, + { + "internalType": "bytes32", + "name": "_parentShnarf", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_expectedShnarf", + "type": "bytes32" + } + ], + "name": "submitDataAsCalldata", + "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": [], + "name": "systemMigrationBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "_pauseType", + "type": "uint8" + } + ], + "name": "unPauseByType", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_proofType", + "type": "uint256" + } + ], + "name": "unsetVerifierAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proofType", + "type": "uint256" + } + ], + "name": "verifiers", + "outputs": [ + { + "internalType": "address", + "name": "verifierAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/sdk/src/core/clients/IGasProvider.ts b/sdk/src/core/clients/IGasProvider.ts new file mode 100644 index 000000000..204391999 --- /dev/null +++ b/sdk/src/core/clients/IGasProvider.ts @@ -0,0 +1,56 @@ +import { Direction } from "../enums"; + +export type GasFees = { + maxFeePerGas: bigint; + maxPriorityFeePerGas: bigint; +}; + +export type LineaGasFees = GasFees & { + gasLimit: bigint; +}; + +export type FeeHistory = { + oldestBlock: number; + reward: string[][]; + baseFeePerGas: string[]; + gasUsedRatio: number[]; +}; + +export type LineaEstimateGasResponse = { + baseFeePerGas: string; + priorityFeePerGas: string; + gasLimit: string; +}; + +type BaseGasProviderConfig = { + maxFeePerGasCap: bigint; + enforceMaxGasFee: boolean; +}; + +export type DefaultGasProviderConfig = BaseGasProviderConfig & { + gasEstimationPercentile: number; +}; + +export type LineaGasProviderConfig = BaseGasProviderConfig; + +export type GasProviderConfig = DefaultGasProviderConfig & { + direction: Direction; + enableLineaEstimateGas: boolean; +}; + +export interface IGasProvider { + getGasFees(transactionRequest?: TransactionRequest): Promise; + getMaxFeePerGas(): bigint; +} + +export interface IEthereumGasProvider extends IGasProvider { + getGasFees(): Promise; +} + +export interface ILineaGasProvider extends IGasProvider { + getGasFees(transactionRequest: TransactionRequest): Promise; +} + +export function isLineaGasFees(fees: GasFees | LineaGasFees): fees is LineaGasFees { + return "gasLimit" in fees; +} diff --git a/sdk/src/core/clients/blockchain/IMessageRetriever.ts b/sdk/src/core/clients/IMessageRetriever.ts similarity index 86% rename from sdk/src/core/clients/blockchain/IMessageRetriever.ts rename to sdk/src/core/clients/IMessageRetriever.ts index 38132c535..d8164cfd8 100644 --- a/sdk/src/core/clients/blockchain/IMessageRetriever.ts +++ b/sdk/src/core/clients/IMessageRetriever.ts @@ -1,4 +1,4 @@ -import { MessageSent } from "../../types/Events"; +import { MessageSent } from "../types"; export interface IMessageRetriever { getMessageByMessageHash(messageHash: string): Promise; diff --git a/sdk/src/core/clients/IMessageServiceContract.ts b/sdk/src/core/clients/IMessageServiceContract.ts new file mode 100644 index 000000000..7f1719278 --- /dev/null +++ b/sdk/src/core/clients/IMessageServiceContract.ts @@ -0,0 +1,20 @@ +import { OnChainMessageStatus } from "../enums"; +import { Message, MessageSent } from "../types"; + +export interface IMessageServiceContract< + Overrides, + TransactionReceipt, + TransactionResponse, + ContractTransactionResponse, + ErrorDescription, +> { + getMessageStatus(messageHash: string, overrides?: Overrides): Promise; + getMessageByMessageHash(messageHash: string): Promise; + getMessagesByTransactionHash(transactionHash: string): Promise; + getTransactionReceiptByMessageHash(messageHash: string): Promise; + claim(message: Message & { feeRecipient?: string }, overrides?: Overrides): Promise; + retryTransactionWithHigherFee(transactionHash: string, priceBumpPercent?: number): Promise; + isRateLimitExceeded(messageFee: bigint, messageValue: bigint): Promise; + isRateLimitExceededError(transactionHash: string): Promise; + parseTransactionError(transactionHash: string): Promise; +} diff --git a/sdk/src/core/clients/IProvider.ts b/sdk/src/core/clients/IProvider.ts new file mode 100644 index 000000000..1cd458ae1 --- /dev/null +++ b/sdk/src/core/clients/IProvider.ts @@ -0,0 +1,16 @@ +import { GasFees } from "./IGasProvider"; + +export interface IProvider { + getTransactionCount(address: string, blockTag: string | number | bigint): Promise; + getBlockNumber(): Promise; + getTransactionReceipt(txHash: string): Promise; + getBlock(blockNumber: number | bigint | string): Promise; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + send(methodName: string, params: Array | Record): Promise; + estimateGas(transactionRequest: TransactionRequest): Promise; + getTransaction(transactionHash: string): Promise; + broadcastTransaction(signedTx: string): Promise; + call(transactionRequest: TransactionRequest): Promise; + getFees(): Promise; + get provider(): Provider; +} diff --git a/sdk/src/core/clients/blockchain/linea/IL2ChainQuerier.ts b/sdk/src/core/clients/blockchain/linea/IL2ChainQuerier.ts deleted file mode 100644 index 23f29b0ed..000000000 --- a/sdk/src/core/clients/blockchain/linea/IL2ChainQuerier.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { IChainQuerier } from "../IChainQuerier"; - -export type BlockExtraData = { - version: number; - fixedCost: number; - variableCost: number; - ethGasPrice: number; -}; - -export interface IL2ChainQuerier - extends IChainQuerier { - getBlockExtraData(blockNumber: number | bigint | string): Promise; -} diff --git a/sdk/src/core/clients/ethereum/ILineaRollupClient.ts b/sdk/src/core/clients/ethereum/ILineaRollupClient.ts new file mode 100644 index 000000000..9aea67616 --- /dev/null +++ b/sdk/src/core/clients/ethereum/ILineaRollupClient.ts @@ -0,0 +1,31 @@ +import { Message } from "../../types"; +import { OnChainMessageStatus } from "../../enums"; +import { IMessageServiceContract } from "../IMessageServiceContract"; +import { FinalizationMessagingInfo, Proof } from "./IMerkleTreeService"; + +export interface ILineaRollupClient< + Overrides, + TransactionReceipt, + TransactionResponse, + ContractTransactionResponse, + ErrorDescription, +> extends IMessageServiceContract< + Overrides, + TransactionReceipt, + TransactionResponse, + ContractTransactionResponse, + ErrorDescription + > { + getFinalizationMessagingInfo(transactionHash: string): Promise; + getL2MessageHashesInBlockRange(fromBlock: number, toBlock: number): Promise; + getMessageSiblings(messageHash: string, messageHashes: string[], treeDepth: number): string[]; + getMessageProof(messageHash: string): Promise; + getMessageStatusUsingMessageHash(messageHash: string, overrides: Overrides): Promise; + getMessageStatusUsingMerkleTree(messageHash: string, overrides: Overrides): Promise; + estimateClaimGas(message: Message & { feeRecipient?: string }, overrides?: Overrides): Promise; + estimateClaimWithoutProofGas(message: Message & { feeRecipient?: string }, overrides: Overrides): Promise; + claimWithoutProof( + message: Message & { feeRecipient?: string }, + overrides: Overrides, + ): Promise; +} diff --git a/sdk/src/core/clients/ethereum/ILineaRollupLogClient.ts b/sdk/src/core/clients/ethereum/ILineaRollupLogClient.ts new file mode 100644 index 000000000..aa6795a13 --- /dev/null +++ b/sdk/src/core/clients/ethereum/ILineaRollupLogClient.ts @@ -0,0 +1,38 @@ +import { L2MessagingBlockAnchored, MessageClaimed, MessageSent } from "../../types"; + +export type MessageSentEventFilters = { + from?: string; + to?: string; + messageHash?: string; +}; + +export type L2MessagingBlockAnchoredFilters = { + l2Block: bigint; +}; + +export type MessageClaimedFilters = { + messageHash: string; +}; + +export interface ILineaRollupLogClient { + getMessageSentEvents(params: { + filters?: MessageSentEventFilters; + fromBlock?: number; + toBlock?: string | number; + fromBlockLogIndex?: number; + }): Promise; + + getL2MessagingBlockAnchoredEvents(params: { + filters?: L2MessagingBlockAnchoredFilters; + fromBlock?: number; + toBlock?: string | number; + fromBlockLogIndex?: number; + }): Promise; + + getMessageClaimedEvents(params: { + filters?: MessageClaimedFilters; + fromBlock?: number; + toBlock?: string | number; + fromBlockLogIndex?: number; + }): Promise; +} diff --git a/sdk/src/core/clients/ethereum/IMerkleTreeService.ts b/sdk/src/core/clients/ethereum/IMerkleTreeService.ts new file mode 100644 index 000000000..3e68746b1 --- /dev/null +++ b/sdk/src/core/clients/ethereum/IMerkleTreeService.ts @@ -0,0 +1,23 @@ +export type BlockRange = { + startingBlock: number; + endBlock: number; +}; + +export type FinalizationMessagingInfo = { + l2MessagingBlocksRange: BlockRange; + l2MerkleRoots: string[]; + treeDepth: number; +}; + +export type Proof = { + proof: string[]; + root: string; + leafIndex: number; +}; + +export interface IMerkleTreeService { + getMessageProof(messageHash: string): Promise; + getFinalizationMessagingInfo(transactionHash: string): Promise; + getL2MessageHashesInBlockRange(fromBlock: number, toBlock: number): Promise; + getMessageSiblings(messageHash: string, messageHashes: string[], treeDepth: number): string[]; +} diff --git a/sdk/src/core/clients/ethereum/index.ts b/sdk/src/core/clients/ethereum/index.ts new file mode 100644 index 000000000..65a78d97e --- /dev/null +++ b/sdk/src/core/clients/ethereum/index.ts @@ -0,0 +1,8 @@ +export { ILineaRollupClient } from "./ILineaRollupClient"; +export { + MessageSentEventFilters, + L2MessagingBlockAnchoredFilters, + MessageClaimedFilters, + ILineaRollupLogClient, +} from "./ILineaRollupLogClient"; +export { BlockRange, FinalizationMessagingInfo, Proof, IMerkleTreeService } from "./IMerkleTreeService"; diff --git a/sdk/src/core/clients/linea/IL2MessageServiceClient.ts b/sdk/src/core/clients/linea/IL2MessageServiceClient.ts new file mode 100644 index 000000000..ce6989b7b --- /dev/null +++ b/sdk/src/core/clients/linea/IL2MessageServiceClient.ts @@ -0,0 +1,23 @@ +import { Message } from "../../types"; +import { IMessageServiceContract } from "../IMessageServiceContract"; +import { LineaGasFees } from "../IGasProvider"; + +export interface IL2MessageServiceClient< + Overrides, + TransactionReceipt, + TransactionResponse, + ContractTransactionResponse, + Signer, + ErrorDescription, +> extends IMessageServiceContract< + Overrides, + TransactionReceipt, + TransactionResponse, + ContractTransactionResponse, + ErrorDescription + > { + encodeClaimMessageTransactionData(message: Message & { feeRecipient?: string }): string; + estimateClaimGasFees(message: Message & { feeRecipient?: string }, overrides?: Overrides): Promise; + getSigner(): Signer | undefined; + getContractAddress(): string; +} diff --git a/sdk/src/core/clients/linea/IL2MessageServiceLogClient.ts b/sdk/src/core/clients/linea/IL2MessageServiceLogClient.ts new file mode 100644 index 000000000..e5c0470e9 --- /dev/null +++ b/sdk/src/core/clients/linea/IL2MessageServiceLogClient.ts @@ -0,0 +1,31 @@ +import { MessageSent, ServiceVersionMigrated } from "../../types"; + +export type MessageSentEventFilters = { + from?: string; + to?: string; + messageHash?: string; +}; + +export interface IL2MessageServiceLogClient { + getMessageSentEvents(params: { + filters?: MessageSentEventFilters; + fromBlock?: number; + toBlock?: string | number; + fromBlockLogIndex?: number; + }): Promise; + + getMessageSentEventsByMessageHash(params: { + messageHash: string; + fromBlock?: number; + toBlock?: string | number; + fromBlockLogIndex?: number; + }): Promise; + + getMessageSentEventsByBlockRange(fromBlock: number, toBlock: number): Promise; + + getServiceVersionMigratedEvents(param?: { + fromBlock?: number; + toBlock?: string | number; + fromBlockLogIndex?: number; + }): Promise; +} diff --git a/sdk/src/core/clients/linea/ILineaProvider.ts b/sdk/src/core/clients/linea/ILineaProvider.ts new file mode 100644 index 000000000..964ba1aec --- /dev/null +++ b/sdk/src/core/clients/linea/ILineaProvider.ts @@ -0,0 +1,13 @@ +import { IProvider } from "../IProvider"; + +export type BlockExtraData = { + version: number; + fixedCost: number; + variableCost: number; + ethGasPrice: number; +}; + +export interface ILineaProvider + extends IProvider { + getBlockExtraData(blockNumber: number | bigint | string): Promise; +} diff --git a/sdk/src/core/clients/linea/index.ts b/sdk/src/core/clients/linea/index.ts new file mode 100644 index 000000000..fccbe18c2 --- /dev/null +++ b/sdk/src/core/clients/linea/index.ts @@ -0,0 +1,3 @@ +export { IL2MessageServiceClient } from "./IL2MessageServiceClient"; +export { MessageSentEventFilters, IL2MessageServiceLogClient } from "./IL2MessageServiceLogClient"; +export { BlockExtraData, ILineaProvider } from "./ILineaProvider"; diff --git a/sdk/src/core/constants/blockchain.ts b/sdk/src/core/constants/blockchain.ts index b2c394627..578147559 100644 --- a/sdk/src/core/constants/blockchain.ts +++ b/sdk/src/core/constants/blockchain.ts @@ -1,4 +1,2 @@ export const ZERO_HASH = "0x0000000000000000000000000000000000000000000000000000000000000000"; export const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"; - -export const MINIMUM_MARGIN = 1.2; diff --git a/sdk/src/core/constants/common.ts b/sdk/src/core/constants/common.ts index f78f94c9a..a95b6fd7b 100644 --- a/sdk/src/core/constants/common.ts +++ b/sdk/src/core/constants/common.ts @@ -1,25 +1,6 @@ -export const DEFAULT_MESSAGE_SUBMISSION_TIMEOUT = 300000; -export const DEFAULT_LISTENER_INTERVAL = 4000; -export const DEFAULT_DB_CLEANER_ENABLED = false; -export const DEFAULT_DB_CLEANING_INTERVAL = 43200000; -export const DEFAULT_DB_DAYS_BEFORE_NOW_TO_DELETE = 14; -export const DEFAULT_MAX_BLOCKS_TO_FETCH_LOGS = 1000; -export const DEFAULT_MAX_FETCH_MESSAGES_FROM_DB = 1000; -export const DEFAULT_MAX_NONCE_DIFF = 10000; -export const DEFAULT_MAX_FEE_PER_GAS = 100000000000n; +export const DEFAULT_MAX_FEE_PER_GAS_CAP = 100000000000n; export const DEFAULT_ENFORCE_MAX_GAS_FEE = false; export const DEFAULT_GAS_ESTIMATION_PERCENTILE = 20; -export const DEFAULT_GAS_LIMIT = 0; -export const DEFAULT_LISTENER_BLOCK_CONFIRMATIONS = 4; -export const DEFAULT_PROFIT_MARGIN = 1.0; -export const DEFAULT_MAX_NUMBER_OF_RETRIES = 100; -export const DEFAULT_RETRY_DELAY_IN_SECONDS = 30; -export const DEFAULT_EOA_ENABLED = false; -export const DEFAULT_CALLDATA_ENABLED = false; -export const DEFAULT_RATE_LIMIT_MARGIN = 0.95; -export const DEFAULT_MAX_CLAIM_GAS_LIMIT = 100_000n; -export const DEFAULT_MAX_TX_RETRIES = 20; export const DEFAULT_L2_MESSAGE_TREE_DEPTH = 5; -export const DEFAULT_INITIAL_FROM_BLOCK = -1; - -export const PROFIT_MARGIN_MULTIPLIER = 100; +export const DEFAULT_RATE_LIMIT_MARGIN = 0.95; +export const DEFAULT_ENABLE_LINEA_ESTIMATE_GAS = false; diff --git a/sdk/src/core/constants/index.ts b/sdk/src/core/constants/index.ts index 0d2d9ea03..9335bb835 100644 --- a/sdk/src/core/constants/index.ts +++ b/sdk/src/core/constants/index.ts @@ -2,3 +2,4 @@ export * from "./common"; export * from "./blockchain"; export * from "./events"; export * from "./message"; +export * from "./networks"; diff --git a/sdk/src/sdk/networks.ts b/sdk/src/core/constants/networks.ts similarity index 90% rename from sdk/src/sdk/networks.ts rename to sdk/src/core/constants/networks.ts index 022023565..df5dc132b 100644 --- a/sdk/src/sdk/networks.ts +++ b/sdk/src/core/constants/networks.ts @@ -1,4 +1,4 @@ -import { NetworkInfo } from "./config"; +import { NetworkInfo } from "../types"; export const NETWORKS: NetworkInfo = { ["linea-mainnet"]: { diff --git a/sdk/src/core/enums/index.ts b/sdk/src/core/enums/index.ts new file mode 100644 index 000000000..2cc99efc4 --- /dev/null +++ b/sdk/src/core/enums/index.ts @@ -0,0 +1 @@ +export { Direction, OnChainMessageStatus } from "./message"; diff --git a/sdk/src/core/enums/message.ts b/sdk/src/core/enums/message.ts new file mode 100644 index 000000000..27d7c258c --- /dev/null +++ b/sdk/src/core/enums/message.ts @@ -0,0 +1,10 @@ +export enum Direction { + L1_TO_L2 = "L1_TO_L2", + L2_TO_L1 = "L2_TO_L1", +} + +export enum OnChainMessageStatus { + UNKNOWN = "UNKNOWN", + CLAIMABLE = "CLAIMABLE", + CLAIMED = "CLAIMED", +} diff --git a/sdk/src/core/errors/Base.ts b/sdk/src/core/errors/BaseError.ts similarity index 100% rename from sdk/src/core/errors/Base.ts rename to sdk/src/core/errors/BaseError.ts diff --git a/sdk/src/core/errors/GasFeeErrors.ts b/sdk/src/core/errors/GasFeeErrors.ts index 57114c2e3..6f7e2c1d3 100644 --- a/sdk/src/core/errors/GasFeeErrors.ts +++ b/sdk/src/core/errors/GasFeeErrors.ts @@ -1,11 +1,11 @@ -import { MessageProps } from "../../core/entities/Message"; -import { BaseError } from "./Base"; +import { Message } from "../types"; +import { BaseError } from "./BaseError"; export class FeeEstimationError extends BaseError { override name = FeeEstimationError.name; } -export class GasEstimationError extends BaseError { +export class GasEstimationError extends BaseError { override name = GasEstimationError.name; public rejectedMessage?: T; diff --git a/sdk/src/core/errors/__tests__/Base.test.ts b/sdk/src/core/errors/__tests__/BaseError.test.ts similarity index 90% rename from sdk/src/core/errors/__tests__/Base.test.ts rename to sdk/src/core/errors/__tests__/BaseError.test.ts index 6a0cfacad..346b35c57 100644 --- a/sdk/src/core/errors/__tests__/Base.test.ts +++ b/sdk/src/core/errors/__tests__/BaseError.test.ts @@ -1,5 +1,5 @@ import { describe, it } from "@jest/globals"; -import { BaseError } from "../Base"; +import { BaseError } from "../BaseError"; import { serialize } from "../../utils/serialize"; describe("BaseError", () => { diff --git a/sdk/src/core/errors/__tests__/GasFeeErrors.test.ts b/sdk/src/core/errors/__tests__/GasFeeErrors.test.ts index 8e28c5060..89faebc48 100644 --- a/sdk/src/core/errors/__tests__/GasFeeErrors.test.ts +++ b/sdk/src/core/errors/__tests__/GasFeeErrors.test.ts @@ -1,8 +1,7 @@ import { describe, it } from "@jest/globals"; import { FeeEstimationError, GasEstimationError } from "../GasFeeErrors"; import { serialize } from "../../utils/serialize"; -import { Direction, MessageStatus } from "../../enums/MessageEnums"; -import { MessageProps } from "../../entities/Message"; +import { Message } from "../../types/message"; import { ZERO_ADDRESS, ZERO_HASH } from "../../constants"; describe("BaseError", () => { @@ -19,7 +18,7 @@ describe("BaseError", () => { describe("GasEstimationError", () => { it("Should log error message", () => { - const rejectedMessage: MessageProps = { + const rejectedMessage: Message = { messageHash: ZERO_HASH, messageSender: ZERO_ADDRESS, destination: ZERO_ADDRESS, @@ -27,11 +26,6 @@ describe("BaseError", () => { value: 0n, messageNonce: 0n, calldata: "0x", - contractAddress: ZERO_ADDRESS, - sentBlockNumber: 0, - direction: Direction.L1_TO_L2, - status: MessageStatus.SENT, - claimNumberOfRetry: 0, }; const estimationError = new Error("estimation error"); @@ -48,11 +42,6 @@ describe("BaseError", () => { value: 0n, messageNonce: 0n, calldata: "0x", - contractAddress: "0x0000000000000000000000000000000000000000", - sentBlockNumber: 0, - direction: "L1_TO_L2", - status: "SENT", - claimNumberOfRetry: 0, }, }), ); diff --git a/sdk/src/core/errors/index.ts b/sdk/src/core/errors/index.ts new file mode 100644 index 000000000..fbc1108b7 --- /dev/null +++ b/sdk/src/core/errors/index.ts @@ -0,0 +1,2 @@ +export { BaseError } from "./BaseError"; +export { GasEstimationError, FeeEstimationError } from "./GasFeeErrors"; diff --git a/sdk/src/sdk/config.ts b/sdk/src/core/types/config.ts similarity index 67% rename from sdk/src/sdk/config.ts rename to sdk/src/core/types/config.ts index 1ad3348f7..ac3a23cef 100644 --- a/sdk/src/sdk/config.ts +++ b/sdk/src/core/types/config.ts @@ -1,4 +1,4 @@ -import { JsonRpcProvider, Wallet } from "ethers"; +import { Eip1193Provider, Wallet } from "ethers"; /** * Represents the supported Linea blockchain networks or a custom network configuration. @@ -15,10 +15,12 @@ export type SDKMode = "read-only" | "read-write"; */ interface BaseOptions { readonly network: Network; - readonly l1RpcUrlOrProvider: string | JsonRpcProvider; - readonly l2RpcUrlOrProvider: string | JsonRpcProvider; + readonly l1RpcUrlOrProvider: string | Eip1193Provider; + readonly l2RpcUrlOrProvider: string | Eip1193Provider; readonly mode: SDKMode; readonly l2MessageTreeDepth?: number; + readonly l1FeeEstimatorOptions?: L1FeeEstimatorOptions; + readonly l2FeeEstimatorOptions?: L2FeeEstimatorOptions; } /** @@ -35,15 +37,27 @@ export interface WriteModeOptions extends BaseOptions { readonly mode: "read-write"; readonly l1SignerPrivateKeyOrWallet: string | Wallet; readonly l2SignerPrivateKeyOrWallet: string | Wallet; - readonly feeEstimatorOptions?: FeeEstimatorOptions; } /** - * Options for configuring gas fee estimation in `read-write` mode. + * Options for configuring gas fee estimation. */ -export type FeeEstimatorOptions = { - maxFeePerGas?: bigint; +type FeeEstimatorOptions = { + maxFeePerGasCap?: bigint; gasFeeEstimationPercentile?: number; + enforceMaxGasFee?: boolean; +}; + +/** + * Options for configuring L1 gas fee estimation. + */ +export type L1FeeEstimatorOptions = FeeEstimatorOptions; + +/** + * Options for configuring L2 gas fee estimation. + */ +export type L2FeeEstimatorOptions = FeeEstimatorOptions & { + enableLineaEstimateGas?: boolean; }; /** diff --git a/sdk/src/core/types/Events.ts b/sdk/src/core/types/events.ts similarity index 94% rename from sdk/src/core/types/Events.ts rename to sdk/src/core/types/events.ts index 591fc9611..5df87dfbd 100644 --- a/sdk/src/core/types/Events.ts +++ b/sdk/src/core/types/events.ts @@ -1,4 +1,4 @@ -export type EventLogBase = { +type EventLogBase = { blockNumber: number; logIndex: number; contractAddress: string; diff --git a/sdk/src/core/types/index.ts b/sdk/src/core/types/index.ts new file mode 100644 index 000000000..623db6d4a --- /dev/null +++ b/sdk/src/core/types/index.ts @@ -0,0 +1,3 @@ +export { LineaSDKOptions, Network, SDKMode, NetworkInfo, L1FeeEstimatorOptions, L2FeeEstimatorOptions } from "./config"; +export { MessageSent, L2MessagingBlockAnchored, MessageClaimed, ServiceVersionMigrated } from "./events"; +export { Message } from "./message"; diff --git a/sdk/src/core/types/message.ts b/sdk/src/core/types/message.ts new file mode 100644 index 000000000..486c012a6 --- /dev/null +++ b/sdk/src/core/types/message.ts @@ -0,0 +1,9 @@ +export type Message = { + messageSender: string; + destination: string; + fee: bigint; + value: bigint; + messageNonce: bigint; + calldata: string; + messageHash: string; +}; diff --git a/sdk/src/core/utils/__tests__/message.test.ts b/sdk/src/core/utils/__tests__/message.test.ts index d42de2205..2a9e2e956 100644 --- a/sdk/src/core/utils/__tests__/message.test.ts +++ b/sdk/src/core/utils/__tests__/message.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect } from "@jest/globals"; import { formatMessageStatus } from "../message"; -import { OnChainMessageStatus } from "../../enums/MessageEnums"; +import { OnChainMessageStatus } from "../../enums/message"; describe("Message utils", () => { describe("formatMessageStatus", () => { diff --git a/sdk/src/core/utils/index.ts b/sdk/src/core/utils/index.ts new file mode 100644 index 000000000..9b3f08b58 --- /dev/null +++ b/sdk/src/core/utils/index.ts @@ -0,0 +1,3 @@ +export { formatMessageStatus } from "./message"; +export { serialize } from "./serialize"; +export { wait, subtractSeconds, isEmptyBytes, isString, isUndefined, isNull } from "./shared"; diff --git a/sdk/src/core/utils/message.ts b/sdk/src/core/utils/message.ts index 2d8be12a9..8df2a91c3 100644 --- a/sdk/src/core/utils/message.ts +++ b/sdk/src/core/utils/message.ts @@ -1,5 +1,5 @@ import { MESSAGE_ANCHORED_STATUS, MESSAGE_CLAIMED_STATUS } from "../constants"; -import { OnChainMessageStatus } from "../enums/MessageEnums"; +import { OnChainMessageStatus } from "../enums"; /** * Converts a numeric message status code into an enumerated value representing the message's status on the blockchain. diff --git a/sdk/src/core/utils/serialize.ts b/sdk/src/core/utils/serialize.ts index e5787d876..0d7ad3fd6 100644 --- a/sdk/src/core/utils/serialize.ts +++ b/sdk/src/core/utils/serialize.ts @@ -1,10 +1,8 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ - /** * Stringifier that handles bigint value. * @param {any} value Value to stringify. * @returns {string} the stringified output. */ -export function serialize(value: any): string { - return JSON.stringify(value, (_, value: any) => (typeof value === "bigint" ? value.toString() : value)); +export function serialize(value: unknown): string { + return JSON.stringify(value, (_, value: unknown) => (typeof value === "bigint" ? value.toString() : value)); } diff --git a/sdk/src/core/utils/shared.ts b/sdk/src/core/utils/shared.ts index ba10ce6a2..f024fbefe 100644 --- a/sdk/src/core/utils/shared.ts +++ b/sdk/src/core/utils/shared.ts @@ -1,5 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ - /** * Creates a promise that resolves after a specified timeout period. * @@ -39,25 +37,25 @@ export function isEmptyBytes(bytes: string): boolean { /** * Type guard function to check if a given value is a string. * - * @param {any} value - The value to check. + * @param {unknown} value - The value to check. * @returns {boolean} `true` if the value is a string, `false` otherwise. */ -export function isString(value: any): value is string { +export function isString(value: unknown): value is string { return typeof value === "string"; } /** * Type guard function to check if a given object is `undefined`. * - * @param {any} obj - The object to check. + * @param {unknown} obj - The object to check. * @returns {boolean} `true` if the object is undefined, `false` otherwise. */ -export const isUndefined = (obj: any): obj is undefined => typeof obj === "undefined"; +export const isUndefined = (obj: unknown): obj is undefined => typeof obj === "undefined"; /** * Type guard function to check if a given value is `null`. * - * @param {any} val - The value to check. + * @param {unknown} val - The value to check. * @returns {boolean} `true` if the value is `null`, `false` otherwise. */ -export const isNull = (val: any): val is null => val === null; +export const isNull = (val: unknown): val is null => val === null; diff --git a/sdk/src/index.ts b/sdk/src/index.ts index 5cf251573..3d81ac029 100644 --- a/sdk/src/index.ts +++ b/sdk/src/index.ts @@ -1,9 +1,51 @@ -// Postman exports -export { PostmanServiceClient } from "./application/postman/app/PostmanServiceClient"; -export { PostmanConfig } from "./application/postman/app/config/config"; - -// SDK exports -export { LineaSDK } from "./sdk/LineaSDK"; -export { LineaSDKOptions, Network, NetworkInfo, FeeEstimatorOptions } from "./sdk/config"; -export { Message } from "./core/entities/Message"; -export { OnChainMessageStatus } from "./core/enums/MessageEnums"; +// Linea SDK entry point +export { LineaSDK } from "./LineaSDK"; + +// Core types +export { + LineaSDKOptions, + Network, + NetworkInfo, + L1FeeEstimatorOptions, + L2FeeEstimatorOptions, + SDKMode, + Message, + MessageSent, + MessageClaimed, + L2MessagingBlockAnchored, + ServiceVersionMigrated, +} from "./core/types"; + +// Core enums and constants +export { OnChainMessageStatus, Direction } from "./core/enums"; +export * from "./core/constants"; + +// Providers to interact with Ethereum and Linea +export { Provider, BrowserProvider, LineaProvider, LineaBrowserProvider } from "./clients/providers"; +export { DefaultGasProvider, GasProvider, LineaGasProvider } from "./clients/gas"; + +// Core errors +export { GasEstimationError, FeeEstimationError } from "./core/errors"; + +// Contracts types and factories (generated from typechain) +export { LineaRollup, LineaRollup__factory, L2MessageService, L2MessageService__factory } from "./contracts/typechain"; + +// Utils functions +export { formatMessageStatus, serialize, isEmptyBytes, isString, isNull, isUndefined, wait } from "./core/utils"; + +// Testing helpers +import { + generateLineaRollupClient, + generateL2MessageServiceClient, + generateTransactionReceipt, + generateTransactionResponse, +} from "./utils/testing/helpers"; + +const testingHelpers = { + generateLineaRollupClient, + generateL2MessageServiceClient, + generateTransactionReceipt, + generateTransactionResponse, +}; + +export { testingHelpers }; diff --git a/sdk/src/sdk/LineaSDK.ts b/sdk/src/sdk/LineaSDK.ts deleted file mode 100644 index 6c2552db9..000000000 --- a/sdk/src/sdk/LineaSDK.ts +++ /dev/null @@ -1,188 +0,0 @@ -import { Wallet } from "ethers"; -import { EthersLineaRollupLogClient } from "../clients/blockchain/ethereum/EthersLineaRollupLogClient"; -import { LineaRollupClient } from "../clients/blockchain/ethereum/LineaRollupClient"; -import { EthersL2MessageServiceLogClient } from "../clients/blockchain/linea/EthersL2MessageServiceLogClient"; -import { L2MessageServiceClient } from "../clients/blockchain/linea/L2MessageServiceClient"; -import { - DEFAULT_GAS_ESTIMATION_PERCENTILE, - DEFAULT_L2_MESSAGE_TREE_DEPTH, - DEFAULT_MAX_FEE_PER_GAS, -} from "../core/constants"; -import { BaseError } from "../core/errors/Base"; -import { L1ClaimingService } from "./claiming/L1ClaimingService"; -import { LineaSDKOptions, Network, SDKMode } from "./config"; -import { NETWORKS } from "./networks"; -import ProviderService from "./ProviderService"; -import { DefaultGasProvider } from "../clients/blockchain/gas/DefaultGasProvider"; -import { LineaGasProvider } from "../clients/blockchain/gas/LineaGasProvider"; -import { LineaRollupMessageRetriever } from "../clients/blockchain/ethereum/LineaRollupMessageRetriever"; -import { MerkleTreeService } from "../clients/blockchain/ethereum/MerkleTreeService"; -import { L2MessageServiceMessageRetriever } from "../clients/blockchain/linea/L2MessageServiceMessageRetriever"; -import { ChainQuerier } from "../clients/blockchain/ChainQuerier"; -import { L2ChainQuerier } from "../clients/blockchain/linea/L2ChainQuerier"; - -export class LineaSDK { - private network: Network; - private l1SignerPrivateKeyOrWallet: string | Wallet; - private l2SignerPrivateKeyOrWallet: string | Wallet; - private l1Provider: ProviderService; - private l2Provider: ProviderService; - private maxFeePerGas: bigint; - private gasFeeEstimationPercentile: number; - private mode: SDKMode; - private l2MessageTreeDepth: number; - - /** - * Initializes a new instance of the LineaSDK with the specified options. - * - * @param {LineaSDKOptions} options - Configuration options for the SDK, including network details, operational mode, and optional settings for L2 message tree depth and fee estimation. - */ - constructor(options: LineaSDKOptions) { - this.network = options.network; - this.mode = options.mode; - this.l2MessageTreeDepth = options.l2MessageTreeDepth ?? DEFAULT_L2_MESSAGE_TREE_DEPTH; - - if (options.mode === "read-write") { - this.l1SignerPrivateKeyOrWallet = options.l1SignerPrivateKeyOrWallet; - this.l2SignerPrivateKeyOrWallet = options.l2SignerPrivateKeyOrWallet; - this.maxFeePerGas = options.feeEstimatorOptions?.maxFeePerGas ?? DEFAULT_MAX_FEE_PER_GAS; - this.gasFeeEstimationPercentile = - options.feeEstimatorOptions?.gasFeeEstimationPercentile ?? DEFAULT_GAS_ESTIMATION_PERCENTILE; - } else { - this.maxFeePerGas = DEFAULT_MAX_FEE_PER_GAS; - this.gasFeeEstimationPercentile = DEFAULT_GAS_ESTIMATION_PERCENTILE; - } - - this.l1Provider = new ProviderService(options.l1RpcUrlOrProvider); - this.l2Provider = new ProviderService(options.l2RpcUrlOrProvider); - } - - /** - * Creates an instance of the `EthersL2MessageServiceLogClient` for interacting with L2 contract event logs. - * - * @param {string} [localL2ContractAddress] - Optional custom L2 contract address. Required if the network is set to 'custom'. - * @returns {EthersL2MessageServiceLogClient} An instance of the L2 message service log client. - */ - public getL2ContractEventLogClient(localL2ContractAddress?: string): EthersL2MessageServiceLogClient { - let l2ContractAddress: string; - - if (this.network === "custom") { - if (!localL2ContractAddress) { - throw new BaseError("You need to provide a L2 contract address."); - } - l2ContractAddress = localL2ContractAddress; - } else { - l2ContractAddress = NETWORKS[this.network].l2ContractAddress; - } - - return new EthersL2MessageServiceLogClient(this.l2Provider.provider, l2ContractAddress); - } - - /** - * Retrieves an instance of the `LineaRollupClient` for interacting with the L1 contract. - * - * @param {string} [localL1ContractAddress] - Optional custom L1 contract address. Required if the network is set to 'custom'. - * @param {string} [localL2ContractAddress] - Optional custom L2 contract address. Required if the network is set to 'custom'. - * @returns {LineaRollupClient} An instance of the `LineaRollupClient` configured for the specified L1 contract. - */ - public getL1Contract(localL1ContractAddress?: string, localL2ContractAddress?: string): LineaRollupClient { - let l1ContractAddress: string; - let l2ContractAddress: string; - - if (this.network === "custom") { - if (!localL1ContractAddress || !localL2ContractAddress) { - throw new BaseError("You need to provide both L1 and L2 contract addresses."); - } - l1ContractAddress = localL1ContractAddress; - l2ContractAddress = localL2ContractAddress; - } else { - l1ContractAddress = NETWORKS[this.network].l1ContractAddress; - l2ContractAddress = NETWORKS[this.network].l2ContractAddress; - } - - const signer = this.mode === "read-write" ? this.l1Provider.getSigner(this.l1SignerPrivateKeyOrWallet) : undefined; - - const lineaRollupLogClient = new EthersLineaRollupLogClient(this.l1Provider.provider, l1ContractAddress); - const chainQuerier = new ChainQuerier(this.l1Provider.provider, signer); - const l2MessageServiceLogClient = this.getL2ContractEventLogClient(l2ContractAddress); - - return new LineaRollupClient( - chainQuerier, - l1ContractAddress, - lineaRollupLogClient, - l2MessageServiceLogClient, - new DefaultGasProvider(chainQuerier, { - maxFeePerGas: this.maxFeePerGas, - gasEstimationPercentile: this.gasFeeEstimationPercentile, - enforceMaxGasFee: false, - }), - new LineaRollupMessageRetriever(chainQuerier, lineaRollupLogClient, l1ContractAddress), - new MerkleTreeService( - chainQuerier, - l1ContractAddress, - lineaRollupLogClient, - l2MessageServiceLogClient, - this.l2MessageTreeDepth, - ), - this.mode, - signer, - ); - } - - /** - * Retrieves an instance of the `L2MessageServiceClient` for interacting with the L2 contract. - * - * @param {string} [localContractAddress] - Optional custom L2 contract address. Required if the network is set to 'custom'. - * @returns {L2MessageServiceClient} An instance of the `L2MessageServiceClient` configured for the specified L2 contract. - */ - public getL2Contract(localContractAddress?: string): L2MessageServiceClient { - let l2ContractAddress: string; - - if (this.network === "custom") { - if (!localContractAddress) { - throw new BaseError("You need to provide a L2 contract address."); - } - l2ContractAddress = localContractAddress; - } else { - l2ContractAddress = NETWORKS[this.network].l2ContractAddress; - } - - const signer = this.mode === "read-write" ? this.l2Provider.getSigner(this.l2SignerPrivateKeyOrWallet) : undefined; - - const l2ChainQuerier = new L2ChainQuerier(this.l2Provider.provider, signer); - - const l2MessageServiceContract = new L2MessageServiceClient( - l2ChainQuerier, - l2ContractAddress, - new L2MessageServiceMessageRetriever( - l2ChainQuerier, - this.getL2ContractEventLogClient(l2ContractAddress), - l2ContractAddress, - ), - new LineaGasProvider(l2ChainQuerier, { - maxFeePerGas: this.maxFeePerGas, - enforceMaxGasFee: false, - }), - this.mode, - signer, - ); - - return l2MessageServiceContract; - } - - /** - * Creates an instance of the `L1ClaimingService` for managing message claiming on L1. - * - * @param {string} [localL1ContractAddress] - Optional custom L1 contract address. Required if the network is set to 'custom'. - * @param {string} [localL2ContractAddress] - Optional custom L2 contract address. Required if the network is set to 'custom'. - * @returns {L1ClaimingService} An instance of the `L1ClaimingService` configured for the specified contract addresses. - */ - public getL1ClaimingService(localL1ContractAddress?: string, localL2ContractAddress?: string): L1ClaimingService { - return new L1ClaimingService( - this.getL1Contract(localL1ContractAddress, localL2ContractAddress), - this.getL2Contract(localL2ContractAddress), - this.getL2ContractEventLogClient(localL2ContractAddress), - this.network, - ); - } -} diff --git a/sdk/src/sdk/ProviderService.ts b/sdk/src/sdk/ProviderService.ts deleted file mode 100644 index 426564869..000000000 --- a/sdk/src/sdk/ProviderService.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Wallet, Signer, JsonRpcProvider } from "ethers"; -import { BaseError } from "../core/errors/Base"; - -export default class ProviderService { - public provider: JsonRpcProvider; - - /** - * Constructs a new `ProviderService` instance. - * - * @param {string | JsonRpcProvider} rpcUrlOrProvider - The Ethereum JSON RPC URL or an existing `JsonRpcProvider` instance. - */ - constructor(rpcUrlOrProvider: string | JsonRpcProvider) { - if (rpcUrlOrProvider instanceof JsonRpcProvider) { - this.provider = rpcUrlOrProvider; - } else { - this.provider = new JsonRpcProvider(rpcUrlOrProvider); - } - } - - /** - * Retrieves a signer for transaction signing. This method supports both Wallet instances and private keys. - * - * @param {string | Wallet} privateKeyOrWallet - A private key as a string or an existing Wallet instance. - * @returns {Signer} A signer, represented by a Wallet instance, associated with the current provider. - */ - public getSigner(privateKeyOrWallet: string | Wallet): Signer { - try { - return privateKeyOrWallet instanceof Wallet ? privateKeyOrWallet : new Wallet(privateKeyOrWallet, this.provider); - } catch (e) { - throw new BaseError( - "Something went wrong when trying to generate Wallet. Please check your private key and the provider url.", - ); - } - } -} diff --git a/sdk/src/sdk/__tests__/ProviderService.test.ts b/sdk/src/sdk/__tests__/ProviderService.test.ts deleted file mode 100644 index 2dea98c75..000000000 --- a/sdk/src/sdk/__tests__/ProviderService.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { describe, it, expect } from "@jest/globals"; -import { ethers, JsonRpcProvider } from "ethers"; -import ProviderService from "../ProviderService"; -import { TEST_L1_SIGNER_PRIVATE_KEY, TEST_RPC_URL } from "../../utils/testing/constants"; - -describe("ProviderService", () => { - describe("getSigner", () => { - it("should throw an error when private key is invalid", () => { - const providerService = new ProviderService(TEST_RPC_URL); - expect(() => providerService.getSigner("private-key")).toThrow( - "Something went wrong when trying to generate Wallet. Please check your private key and the provider url.", - ); - }); - - it("should return ethers Signer", () => { - const providerService = new ProviderService(TEST_RPC_URL); - expect(JSON.stringify(providerService.getSigner(TEST_L1_SIGNER_PRIVATE_KEY))).toStrictEqual( - JSON.stringify(new ethers.Wallet(TEST_L1_SIGNER_PRIVATE_KEY, new JsonRpcProvider(TEST_RPC_URL))), - ); - }); - }); -}); diff --git a/sdk/src/sdk/Cache.ts b/sdk/src/utils/Cache.ts similarity index 93% rename from sdk/src/sdk/Cache.ts rename to sdk/src/utils/Cache.ts index 7e87471a3..f2455e464 100644 --- a/sdk/src/sdk/Cache.ts +++ b/sdk/src/utils/Cache.ts @@ -1,7 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { LRUCache } from "lru-cache"; -import { serialize } from "../core/utils/serialize"; -import { isUndefined } from "../core/utils/shared"; +import { serialize, isUndefined } from "../core/utils"; interface CacheInterface { get: (key: string) => any; diff --git a/sdk/src/services/merkleTree/MerkleTreeFactory.ts b/sdk/src/utils/merkleTree/MerkleTreeFactory.ts similarity index 100% rename from sdk/src/services/merkleTree/MerkleTreeFactory.ts rename to sdk/src/utils/merkleTree/MerkleTreeFactory.ts diff --git a/sdk/src/services/merkleTree/SparseMerkleTree.ts b/sdk/src/utils/merkleTree/SparseMerkleTree.ts similarity index 98% rename from sdk/src/services/merkleTree/SparseMerkleTree.ts rename to sdk/src/utils/merkleTree/SparseMerkleTree.ts index 70b6e8ba6..192528c85 100644 --- a/sdk/src/services/merkleTree/SparseMerkleTree.ts +++ b/sdk/src/utils/merkleTree/SparseMerkleTree.ts @@ -1,7 +1,7 @@ import { ethers } from "ethers"; -import { BaseError } from "../../core/errors/Base"; +import { BaseError } from "../../core/errors"; import { ZERO_HASH } from "../../core/constants"; -import { Proof } from "../../core/clients/blockchain/ethereum/IMerkleTreeService"; +import { Proof } from "../../core/clients/ethereum"; class MerkleTreeNode { public value: string; diff --git a/sdk/src/services/merkleTree/__tests__/SparseMerkleTree.test.ts b/sdk/src/utils/merkleTree/__tests__/SparseMerkleTree.test.ts similarity index 98% rename from sdk/src/services/merkleTree/__tests__/SparseMerkleTree.test.ts rename to sdk/src/utils/merkleTree/__tests__/SparseMerkleTree.test.ts index 5d1e1550b..3f66255b1 100644 --- a/sdk/src/services/merkleTree/__tests__/SparseMerkleTree.test.ts +++ b/sdk/src/utils/merkleTree/__tests__/SparseMerkleTree.test.ts @@ -1,6 +1,6 @@ import { describe, it } from "@jest/globals"; import { SparseMerkleTree } from "../SparseMerkleTree"; -import { generateHexString } from "../../../utils/testing/helpers"; +import { generateHexString } from "../../testing/helpers"; describe("TestSparseMerkleTree", () => { describe("Initialization", () => { diff --git a/sdk/src/utils/merkleTree/index.ts b/sdk/src/utils/merkleTree/index.ts new file mode 100644 index 000000000..5298e85dc --- /dev/null +++ b/sdk/src/utils/merkleTree/index.ts @@ -0,0 +1,2 @@ +export { SparseMerkleTree } from "./SparseMerkleTree"; +export { SparseMerkleTreeFactory } from "./MerkleTreeFactory"; diff --git a/sdk/src/utils/testing/constants/common.ts b/sdk/src/utils/testing/constants/common.ts new file mode 100644 index 000000000..8f9301066 --- /dev/null +++ b/sdk/src/utils/testing/constants/common.ts @@ -0,0 +1,21 @@ +export const TEST_L1_SIGNER_PRIVATE_KEY = "0x0000000000000000000000000000000000000000000000000000000000000001"; +export const TEST_L2_SIGNER_PRIVATE_KEY = "0x0000000000000000000000000000000000000000000000000000000000000002"; + +export const TEST_ADDRESS_1 = "0x0000000000000000000000000000000000000001"; +export const TEST_ADDRESS_2 = "0x0000000000000000000000000000000000000002"; + +export const TEST_CONTRACT_ADDRESS_1 = "0x1000000000000000000000000000000000000000"; +export const TEST_CONTRACT_ADDRESS_2 = "0x2000000000000000000000000000000000000000"; + +export const TEST_MESSAGE_HASH = "0x1010101010101010101010101010101010101010101010101010101010101010"; +export const TEST_MESSAGE_HASH_2 = "0x1010101010101010101010101010101010101010101010101010101010101020"; + +export const TEST_TRANSACTION_HASH = "0x2020202020202020202020202020202020202020202020202020202020202020"; +export const TEST_BLOCK_HASH = "0x1000000000000000000000000000000000000000000000000000000000000000"; + +export const TEST_MERKLE_ROOT = "0xfc3dfe7470d41465e77e7c929170578b14a066a2272c2469b60162c5282e05a6"; +export const TEST_MERKLE_ROOT_2 = "0x7777777777777777777777777777777777777777777777777777777777777777"; + +export const TEST_RPC_URL = "http://localhost:8545"; + +export const DEFAULT_MAX_FEE_PER_GAS = 100000000000n; diff --git a/sdk/src/utils/testing/constants/events.ts b/sdk/src/utils/testing/constants/events.ts new file mode 100644 index 000000000..b11dfcab1 --- /dev/null +++ b/sdk/src/utils/testing/constants/events.ts @@ -0,0 +1,164 @@ +import { + TEST_ADDRESS_1, + TEST_ADDRESS_2, + TEST_BLOCK_HASH, + TEST_CONTRACT_ADDRESS_1, + TEST_MESSAGE_HASH, + TEST_TRANSACTION_HASH, +} from "./common"; +import { L2MessagingBlockAnchoredEvent, MessageSentEvent } from "../../../contracts/typechain/LineaRollup"; +import { MessageClaimedEvent, ServiceVersionMigratedEvent } from "../../../contracts/typechain/L2MessageService"; +import { L2_MESSAGING_BLOCK_ANCHORED_EVENT_SIGNATURE, MESSAGE_SENT_EVENT_SIGNATURE } from "../../../core/constants"; +import { L2MessagingBlockAnchored, MessageClaimed, MessageSent, ServiceVersionMigrated } from "../../../core/types"; + +export const testMessageSentEvent: MessageSent = { + blockNumber: 51, + logIndex: 1, + contractAddress: TEST_CONTRACT_ADDRESS_1, + transactionHash: TEST_TRANSACTION_HASH, + messageSender: TEST_ADDRESS_1, + destination: TEST_ADDRESS_2, + fee: 0n, + value: 0n, + messageNonce: 1n, + calldata: "0x", + messageHash: TEST_MESSAGE_HASH, +}; + +export const testL2MessagingBlockAnchoredEvent: L2MessagingBlockAnchored = { + blockNumber: 51, + logIndex: 0, + contractAddress: TEST_CONTRACT_ADDRESS_1, + transactionHash: TEST_TRANSACTION_HASH, + l2Block: 51n, +}; + +export const testMessageClaimedEvent: MessageClaimed = { + blockNumber: 100_000, + logIndex: 0, + contractAddress: TEST_CONTRACT_ADDRESS_1, + transactionHash: TEST_TRANSACTION_HASH, + messageHash: TEST_MESSAGE_HASH, +}; + +export const testServiceVersionMigratedEvent: ServiceVersionMigrated = { + blockNumber: 51, + logIndex: 0, + contractAddress: TEST_CONTRACT_ADDRESS_1, + transactionHash: TEST_TRANSACTION_HASH, + version: 2n, +}; + +export const testMessageSentEventLog: MessageSentEvent.Log = { + blockNumber: 51, + blockHash: TEST_BLOCK_HASH, + transactionIndex: 0, + removed: false, + address: TEST_CONTRACT_ADDRESS_1, + data: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000", + topics: [ + MESSAGE_SENT_EVENT_SIGNATURE, + `0x000000000000000000000000${TEST_ADDRESS_1.slice(2)}`, + `0x000000000000000000000000${TEST_ADDRESS_2.slice(2)}`, + TEST_MESSAGE_HASH, + ], + transactionHash: TEST_TRANSACTION_HASH, + index: 1, + removeListener: jest.fn(), + getBlock: jest.fn(), + getTransaction: jest.fn(), + getTransactionReceipt: jest.fn(), + event: "MessageSent", + eventSignature: "MessageSent(address,address,uint256,uint256,uint256,bytes,bytes32)", + decode: jest.fn(), + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + args: { + _from: TEST_ADDRESS_1, + _to: TEST_ADDRESS_2, + _fee: 0n, + _value: 0n, + _nonce: 1n, + _calldata: "0x", + _messageHash: TEST_MESSAGE_HASH, + }, +}; + +export const testMessageClaimedEventLog: MessageClaimedEvent.Log = { + blockNumber: 100_000, + blockHash: TEST_BLOCK_HASH, + transactionIndex: 0, + removed: false, + address: TEST_CONTRACT_ADDRESS_1, + data: "0x", + topics: ["0xa4c827e719e911e8f19393ccdb85b5102f08f0910604d340ba38390b7ff2ab0e", TEST_MESSAGE_HASH], + transactionHash: TEST_TRANSACTION_HASH, + index: 0, + removeListener: jest.fn(), + getBlock: jest.fn(), + getTransaction: jest.fn(), + getTransactionReceipt: jest.fn(), + event: "MessageClaimed", + eventSignature: "MessageClaimed(bytes32)", + decode: jest.fn(), + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + args: { + _messageHash: TEST_MESSAGE_HASH, + }, +}; + +export const testServiceVersionMigratedEventLog: ServiceVersionMigratedEvent.Log = { + blockNumber: 51, + blockHash: TEST_BLOCK_HASH, + transactionIndex: 0, + removed: false, + address: TEST_CONTRACT_ADDRESS_1, + data: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000", + topics: [ + "0x6f4cd2683fd248db2513412cb2f25f767694689d6f083941f7437c8fe1f87964", + `0x000000000000000000000000${TEST_ADDRESS_1.slice(2)}`, + "0x0000000000000000000000000000000000000000000000000000000000000002", + ], + transactionHash: TEST_TRANSACTION_HASH, + index: 0, + removeListener: jest.fn(), + getBlock: jest.fn(), + getTransaction: jest.fn(), + getTransactionReceipt: jest.fn(), + event: "ServiceVersionMigrated", + eventSignature: "ServiceVersionMigrated(uint256)", + decode: jest.fn(), + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + args: { + version: 2n, + }, +}; + +export const testL2MessagingBlockAnchoredEventLog: L2MessagingBlockAnchoredEvent.Log = { + blockNumber: 51, + blockHash: TEST_BLOCK_HASH, + transactionIndex: 0, + removed: false, + address: TEST_CONTRACT_ADDRESS_1, + data: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000", + topics: [ + L2_MESSAGING_BLOCK_ANCHORED_EVENT_SIGNATURE, + "0x0000000000000000000000000000000000000000000000000000000000000033", + ], + transactionHash: TEST_TRANSACTION_HASH, + index: 0, + removeListener: jest.fn(), + getBlock: jest.fn(), + getTransaction: jest.fn(), + getTransactionReceipt: jest.fn(), + event: "L2MessagingBlockAnchored", + eventSignature: "L2MessagingBlockAnchored(uint256)", + decode: jest.fn(), + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + args: { + l2Block: 51n, + }, +}; diff --git a/sdk/src/utils/testing/helpers.ts b/sdk/src/utils/testing/helpers.ts index de87b5250..ef5bb9b96 100644 --- a/sdk/src/utils/testing/helpers.ts +++ b/sdk/src/utils/testing/helpers.ts @@ -9,7 +9,6 @@ import { ethers, randomBytes, } from "ethers"; -import { ILogger } from "../../core/utils/logging/ILogger"; import { TEST_ADDRESS_1, TEST_BLOCK_HASH, @@ -17,54 +16,31 @@ import { TEST_CONTRACT_ADDRESS_2, TEST_MESSAGE_HASH, TEST_TRANSACTION_HASH, -} from "./constants"; +} from "./constants/common"; import { DEFAULT_ENFORCE_MAX_GAS_FEE, DEFAULT_GAS_ESTIMATION_PERCENTILE, DEFAULT_L2_MESSAGE_TREE_DEPTH, - DEFAULT_MAX_FEE_PER_GAS, + DEFAULT_MAX_FEE_PER_GAS_CAP, L2_MERKLE_TREE_ADDED_EVENT_SIGNATURE, L2_MESSAGING_BLOCK_ANCHORED_EVENT_SIGNATURE, MESSAGE_SENT_EVENT_SIGNATURE, } from "../../core/constants"; -import { Direction, MessageStatus } from "../../core/enums/MessageEnums"; -import { Message, MessageProps } from "../../core/entities/Message"; -import { SDKMode } from "../../sdk/config"; -import { LineaRollupClient } from "../../clients/blockchain/ethereum/LineaRollupClient"; -import { EthersLineaRollupLogClient } from "../../clients/blockchain/ethereum/EthersLineaRollupLogClient"; -import { EthersL2MessageServiceLogClient } from "../../clients/blockchain/linea/EthersL2MessageServiceLogClient"; -import { L2MessageServiceClient } from "../../clients/blockchain/linea/L2MessageServiceClient"; -import { MessageEntity } from "../../application/postman/persistence/entities/Message.entity"; -import { DefaultGasProvider } from "../../clients/blockchain/gas/DefaultGasProvider"; -import { LineaRollupMessageRetriever } from "../../clients/blockchain/ethereum/LineaRollupMessageRetriever"; -import { MerkleTreeService } from "../../clients/blockchain/ethereum/MerkleTreeService"; -import { L2MessageServiceMessageRetriever } from "../../clients/blockchain/linea/L2MessageServiceMessageRetriever"; -import { LineaGasProvider } from "../../clients/blockchain/gas/LineaGasProvider"; -import { ChainQuerier } from "../../clients/blockchain/ChainQuerier"; -import { L2ChainQuerier } from "../../clients/blockchain/linea/L2ChainQuerier"; - -export class TestLogger implements ILogger { - public readonly name: string; - - constructor(loggerName: string) { - this.name = loggerName; - } - - // eslint-disable-next-line @typescript-eslint/no-unused-vars - public info(error: any): void {} - - // eslint-disable-next-line @typescript-eslint/no-unused-vars - public error(error: any): void {} - - // eslint-disable-next-line @typescript-eslint/no-unused-vars - public warn(error: any): void {} - - // eslint-disable-next-line @typescript-eslint/no-unused-vars - public debug(error: any): void {} - - // eslint-disable-next-line @typescript-eslint/no-unused-vars - public warnOrError(error: any): void {} -} +import { Message, SDKMode } from "../../core/types"; +import { + LineaRollupClient, + EthersLineaRollupLogClient, + LineaRollupMessageRetriever, + MerkleTreeService, +} from "../../clients/ethereum"; +import { + L2MessageServiceClient, + EthersL2MessageServiceLogClient, + L2MessageServiceMessageRetriever, +} from "../../clients/linea"; +import { DefaultGasProvider, GasProvider } from "../../clients/gas"; +import { LineaProvider, Provider } from "../../clients/providers"; +import { Direction } from "../../core/enums"; export const getTestProvider = () => { return new JsonRpcProvider("http://localhost:8545"); @@ -185,9 +161,8 @@ export const generateTransactionResponse = (overrides?: Partial): Message => { - return new Message({ - id: 1, +export const generateMessage = (overrides?: Partial): Message => { + return { messageSender: TEST_ADDRESS_1, destination: TEST_CONTRACT_ADDRESS_1, fee: 10n, @@ -195,47 +170,19 @@ export const generateMessage = (overrides?: Partial): Message => { messageNonce: 1n, calldata: "0x", messageHash: TEST_MESSAGE_HASH, - contractAddress: TEST_CONTRACT_ADDRESS_2, - sentBlockNumber: 100_000, - direction: Direction.L1_TO_L2, - status: MessageStatus.SENT, - claimNumberOfRetry: 0, - createdAt: new Date("2023-08-04"), - updatedAt: new Date("2023-08-04"), - ...overrides, - }); -}; - -export const generateMessageEntity = (overrides?: Partial): MessageEntity => { - return { - id: 1, - messageSender: TEST_ADDRESS_1, - destination: TEST_CONTRACT_ADDRESS_1, - fee: "10", - value: "2", - messageNonce: 1, - calldata: "0x", - messageHash: TEST_MESSAGE_HASH, - messageContractAddress: TEST_CONTRACT_ADDRESS_2, - sentBlockNumber: 100_000, - direction: Direction.L1_TO_L2, - status: MessageStatus.SENT, - claimNumberOfRetry: 0, - createdAt: new Date("2023-08-04"), - updatedAt: new Date("2023-08-04"), ...overrides, }; }; export function generateLineaRollupClient( - l1Provider: JsonRpcProvider, - l2Provider: JsonRpcProvider, + l1Provider: Provider, + l2Provider: LineaProvider, l1ContractAddress: string, l2ContractAddres: string, mode: SDKMode, signer?: Signer, gasFeesOptions?: { - maxFeePerGas?: bigint; + maxFeePerGasCap?: bigint; gasEstimationPercentile?: number; enforceMaxGasFee?: boolean; }, @@ -249,22 +196,21 @@ export function generateLineaRollupClient( } { const lineaRollupLogClient = new EthersLineaRollupLogClient(l1Provider, l1ContractAddress); const l2MessageServiceLogClient = new EthersL2MessageServiceLogClient(l2Provider, l2ContractAddres); - const chainQuerier = new ChainQuerier(l1Provider, signer); - const gasProvider = new DefaultGasProvider(chainQuerier, { - maxFeePerGas: gasFeesOptions?.maxFeePerGas ?? DEFAULT_MAX_FEE_PER_GAS, + const gasProvider = new DefaultGasProvider(l1Provider, { + maxFeePerGasCap: gasFeesOptions?.maxFeePerGasCap ?? DEFAULT_MAX_FEE_PER_GAS_CAP, gasEstimationPercentile: gasFeesOptions?.gasEstimationPercentile ?? DEFAULT_GAS_ESTIMATION_PERCENTILE, enforceMaxGasFee: gasFeesOptions?.enforceMaxGasFee ?? DEFAULT_ENFORCE_MAX_GAS_FEE, }); - const messageRetriever = new LineaRollupMessageRetriever(chainQuerier, lineaRollupLogClient, l1ContractAddress); + const messageRetriever = new LineaRollupMessageRetriever(l1Provider, lineaRollupLogClient, l1ContractAddress); const merkleTreeService = new MerkleTreeService( - chainQuerier, + l1Provider, l1ContractAddress, lineaRollupLogClient, l2MessageServiceLogClient, DEFAULT_L2_MESSAGE_TREE_DEPTH, ); const lineaRollupClient = new LineaRollupClient( - chainQuerier, + l1Provider, l1ContractAddress, lineaRollupLogClient, l2MessageServiceLogClient, @@ -286,36 +232,40 @@ export function generateLineaRollupClient( } export function generateL2MessageServiceClient( - l2Provider: JsonRpcProvider, + l2Provider: LineaProvider, l2ContractAddress: string, mode: SDKMode, signer?: Signer, gasFeesOptions?: { - maxFeePerGas?: bigint; + maxFeePerGasCap?: bigint; gasEstimationPercentile?: number; enforceMaxGasFee?: boolean; + enableLineaEstimateGas?: boolean; }, ): { l2MessageServiceClient: L2MessageServiceClient; l2MessageServiceLogClient: EthersL2MessageServiceLogClient; - l2ChainQuerier: L2ChainQuerier; - gasProvider: LineaGasProvider; + gasProvider: GasProvider; messageRetriever: L2MessageServiceMessageRetriever; } { const l2MessageServiceLogClient = new EthersL2MessageServiceLogClient(l2Provider, l2ContractAddress); - const l2ChainQuerier = new L2ChainQuerier(l2Provider, signer); - const gasProvider = new LineaGasProvider(l2ChainQuerier, { - maxFeePerGas: gasFeesOptions?.maxFeePerGas ?? DEFAULT_MAX_FEE_PER_GAS, - enforceMaxGasFee: gasFeesOptions?.enforceMaxGasFee ?? DEFAULT_ENFORCE_MAX_GAS_FEE, - }); const messageRetriever = new L2MessageServiceMessageRetriever( - l2ChainQuerier, + l2Provider, l2MessageServiceLogClient, l2ContractAddress, ); + + const gasProvider = new GasProvider(l2Provider, { + maxFeePerGasCap: gasFeesOptions?.maxFeePerGasCap ?? DEFAULT_MAX_FEE_PER_GAS_CAP, + enforceMaxGasFee: gasFeesOptions?.enforceMaxGasFee ?? DEFAULT_ENFORCE_MAX_GAS_FEE, + gasEstimationPercentile: gasFeesOptions?.gasEstimationPercentile ?? DEFAULT_GAS_ESTIMATION_PERCENTILE, + direction: Direction.L1_TO_L2, + enableLineaEstimateGas: gasFeesOptions?.enableLineaEstimateGas ?? false, + }); + const l2MessageServiceClient = new L2MessageServiceClient( - l2ChainQuerier, + l2Provider, l2ContractAddress, messageRetriever, gasProvider, @@ -323,7 +273,7 @@ export function generateL2MessageServiceClient( signer, ); - return { l2MessageServiceClient, l2MessageServiceLogClient, gasProvider, messageRetriever, l2ChainQuerier }; + return { l2MessageServiceClient, l2MessageServiceLogClient, gasProvider, messageRetriever }; } export const generateL2MessagingBlockAnchoredLog = (l2Block: bigint, overrides?: Partial): ethers.Log => { diff --git a/sdk/tsconfig.build.json b/sdk/tsconfig.build.json index 03c94c9d7..d916583c4 100644 --- a/sdk/tsconfig.build.json +++ b/sdk/tsconfig.build.json @@ -6,11 +6,12 @@ "inlineSources": true, "noEmit": false, "outDir": "dist", - "rootDir": ".", + "rootDir": "src", "sourceMap": true }, - "include": ["./src/**/*.ts", "scripts/**/runPostman.ts"], + "include": ["./src/**/*.ts"], "exclude": [ "src/**/*.test.ts", + "src/utils/testing/constants/events.ts", ] } \ No newline at end of file diff --git a/sdk/tsconfig.json b/sdk/tsconfig.json index 6c8cd918f..8a5362cf9 100644 --- a/sdk/tsconfig.json +++ b/sdk/tsconfig.json @@ -4,6 +4,7 @@ "lib": ["ES2021", "DOM"], "noEmit": false, "skipLibCheck": true, + "noErrorTruncation": true, "strictPropertyInitialization": false, "experimentalDecorators": true, "emitDecoratorMetadata": true, diff --git a/ts-libs/linea-native-libs/tsconfig.json b/ts-libs/linea-native-libs/tsconfig.json index cf1d04772..11dca5a82 100644 --- a/ts-libs/linea-native-libs/tsconfig.json +++ b/ts-libs/linea-native-libs/tsconfig.json @@ -7,11 +7,11 @@ "lib": ["ES2020"], "module": "CommonJS", "moduleResolution": "node", - "noEmit": true, "noErrorTruncation": true, "noUncheckedIndexedAccess": true, "strict": true, - "target": "es2020" + "target": "es2020", + "composite": true }, "exclude": ["./dist", "**/node_modules"] } \ No newline at end of file