diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9e39307e..2dba1e88 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,6 +11,9 @@ on: env: PRIVATE_KEY_ANVIL: ${{ secrets.PRIVATE_KEY_ANVIL }} PRIVATE_KEY_SEPOLIA: ${{ secrets.PRIVATE_KEY_SEPOLIA }} + PRIVATE_KEY_84532: ${{ secrets.PRIVATE_KEY_84532 }} + PRIVATE_KEY_11155111: ${{ secrets.PRIVATE_KEY_11155111 }} + PROVIDER_URI_MAINNET: ${{ secrets.PROVIDER_URI_MAINNET }} PROVIDER_URI_SEPOLIA: ${{ secrets.PROVIDER_URI_SEPOLIA }} PROVIDER_URI_GOERLI: ${{ secrets.PROVIDER_URI_GOERLI }} PROVIDER_URI_1: ${{ secrets.PROVIDER_URI_1 }} @@ -19,8 +22,8 @@ env: PINATA_JWT: ${{ secrets.PINATA_JWT }} jobs: - circuit-js: - name: JS Circuit Tests + circuit: + name: Circuit & QueryBuilder Tests runs-on: ubuntu-latest steps: @@ -46,14 +49,10 @@ jobs: - name: Run Unit Tests working-directory: ./circuit - run: | - ANVIL_PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 - export PRIVATE_KEY=$ANVIL_PRIVATE_KEY # just needs to be in the correct format, no tx is sent in unit tests - export PRIVATE_KEY_GOERLI=$ANVIL_PRIVATE_KEY - pnpm test + run: pnpm test - client-tests: - name: Client Tests + client-unit-tests: + name: Client Unit Tests runs-on: ubuntu-latest steps: @@ -81,12 +80,37 @@ jobs: working-directory: ./client run: pnpm test test/unit + harness-integration-tests-11155111: + name: "Harness: Client Integration Tests (11155111)" + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Setup pnpm + uses: pnpm/action-setup@v3 + with: + version: 8 + + - name: "Install Node.js" + uses: "actions/setup-node@v4" + with: + node-version: "20.x" + cache: "pnpm" + registry-url: "https://registry.npmjs.org" + cache-dependency-path: client/pnpm-lock.yaml + + - name: Set all packages to local and build + working-directory: ./ + run: pnpm local + - name: Run Integration Tests (Client) - working-directory: ./client - run: pnpm test test/integration + working-directory: ./harness + run: CHAIN_ID=11155111 pnpm test test/integration/start.test.ts - harness: - name: Harness Tests + harness-integration-tests-84532: + name: "Harness: Client Integration Tests (84532)" runs-on: ubuntu-latest steps: @@ -104,16 +128,12 @@ jobs: node-version: "20.x" cache: "pnpm" registry-url: "https://registry.npmjs.org" - cache-dependency-path: harness/pnpm-lock.yaml + cache-dependency-path: client/pnpm-lock.yaml - name: Set all packages to local and build working-directory: ./ run: pnpm local - - name: Run Integration Tests (Sepolia) + - name: Run Integration Tests (Client) working-directory: ./harness - run: | - ANVIL_PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 - export PRIVATE_KEY=$ANVIL_PRIVATE_KEY # just needs to be in the correct format, no tx is sent in unit tests - export PRIVATE_KEY_SEPOLIA=$ANVIL_PRIVATE_KEY - pnpm test test/unit/sepolia.test.ts + run: CHAIN_ID=84532 pnpm test test/integration/start.test.ts diff --git a/.github/workflows/update_repos.yml b/.github/workflows/update_repos.yml new file mode 100644 index 00000000..3f487f03 --- /dev/null +++ b/.github/workflows/update_repos.yml @@ -0,0 +1,54 @@ +name: Update Dependent Repositories + +on: + push: + branches: + - main + paths: + - 'package.json' + +jobs: + update-dependents: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Extract version from package.json + id: package_version + run: echo "::set-output name=version::$(jq -r '.version' package.json)" + + - name: Update axiom-quickstart package version + env: + NEW_VERSION: ${{ steps.package_version.outputs.version }} + run: | + git config --global user.name 'github-actions' + git config --global user.email 'github-actions@github.com' + git clone https://github.com/axiom-crypto/axiom-quickstart.git + cd axiom-quickstart + sed -i "s/\"@axiom-crypto\/client\": \".*\"/\"@axiom-crypto\/client\": \"$NEW_VERSION\"/" package.json + git checkout -b update-axiom-sdk-client-version + git add package.json + git commit -m "Update axiom-sdk-client version to $NEW_VERSION" + git push origin update-axiom-sdk-client-version + gh pr create --title "Update axiom-sdk-client version to $NEW_VERSION" --body "This is an automated pull request to update the axiom-sdk-client version to $NEW_VERSION" --repo axiom-crypto/axiom-quickstart --head update-axiom-sdk-client-version --base main + + - name: Update axiom-scaffold-nextjs package version + env: + NEW_VERSION: ${{ steps.package_version.outputs.version }} + run: | + git config --global user.name 'github-actions' + git config --global user.email 'github-actions@github.com' + git clone https://github.com/axiom-crypto/axiom-scaffold-nextjs.git + cd axiom-scaffold-nextjs + sed -i "s/\"@axiom-crypto\/client\": \".*\"/\"@axiom-crypto\/client\": \"$NEW_VERSION\"/" package.json + git checkout -b update-axiom-sdk-client-version + git add package.json + git commit -m "Update axiom-sdk-client version to $NEW_VERSION" + git push origin update-axiom-sdk-client-version + gh pr create --title "Update axiom-sdk-client version to $NEW_VERSION" --body "This is an automated pull request to update the axiom-sdk-client version to $NEW_VERSION" --repo axiom-crypto/axiom-scaffold-nextjs --head update-axiom-sdk-client-version --base main \ No newline at end of file diff --git a/circuit/package.json b/circuit/package.json index 3d3af3ce..0418bbad 100644 --- a/circuit/package.json +++ b/circuit/package.json @@ -1,6 +1,6 @@ { "name": "@axiom-crypto/circuit", - "version": "2.0.8", + "version": "2.0.9", "author": "Intrinsic Technologies", "license": "MIT", "description": "Client SDK to write custom queries for Axiom, the ZK Coprocessor for Ethereum.", @@ -24,13 +24,12 @@ "crypto" ], "dependencies": { - "@axiom-crypto/core": "2.3.8", "@axiom-crypto/halo2-lib-js": "0.3.4", "@axiom-crypto/halo2-wasm": "0.3.4", - "@axiom-crypto/tools": "2.1.0", + "@axiom-crypto/tools": "2.1.1", "commander": "^11.1.0", - "ethers": "^6.8.1", - "viem": "^1.19.9" + "ethers": "^6.12.0", + "viem": "^2.8.18" }, "devDependencies": { "@types/jest": "^29.5.11", diff --git a/circuit/pnpm-lock.yaml b/circuit/pnpm-lock.yaml index c564ce72..1d85f15a 100644 --- a/circuit/pnpm-lock.yaml +++ b/circuit/pnpm-lock.yaml @@ -5,9 +5,6 @@ settings: excludeLinksFromLockfile: false dependencies: - '@axiom-crypto/core': - specifier: 2.3.8 - version: 2.3.8 '@axiom-crypto/halo2-lib-js': specifier: 0.3.4 version: 0.3.4 @@ -15,17 +12,17 @@ dependencies: specifier: 0.3.4 version: 0.3.4 '@axiom-crypto/tools': - specifier: 2.1.0 - version: 2.1.0 + specifier: 2.1.1 + version: 2.1.1 commander: specifier: ^11.1.0 version: 11.1.0 ethers: - specifier: ^6.8.1 - version: 6.11.1 + specifier: ^6.12.0 + version: 6.12.0 viem: - specifier: ^1.19.9 - version: 1.21.4(typescript@5.3.3) + specifier: ^2.8.18 + version: 2.8.18(typescript@5.3.3) devDependencies: '@types/jest': @@ -74,25 +71,11 @@ packages: '@jridgewell/trace-mapping': 0.3.23 dev: true - /@axiom-crypto/core@2.3.8: - resolution: {integrity: sha512-WpokNTai2C/JK26CUSo14XPy2Vh/IqhAQsNDuMMvXn0gMonYJ0DSffpJtMZ78xCi2WH2Q1K91Bjd2f66XPH01g==} - dependencies: - '@axiom-crypto/tools': 2.1.0 - axios: 1.6.7 - bs58: 5.0.0 - ethers: 6.11.1 - merkletreejs: 0.3.11 - transitivePeerDependencies: - - bufferutil - - debug - - utf-8-validate - dev: false - /@axiom-crypto/halo2-lib-js@0.3.4: resolution: {integrity: sha512-E/i7EqlcvjcfXZejL8HcpvFQIIMJxcMrVBXsdaDJGgEXVc6pEDJ07Hy3drLbhQ007ZJ8aultw3HSfD9gJRkh4w==} dependencies: '@axiom-crypto/halo2-wasm': 0.3.4 - ethers: 6.11.1 + ethers: 6.12.0 prettier: 1.18.2 transitivePeerDependencies: - bufferutil @@ -103,12 +86,12 @@ packages: resolution: {integrity: sha512-SUHXnydtx5rY0gQ2zWy0Br6L3iaAFo5RH/AMnOCSM4Nb3inqinBEnXQgEPZ45+EFmeOfRi1xOVUBdo6keZlacQ==} dev: false - /@axiom-crypto/tools@2.1.0: - resolution: {integrity: sha512-kuW4y+OcbHoYviCBNnpbkCYd4FRaewFMitq5N5CDOdt4CNHamlQ2HNxLU00t2yD3oFZyjmMRVU4aGLkFoyNSAg==} + /@axiom-crypto/tools@2.1.1: + resolution: {integrity: sha512-JqKz+S8wIOqoa42h5TMoPCNxatLEoJwOYabFUB1GWSkQ/Ep3ZPDP5ydk/ky3VeDG/KFidBa0/uvVQk5EEK/Rpw==} dependencies: axios: 1.6.7 bs58: 5.0.0 - ethers: 6.11.1 + ethers: 6.12.0 form-data: 4.0.0 transitivePeerDependencies: - bufferutil @@ -652,21 +635,6 @@ packages: dev: true optional: true - /@ethereumjs/rlp@4.0.1: - resolution: {integrity: sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw==} - engines: {node: '>=14'} - hasBin: true - dev: false - - /@ethereumjs/util@8.1.0: - resolution: {integrity: sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==} - engines: {node: '>=14'} - dependencies: - '@ethereumjs/rlp': 4.0.1 - ethereum-cryptography: 2.1.3 - micro-ftch: 0.3.1 - dev: false - /@istanbuljs/load-nyc-config@1.1.0: resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} engines: {node: '>=8'} @@ -933,22 +901,11 @@ packages: '@noble/hashes': 1.3.2 dev: false - /@noble/curves@1.3.0: - resolution: {integrity: sha512-t01iSXPuN+Eqzb4eBX0S5oubSqXbK/xXa1Ne18Hj8f9pStxztHCE2gfboSp/dZRLSqfuLpRK2nDXDK+W9puocA==} - dependencies: - '@noble/hashes': 1.3.3 - dev: false - /@noble/hashes@1.3.2: resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} engines: {node: '>= 16'} dev: false - /@noble/hashes@1.3.3: - resolution: {integrity: sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==} - engines: {node: '>= 16'} - dev: false - /@scure/base@1.1.5: resolution: {integrity: sha512-Brj9FiG2W1MRQSTB212YVPRrcbjkv48FoZi/u4l/zds/ieRrqsh7aUf6CLwkAq61oKXr/ZlTzlY66gLIj3TFTQ==} dev: false @@ -961,14 +918,6 @@ packages: '@scure/base': 1.1.5 dev: false - /@scure/bip32@1.3.3: - resolution: {integrity: sha512-LJaN3HwRbfQK0X1xFSi0Q9amqOgzQnnDngIt+ZlsBC3Bm7/nE7K0kwshZHyaru79yIVRv/e1mQAjZyuZG6jOFQ==} - dependencies: - '@noble/curves': 1.3.0 - '@noble/hashes': 1.3.3 - '@scure/base': 1.1.5 - dev: false - /@scure/bip39@1.2.1: resolution: {integrity: sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==} dependencies: @@ -976,13 +925,6 @@ packages: '@scure/base': 1.1.5 dev: false - /@scure/bip39@1.2.2: - resolution: {integrity: sha512-HYf9TUXG80beW+hGAt3TRM8wU6pQoYur9iNypTROm42dorCGmLnFe3eWjz3gOq6G62H2WRh0FCzAR1PI+29zIA==} - dependencies: - '@noble/hashes': 1.3.3 - '@scure/base': 1.1.5 - dev: false - /@sinclair/typebox@0.27.8: resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} dev: true @@ -1074,11 +1016,11 @@ packages: '@types/yargs-parser': 21.0.3 dev: true - /abitype@0.9.8(typescript@5.3.3): - resolution: {integrity: sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ==} + /abitype@1.0.0(typescript@5.3.3): + resolution: {integrity: sha512-NMeMah//6bJ56H5XRj8QCV4AwuW6hB6zqz2LnhhLdcWVQOsXki6/Pn3APeqxCma62nXIcmZWdu1DlHWS74umVQ==} peerDependencies: typescript: '>=5.0.4' - zod: ^3 >=3.19.1 + zod: ^3 >=3.22.0 peerDependenciesMeta: typescript: optional: true @@ -1231,18 +1173,6 @@ packages: resolution: {integrity: sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==} dev: false - /bignumber.js@9.1.2: - resolution: {integrity: sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==} - dev: false - - /bn.js@4.11.6: - resolution: {integrity: sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA==} - dev: false - - /bn.js@5.2.1: - resolution: {integrity: sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==} - dev: false - /brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} dependencies: @@ -1291,10 +1221,6 @@ packages: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} dev: true - /buffer-reverse@1.0.1: - resolution: {integrity: sha512-M87YIUBsZ6N924W57vDwT/aOu8hw7ZgdByz6ijksLjmHJELBASmYTTlNHRgjE+pTsT9oJXGaDSgqqwfdHotDUg==} - dev: false - /callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} @@ -1432,10 +1358,6 @@ packages: which: 2.0.2 dev: true - /crypto-js@4.2.0: - resolution: {integrity: sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==} - dev: false - /debug@4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} @@ -1562,23 +1484,8 @@ packages: hasBin: true dev: true - /ethereum-bloom-filters@1.0.10: - resolution: {integrity: sha512-rxJ5OFN3RwjQxDcFP2Z5+Q9ho4eIdEmSc2ht0fCu8Se9nbXjZ7/031uXoUYJ87KHCOdVeiUuwSnoS7hmYAGVHA==} - dependencies: - js-sha3: 0.8.0 - dev: false - - /ethereum-cryptography@2.1.3: - resolution: {integrity: sha512-BlwbIL7/P45W8FGW2r7LGuvoEZ+7PWsniMvQ4p5s2xCyw9tmaDlpfsN9HjAucbF+t/qpVHwZUisgfK24TCW8aA==} - dependencies: - '@noble/curves': 1.3.0 - '@noble/hashes': 1.3.3 - '@scure/bip32': 1.3.3 - '@scure/bip39': 1.2.2 - dev: false - - /ethers@6.11.1: - resolution: {integrity: sha512-mxTAE6wqJQAbp5QAe/+o+rXOID7Nw91OZXvgpjDa1r4fAbq2Nu314oEZSbjoRLacuCzs7kUC3clEvkCQowffGg==} + /ethers@6.12.0: + resolution: {integrity: sha512-zL5NlOTjML239gIvtVJuaSk0N9GQLi1Hom3ZWUszE5lDTQE/IVB62mrPkQ2W1bGcZwVGSLaetQbWNQSvI4rGDQ==} engines: {node: '>=14.0.0'} dependencies: '@adraffy/ens-normalize': 1.10.1 @@ -1593,14 +1500,6 @@ packages: - utf-8-validate dev: false - /ethjs-unit@0.1.6: - resolution: {integrity: sha512-/Sn9Y0oKl0uqQuvgFk/zQgR7aw1g36qX/jzSQ5lSwlO0GigPymk4eGQfeNTD03w1dPOqfz8V77Cy43jH56pagw==} - engines: {node: '>=6.5.0', npm: '>=3'} - dependencies: - bn.js: 4.11.6 - number-to-bn: 1.7.0 - dev: false - /execa@5.1.1: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} @@ -1809,11 +1708,6 @@ packages: engines: {node: '>=6'} dev: true - /is-hex-prefixed@1.0.0: - resolution: {integrity: sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==} - engines: {node: '>=6.5.0', npm: '>=3'} - dev: false - /is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} @@ -2305,10 +2199,6 @@ packages: - ts-node dev: true - /js-sha3@0.8.0: - resolution: {integrity: sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==} - dev: false - /js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} dev: true @@ -2396,21 +2286,6 @@ packages: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} dev: true - /merkletreejs@0.3.11: - resolution: {integrity: sha512-LJKTl4iVNTndhL+3Uz/tfkjD0klIWsHlUzgtuNnNrsf7bAlXR30m+xYB7lHr5Z/l6e/yAIsr26Dabx6Buo4VGQ==} - engines: {node: '>= 7.6.0'} - dependencies: - bignumber.js: 9.1.2 - buffer-reverse: 1.0.1 - crypto-js: 4.2.0 - treeify: 1.1.0 - web3-utils: 1.10.4 - dev: false - - /micro-ftch@0.3.1: - resolution: {integrity: sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg==} - dev: false - /micromatch@4.0.5: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} engines: {node: '>=8.6'} @@ -2470,14 +2345,6 @@ packages: path-key: 3.1.1 dev: true - /number-to-bn@1.7.0: - resolution: {integrity: sha512-wsJ9gfSz1/s4ZsJN01lyonwuxA1tml6X1yBDnfpMglypcBRFZZkus26EdPSlqS5GJfYddVZa22p3VNb3z5m5Ig==} - engines: {node: '>=6.5.0', npm: '>=3'} - dependencies: - bn.js: 4.11.6 - strip-hex-prefix: 1.0.0 - dev: false - /once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} dependencies: @@ -2598,12 +2465,6 @@ packages: resolution: {integrity: sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==} dev: true - /randombytes@2.1.0: - resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} - dependencies: - safe-buffer: 5.2.1 - dev: false - /react-is@18.2.0: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} dev: true @@ -2643,10 +2504,6 @@ packages: supports-preserve-symlinks-flag: 1.0.0 dev: true - /safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - dev: false - /semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true @@ -2742,13 +2599,6 @@ packages: engines: {node: '>=6'} dev: true - /strip-hex-prefix@1.0.0: - resolution: {integrity: sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A==} - engines: {node: '>=6.5.0', npm: '>=3'} - dependencies: - is-hex-prefixed: 1.0.0 - dev: false - /strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} @@ -2805,11 +2655,6 @@ packages: is-number: 7.0.0 dev: true - /treeify@1.1.0: - resolution: {integrity: sha512-1m4RA7xVAJrSGrrXGs0L3YTwyvBs2S8PbRHaLZAkFw7JR8oIFwYtysxlBZhYIa7xSyiYJKZ3iGrrk55cGA3i9A==} - engines: {node: '>=0.6'} - dev: false - /ts-jest@29.1.2(@babel/core@7.24.0)(jest@29.7.0)(typescript@5.3.3): resolution: {integrity: sha512-br6GJoH/WUX4pu7FbZXuWGKGNDuU7b8Uj77g/Sp7puZV6EXzuByl6JrECvm0MzVzSTkSHWTihsXt+5XYER5b+g==} engines: {node: ^16.10.0 || ^18.0.0 || >=20.0.0} @@ -2889,10 +2734,6 @@ packages: picocolors: 1.0.0 dev: true - /utf8@3.0.0: - resolution: {integrity: sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==} - dev: false - /v8-to-istanbul@9.2.0: resolution: {integrity: sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==} engines: {node: '>=10.12.0'} @@ -2902,8 +2743,8 @@ packages: convert-source-map: 2.0.0 dev: true - /viem@1.21.4(typescript@5.3.3): - resolution: {integrity: sha512-BNVYdSaUjeS2zKQgPs+49e5JKocfo60Ib2yiXOWBT6LuVxY1I/6fFX3waEtpXvL1Xn4qu+BVitVtMh9lyThyhQ==} + /viem@2.8.18(typescript@5.3.3): + resolution: {integrity: sha512-Kq3kwkKziJ8rQeLkmdbSLheHDnA+tx2EdLKLmQ3N4FVtjKYjBP9tPL1r+fI6KltVUM1TDOhIHOdslDSp57VMMg==} peerDependencies: typescript: '>=5.0.4' peerDependenciesMeta: @@ -2915,7 +2756,7 @@ packages: '@noble/hashes': 1.3.2 '@scure/bip32': 1.3.2 '@scure/bip39': 1.2.1 - abitype: 0.9.8(typescript@5.3.3) + abitype: 1.0.0(typescript@5.3.3) isows: 1.0.3(ws@8.13.0) typescript: 5.3.3 ws: 8.13.0 @@ -2931,20 +2772,6 @@ packages: makeerror: 1.0.12 dev: true - /web3-utils@1.10.4: - resolution: {integrity: sha512-tsu8FiKJLk2PzhDl9fXbGUWTkkVXYhtTA+SmEFkKft+9BgwLxfCRpU96sWv7ICC8zixBNd3JURVoiR3dUXgP8A==} - engines: {node: '>=8.0.0'} - dependencies: - '@ethereumjs/util': 8.1.0 - bn.js: 5.2.1 - ethereum-bloom-filters: 1.0.10 - ethereum-cryptography: 2.1.3 - ethjs-unit: 0.1.6 - number-to-bn: 1.7.0 - randombytes: 2.1.0 - utf8: 3.0.0 - dev: false - /which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} diff --git a/circuit/src/cliHandler/compile.ts b/circuit/src/cliHandler/compile.ts index d7f1ab9e..edaad68a 100644 --- a/circuit/src/cliHandler/compile.ts +++ b/circuit/src/cliHandler/compile.ts @@ -13,6 +13,8 @@ export const compile = async ( provider?: string, mock?: boolean, cache?: string, + force?: boolean, + defaultInputs?: string, } ) => { let circuitFunction = "circuit"; @@ -37,7 +39,11 @@ export const compile = async ( capacity: f.config?.capacity, config: f.config?.config, }) - const circuitInputs = f.defaultInputs; + let circuitInputs = f.defaultInputs; + if (options.defaultInputs !== undefined) { + console.log("Using default inputs from file:", options.defaultInputs); + circuitInputs = readJsonFromFile(options.defaultInputs); + } const circuitFn = `const ${f.importName} = AXIOM_CLIENT_IMPORT\n${f.circuit.toString()}`; const encoder = new TextEncoder(); const circuitBuild = encoder.encode(circuitFn); @@ -48,7 +54,9 @@ export const compile = async ( outfile = options.outputs; } - if (existsSync(outfile)) { + if (options.force) { + console.log(`Forcing compilation for ${circuitPath}.`); + } else if (existsSync(outfile)) { const existingData = JSON.parse(readFileSync(outfile, 'utf8')); if (existingData.circuit === circuitString) { console.log(`Circuit ${circuitPath} already compiled to ${outfile}`); @@ -57,7 +65,6 @@ export const compile = async ( } const res = options.mock ? await circuit.mockCompile(circuitInputs) : await circuit.compile(circuitInputs); - const build = { ...res, circuit: circuitString, @@ -67,4 +74,4 @@ export const compile = async ( if (options.cache) { saveJsonToFile(circuit.getResults(), options.cache); } -} \ No newline at end of file +}; diff --git a/circuit/src/index.ts b/circuit/src/index.ts index 46f5e79c..ae18eca1 100644 --- a/circuit/src/index.ts +++ b/circuit/src/index.ts @@ -1,10 +1,11 @@ export * from "./subquery"; export * from "./circuitRunner"; export * from "./encoder"; +export * from "./queryBuilderBase"; export { RawInput as UserInput, AxiomV2CircuitCapacity, } from './types'; export { DEFAULT_CAPACITY } from './constants'; -export { CircuitValue, CircuitValue256 } from "@axiom-crypto/halo2-lib-js"; -export * from "@axiom-crypto/halo2-lib-js/halo2lib/functions"; \ No newline at end of file +export { CircuitConfig, CircuitValue, CircuitValue256 } from "@axiom-crypto/halo2-lib-js"; +export * from "@axiom-crypto/halo2-lib-js/halo2lib/functions"; diff --git a/circuit/src/pkg/index.ts b/circuit/src/pkg/index.ts new file mode 100644 index 00000000..2eed2172 --- /dev/null +++ b/circuit/src/pkg/index.ts @@ -0,0 +1 @@ +export * from "./tools"; diff --git a/circuit/src/pkg/tools.ts b/circuit/src/pkg/tools.ts new file mode 100644 index 00000000..8ccf7b21 --- /dev/null +++ b/circuit/src/pkg/tools.ts @@ -0,0 +1 @@ +export * from "@axiom-crypto/tools"; \ No newline at end of file diff --git a/circuit/src/queryBuilderBase/configure.ts b/circuit/src/queryBuilderBase/configure.ts new file mode 100644 index 00000000..c3dbcf4f --- /dev/null +++ b/circuit/src/queryBuilderBase/configure.ts @@ -0,0 +1,87 @@ +import { Versions } from "./constants"; +import { QueryBuilderBaseConfig } from "./types"; + +export function handleProvider(config: QueryBuilderBaseConfig): QueryBuilderBaseConfig { + if (config.providerUri === undefined || config.providerUri === "") { + throw new Error("`providerUri` is required in QueryBuilderBaseConfig"); + } + return config; +} + +export function handleChainId(config: QueryBuilderBaseConfig): QueryBuilderBaseConfig { + if (config.sourceChainId === undefined) { + config.sourceChainId = 1; + } + if (config.targetChainId === undefined) { + config.targetChainId = config.sourceChainId; + } + return config; +} + +export function parseProvider(provider: string): string { + if (!provider) { + throw new Error("Invalid provider: value is undefined or empty string"); + } + if ( + provider.startsWith("http://") || + provider.startsWith("https://") + ) { + return provider; + } else if (provider.startsWith("wss://")) { + throw new Error("Websockets is not yet supported"); + } else { + throw new Error( + "Invalid provider: must start with http://, https://, or wss://" + ); + } +} + +export function parseChainId(chainId?: number | string | bigint): bigint { + if (chainId === undefined) { + return BigInt(1); + } + return BigInt(chainId.valueOf()); +} + +export function parseVersion(version?: string): string { + if (version === undefined) { + return Versions[Versions.length - 1]; + } + + let parsedVersion = version.toLowerCase(); + if (!parsedVersion.startsWith("v")) { + parsedVersion = `v${parsedVersion}`; + } + parsedVersion = parsedVersion.replace(/\./g, "_") as string; + + if (Versions.includes(parsedVersion)) { + return parsedVersion; + } + throw new Error( + "Invalid version number. Valid versions are: " + Versions.join(", ") + ); +} + +export function parseMock(mock: boolean | undefined, chainId: bigint): boolean { + if (mock === undefined) { + return false; + } + if (chainId === 1n) { + return false; + } + return mock; +} + +export function parseAddress(address?: string): string { + if (!address) { + return ""; + } + if (!address.startsWith("0x")) { + address = "0x" + address; + } + if (address.length !== 42) { + throw new Error("Invalid address: must be 42 characters long"); + } + address = address.toLowerCase(); + return address; +} diff --git a/circuit/src/queryBuilderBase/constants.ts b/circuit/src/queryBuilderBase/constants.ts new file mode 100644 index 00000000..6d450865 --- /dev/null +++ b/circuit/src/queryBuilderBase/constants.ts @@ -0,0 +1,111 @@ +import { ethers } from "ethers"; +import { AxiomV2Callback, AxiomV2ComputeQuery, DataSubqueryCount } from "./types"; + +export const Versions = ["v2"]; + +export enum SubqueryConfig { + Default, // Catch-all for anything below `Large` size + AllLarge, + AllMax, +} + +export enum TxSizeCategory { + Default, + Large, + Max, +} + +export enum ReceiptSizeCategory { + Default, + Medium, + Large, + Max, +} + +export const ConstantsV2 = Object.freeze({ + // Default values for options + DefaultMaxFeePerGasWei: "25000000000", + DefaultCallbackGasLimit: 100000, + DefaultOverrideAxiomQueryFee: "0", + + // Fallback values if contract value cannot be read + FallbackProofVerificationGas: 420000n, + FallbackAxiomQueryFeeWei: 3000000000000000n, + + // Subquery limits + UserMaxTotalSubqueries: 128, + SubqueryConfigs: { + [SubqueryConfig.Default]: { + MaxTxSubqueries: 128, + MaxReceiptSubqueries: 128, + }, + [SubqueryConfig.AllLarge]: { + MaxTxSubqueries: 16, + MaxReceiptSubqueries: 16, + }, + [SubqueryConfig.AllMax]: { + MaxTxSubqueries: 4, + MaxReceiptSubqueries: 1, + }, + }, + + // Tx categorization + TxSizeCategory: { + Default: { + MaxDataLen: 8192, + MaxAccessListRlpLen: 4096, + }, + Large: { + MaxDataLen: 32768, + MaxAccessListRlpLen: 16384, + }, + Max: { + MaxDataLen: 330000, + MaxAccessListRlpLen: 131072, + }, + }, + + // Receipt categorization + ReceiptSizeCategory: { + Default: { + MaxLogDataLen: 800, + MaxNumLogs: 20, + }, + Medium: { + MaxLogDataLen: 1024, + MaxNumLogs: 80, + }, + Large: { + MaxLogDataLen: 2048, + MaxNumLogs: 80, + }, + Max: { + MaxLogDataLen: 1024, + MaxNumLogs: 400, + }, + }, + + // Default empty objects + EmptyComputeQueryObject: { + k: 0, + resultLen: 0, + vkey: [] as string[], + computeProof: "0x00", + } as AxiomV2ComputeQuery, + EmptyCallbackObject: { + target: ethers.ZeroAddress, + extraData: ethers.ZeroHash, + } as AxiomV2Callback, + EmptyDataSubqueryCount: { + total: 0, + header: 0, + account: 0, + storage: 0, + transaction: 0, + receipt: 0, + solidityNestedMapping: 0, + } as DataSubqueryCount, + + // Various constants + Bytes32Max: "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", +}); diff --git a/circuit/src/queryBuilderBase/dataSubquery/configLimitManager.ts b/circuit/src/queryBuilderBase/dataSubquery/configLimitManager.ts new file mode 100644 index 00000000..810ef259 --- /dev/null +++ b/circuit/src/queryBuilderBase/dataSubquery/configLimitManager.ts @@ -0,0 +1,177 @@ +import { + getNumBytes, + objectToRlp, +} from "@axiom-crypto/tools"; +import { + ReceiptSizeCategory, + SubqueryConfig, + TxSizeCategory, + ConstantsV2 +} from "../constants"; + +// ConfigLimitManager handles the logic for determining the maximum number of subqueries +// of transaction and receipt types by getting the size of various parameters of the +// Transaction and Receipt. Global parameters for all subqueries are still enforced by +// QueryBuliderV2. +export class ConfigLimitManager { + globalConfig: SubqueryConfig = SubqueryConfig.Default; + txSizeCategory: TxSizeCategory = TxSizeCategory.Default + receiptSizeCategory: ReceiptSizeCategory = ReceiptSizeCategory.Default; + numTxSubqueries: number = 0; + numReceiptSubqueries: number = 0; + + constructor() {} + + processTx(tx: any) { + // Check total data length + const txDataLen = getNumBytes(tx.input); + + // Check access list length + let aclNumBytesRlp = 0; + if (tx.type === "0x1" || tx.type === "0x2") { + const accessListRlp = objectToRlp(tx.accessList ?? {}); + aclNumBytesRlp = getNumBytes(accessListRlp); + } + + // Validate max bounds + if (txDataLen > ConstantsV2.TxSizeCategory.Max.MaxDataLen) { + throw new Error(`Transaction data length (${txDataLen} bytes) exceeds supported maximum (${ConstantsV2.TxSizeCategory.Max.MaxDataLen} bytes)`); + } + if (aclNumBytesRlp > ConstantsV2.TxSizeCategory.Max.MaxAccessListRlpLen) { + throw new Error(`Transaction access list length (${aclNumBytesRlp} bytes) exceeds supported maximum (${ConstantsV2.TxSizeCategory.Max.MaxAccessListRlpLen} bytes)`); + } + + // Check the size category for this tx + let thisTxSize = TxSizeCategory.Default; + if ( + txDataLen > ConstantsV2.TxSizeCategory.Large.MaxDataLen || + aclNumBytesRlp > ConstantsV2.TxSizeCategory.Large.MaxAccessListRlpLen + ) { + thisTxSize = TxSizeCategory.Max; + } else if ( + txDataLen > ConstantsV2.TxSizeCategory.Default.MaxDataLen || + aclNumBytesRlp > ConstantsV2.TxSizeCategory.Default.MaxAccessListRlpLen + ) { + thisTxSize = TxSizeCategory.Large; + } + + // Set size category if it's greater than the current size category + if (thisTxSize > this.txSizeCategory) { + this.txSizeCategory = thisTxSize; + } + + // Increment txSubqueries + this.numTxSubqueries++; + + // Update Global config size based on txSizeCategory if size is smaller + let thisTxGlobalSize = SubqueryConfig.Default; + switch (this.txSizeCategory) { + case TxSizeCategory.Large: + thisTxGlobalSize = SubqueryConfig.AllLarge; + break; + case TxSizeCategory.Max: + this.globalConfig = SubqueryConfig.AllMax; + break; + default: + break; + } + if (thisTxGlobalSize > this.globalConfig) { + this.globalConfig = thisTxGlobalSize; + } + + // Check the subquery count + const config = ConstantsV2.SubqueryConfigs[this.globalConfig as keyof typeof ConstantsV2.SubqueryConfigs]; + if (this.numTxSubqueries > config.MaxTxSubqueries) { + throw new Error(`Exceeded maximum number of tx subqueries (${this.numTxSubqueries}) for config: ${this.globalConfig}`); + } + if (this.numReceiptSubqueries > config.MaxReceiptSubqueries) { + throw new Error(`Exceeded maximum number of receipt subqueries (${this.numReceiptSubqueries}) for config: ${this.globalConfig}`); + } + } + + processReceipt(rc: any) { + // Get num logs + const numLogs = rc.logs.length; + + // Get max log data length + let maxLogDataLen = 0; + for (const log of rc.logs) { + const logDataLen = getNumBytes(log.data); + if (logDataLen > maxLogDataLen) { + maxLogDataLen = logDataLen; + } + } + + // Validate max bounds + if ( + !( + (maxLogDataLen <= ConstantsV2.ReceiptSizeCategory.Large.MaxLogDataLen + && numLogs <= ConstantsV2.ReceiptSizeCategory.Large.MaxNumLogs) || + (maxLogDataLen <= ConstantsV2.ReceiptSizeCategory.Max.MaxLogDataLen + && numLogs <= ConstantsV2.ReceiptSizeCategory.Max.MaxNumLogs) + ) + ) { + throw new Error(`Receipt size (${maxLogDataLen} bytes, ${numLogs} logs) exceeds either Large or Max config categories`); + } + + // Check the size category for this receipt + let thisLogDataLenSize = ReceiptSizeCategory.Default; + if (maxLogDataLen > ConstantsV2.ReceiptSizeCategory.Medium.MaxLogDataLen) { + thisLogDataLenSize = ReceiptSizeCategory.Large; + } else if (maxLogDataLen > ConstantsV2.ReceiptSizeCategory.Default.MaxLogDataLen) { + thisLogDataLenSize = ReceiptSizeCategory.Medium; + } + let thisNumLogsSize = ReceiptSizeCategory.Default; + if (numLogs > ConstantsV2.ReceiptSizeCategory.Large.MaxNumLogs) { + thisNumLogsSize = ReceiptSizeCategory.Max; + } else if (numLogs > ConstantsV2.ReceiptSizeCategory.Default.MaxNumLogs) { + thisNumLogsSize = ReceiptSizeCategory.Medium; + } + const thisReceiptSize = Math.max(thisLogDataLenSize, thisNumLogsSize); + + // Set size category if it's greater than the current size category + if (thisReceiptSize > this.receiptSizeCategory) { + this.receiptSizeCategory = thisReceiptSize; + } + + // Increment receiptSubqueries + this.numReceiptSubqueries++; + + // Update Global config size based on receiptSizeCategory if size is smaller + let thisReceiptGlobalSize = SubqueryConfig.Default; + switch (this.receiptSizeCategory) { + case ReceiptSizeCategory.Large: + thisReceiptGlobalSize = SubqueryConfig.AllLarge; + break; + case ReceiptSizeCategory.Max: + this.globalConfig = SubqueryConfig.AllMax; + break; + default: + break; + } + if (thisReceiptGlobalSize > this.globalConfig) { + this.globalConfig = thisReceiptGlobalSize; + } + + // Check the subquery count + const config = ConstantsV2.SubqueryConfigs[this.globalConfig as keyof typeof ConstantsV2.SubqueryConfigs]; + if (this.numReceiptSubqueries > config.MaxReceiptSubqueries) { + throw new Error(`Exceeded maximum number of receipt subqueries (${this.numReceiptSubqueries}) for config: ${this.globalConfig}`); + } + if (this.numTxSubqueries > config.MaxTxSubqueries) { + throw new Error(`Exceeded maximum number of tx subqueries (${this.numTxSubqueries}) for config: ${this.globalConfig}`); + } + } + + getGlobalConfig(): SubqueryConfig { + return this.globalConfig; + } + + getTxSizeCategory(): TxSizeCategory { + return this.txSizeCategory; + } + + getReceiptSizeCategory(): ReceiptSizeCategory { + return this.receiptSizeCategory; + } +} \ No newline at end of file diff --git a/circuit/src/queryBuilderBase/dataSubquery/format.ts b/circuit/src/queryBuilderBase/dataSubquery/format.ts new file mode 100644 index 00000000..16c5ef42 --- /dev/null +++ b/circuit/src/queryBuilderBase/dataSubquery/format.ts @@ -0,0 +1,157 @@ +import { ethers } from "ethers"; +import { + bytes32, + getBlockNumberAndTxIdx, + encodeDataQuery, + AxiomV2DataQuery, + HeaderSubquery, + AccountSubquery, + StorageSubquery, + TxSubquery, + ReceiptSubquery, + SolidityNestedMappingSubquery, + Subquery, +} from "@axiom-crypto/tools"; +import { + DataSubquery, + DataSubqueryType, +} from "../types"; +import { getSubqueryTypeFromKeys } from "../utils"; + +/** + * Formats Subquery[] into DataSubquery[] + */ +export function formatDataSubqueries( + subqueries: Subquery[], +): DataSubquery[] { + let dataSubqueries: DataSubquery[] = []; + for (const subquery of subqueries) { + const type = getSubqueryTypeFromKeys(Object.keys(subquery)); + let dataSubquery = formatDataSubquery(subquery, type); + dataSubqueries.push(dataSubquery); + } + return dataSubqueries; +} + +export function encodeBuilderDataQuery(chainId: number | string | bigint, allSubqueries: DataSubquery[]): string { + return encodeDataQuery(chainId, allSubqueries); +} + +export function formatDataQuery(chainId: number | string | bigint, allSubqueries: DataSubquery[]): AxiomV2DataQuery { + const sourceChainId = chainId.toString(); + return { + sourceChainId, + subqueries: allSubqueries, + }; +} + +export function formatDataSubquery( + subquery: Subquery, + type: DataSubqueryType, +): DataSubquery { + switch (type) { + case DataSubqueryType.Header: + return formatDataSubqueryHeader(subquery as HeaderSubquery); + case DataSubqueryType.Account: + return formatDataSubqueryAccount(subquery as AccountSubquery); + case DataSubqueryType.Storage: + return formatDataSubqueryStorage(subquery as StorageSubquery); + case DataSubqueryType.Transaction: + return formatDataSubqueryTx(subquery as TxSubquery); + case DataSubqueryType.Receipt: + return formatDataSubqueryReceipt(subquery as ReceiptSubquery); + case DataSubqueryType.SolidityNestedMapping: + return formatDataSubquerySolidityNestedMapping(subquery as SolidityNestedMappingSubquery); + default: + throw new Error(`Invalid data subquery type: ${type}`); + } +} + +function formatDataSubqueryHeader(subquery: HeaderSubquery): DataSubquery { + if (subquery.blockNumber === undefined) { + throw new Error("Block number is required for Header subquery"); + } + return { + type: DataSubqueryType.Header, + subqueryData: { + blockNumber: subquery.blockNumber, + fieldIdx: subquery.fieldIdx, + } as HeaderSubquery, + }; +} + +function formatDataSubqueryAccount(subquery: AccountSubquery): DataSubquery { + if (subquery.blockNumber === undefined) { + throw new Error("Block number is required for Account subquery"); + } + return { + type: DataSubqueryType.Account, + subqueryData: { + blockNumber: subquery.blockNumber, + addr: subquery.addr.toLowerCase(), + fieldIdx: subquery.fieldIdx, + } as AccountSubquery, + }; +} + +function formatDataSubqueryStorage(subquery: StorageSubquery): DataSubquery { + if (subquery.blockNumber === undefined) { + throw new Error("Block number is required for Storage subquery"); + } + return { + type: DataSubqueryType.Storage, + subqueryData: { + blockNumber: subquery.blockNumber, + addr: subquery.addr.toLowerCase(), + slot: subquery.slot, + } as StorageSubquery, + }; +} + +function formatDataSubqueryTx(subquery: TxSubquery): DataSubquery { + if (subquery.blockNumber === undefined) { + throw new Error("Block number is required for Tx subquery"); + } + return { + type: DataSubqueryType.Transaction, + subqueryData: { + blockNumber: subquery.blockNumber, + txIdx: subquery.txIdx, + fieldOrCalldataIdx: subquery.fieldOrCalldataIdx, + } as TxSubquery, + }; +} + +function formatDataSubqueryReceipt(subquery: ReceiptSubquery): DataSubquery { + if (subquery.blockNumber === undefined) { + throw new Error("Block number is required for Receipt subquery"); + } + return { + type: DataSubqueryType.Receipt, + subqueryData: { + blockNumber: subquery.blockNumber, + txIdx: subquery.txIdx, + fieldOrLogIdx: subquery.fieldOrLogIdx, + topicOrDataOrAddressIdx: subquery.topicOrDataOrAddressIdx, + eventSchema: subquery.eventSchema.toLowerCase(), + } as ReceiptSubquery, + }; +} + +function formatDataSubquerySolidityNestedMapping( + subquery: SolidityNestedMappingSubquery, +): DataSubquery { + if (subquery.blockNumber === undefined) { + throw new Error("Block number is required for SolidityNestedMapping subquery"); + } + return { + type: DataSubqueryType.SolidityNestedMapping, + subqueryData: { + blockNumber: subquery.blockNumber, + addr: subquery.addr.toLowerCase(), + mappingSlot: subquery.mappingSlot, + mappingDepth: subquery.mappingDepth, + keys: subquery.keys.map((key) => bytes32(String(key).toLowerCase())), + } as SolidityNestedMappingSubquery, + }; +} diff --git a/circuit/src/queryBuilderBase/dataSubquery/validate.ts b/circuit/src/queryBuilderBase/dataSubquery/validate.ts new file mode 100644 index 00000000..e1632bf5 --- /dev/null +++ b/circuit/src/queryBuilderBase/dataSubquery/validate.ts @@ -0,0 +1,251 @@ +import { ethers } from "ethers"; +import { + AccountField, + BeaconValidatorSubquery, + HeaderField, + ReceiptField, + TxField, + getNumBytes, + AxiomV2FieldConstant, + getAccountFieldValue, + getHeaderFieldValue, + getReceiptFieldValue, + getSolidityNestedMappingValue, + getStorageFieldValue, + getTxFieldValue, + getRawTransaction, + getRawReceipt, + HeaderSubquery, + AccountSubquery, + StorageSubquery, + TxSubquery, + ReceiptSubquery, + SolidityNestedMappingSubquery, + getTxHash, +} from "@axiom-crypto/tools"; +import { ConfigLimitManager } from "./configLimitManager"; + +export async function validateHeaderSubquery( + provider: ethers.JsonRpcProvider, + subquery: HeaderSubquery, +): Promise { + if ( + (subquery.fieldIdx > HeaderField.WithdrawalsRoot && subquery.fieldIdx < AxiomV2FieldConstant.Header.HashFieldIdx) || + (subquery.fieldIdx > AxiomV2FieldConstant.Header.ExtraDataLenFieldIdx && + subquery.fieldIdx < AxiomV2FieldConstant.Header.LogsBloomFieldIdxOffset) || + subquery.fieldIdx >= AxiomV2FieldConstant.Header.LogsBloomFieldIdxOffset + 8 + ) { + console.error(`Invalid header field index: ${subquery.fieldIdx}`); + return false; + } + const latestBlock = await provider.getBlock("latest"); + if (latestBlock === null) { + throw new Error("Failed to get latest block; check your internet connection or provider RPC"); + } + if (subquery.blockNumber > latestBlock.number) { + console.warn(`Block number ${subquery.blockNumber} is in the future`); + } + + const value = await getHeaderFieldValue(provider, subquery, console); + if (value === null) { + console.error(`Header subquery ${JSON.stringify(subquery)} returned null`); + return false; + } + return true; +} + +export async function validateAccountSubquery( + provider: ethers.JsonRpcProvider, + subquery: AccountSubquery, +): Promise { + if (subquery.fieldIdx > AccountField.CodeHash) { + console.error(`Invalid account field index: ${subquery.fieldIdx}`); + return false; + } + const latestBlock = await provider.getBlock("latest"); + if (latestBlock === null) { + throw new Error("Failed to get latest block; check your internet connection or provider RPC"); + } + if (subquery.blockNumber > latestBlock.number) { + console.warn(`Block number ${subquery.blockNumber} is in the future`); + } + + const value = await getAccountFieldValue(provider, subquery, console); + if (value === null) { + console.error(`Account subquery ${JSON.stringify(subquery)} returned null`); + return false; + } + return true; +} + +export async function validateStorageSubquery( + provider: ethers.JsonRpcProvider, + subquery: StorageSubquery, +): Promise { + const latestBlock = await provider.getBlock("latest"); + if (latestBlock === null) { + throw new Error("Failed to get latest block; check your internet connection or provider RPC"); + } + if (subquery.blockNumber > latestBlock.number) { + console.warn(`Block number ${subquery.blockNumber} is in the future`); + } + + const value = await getStorageFieldValue(provider, subquery, console); + if (value === null) { + console.error(`Storage subquery ${JSON.stringify(subquery)} returned null`); + return false; + } + return true; +} + +export async function validateTxSubquery( + provider: ethers.JsonRpcProvider, + subquery: TxSubquery, + configLimitManager: ConfigLimitManager, +): Promise { + if ( + (subquery.fieldOrCalldataIdx > TxField.s && subquery.fieldOrCalldataIdx < AxiomV2FieldConstant.Tx.TxTypeFieldIdx) || + (subquery.fieldOrCalldataIdx > AxiomV2FieldConstant.Tx.CalldataHashFieldIdx && + subquery.fieldOrCalldataIdx < AxiomV2FieldConstant.Tx.CalldataIdxOffset) + ) { + console.error(`Invalid tx field/calldata index: ${subquery.fieldOrCalldataIdx}`); + return false; + } + + const txHash = await getTxHash(provider, subquery.blockNumber, subquery.txIdx); + if (!txHash) { + console.error(`Unable to get txHash from blockNumber: ${subquery.blockNumber} and txIdx: ${subquery.txIdx}`); + return false; + } + const tx = await getRawTransaction(provider, txHash); + if (!tx) { + console.error(`Unable to get transaction from txHash: ${txHash}`); + return false; + } + if (tx.blockNumber === undefined || tx.transactionIndex === undefined) { + console.error("Unable to get blockNumber or txIdx from supplied txHash"); + return false; + } + const blockNumber = Number(tx.blockNumber); + const txIdx = Number(tx.transactionIndex); + + configLimitManager.processTx(tx); + + const value = await getTxFieldValue( + provider, + { + blockNumber, + txIdx, + fieldOrCalldataIdx: subquery.fieldOrCalldataIdx, + }, + console, + tx, + ); + if (value === null) { + console.error(`Tx subquery ${JSON.stringify(subquery)} returned null`); + return false; + } + return true; +} + +export async function validateReceiptSubquery( + provider: ethers.JsonRpcProvider, + subquery: ReceiptSubquery, + configLimitManager: ConfigLimitManager, +): Promise { + if ( + (subquery.fieldOrLogIdx > ReceiptField.CumulativeGas && + subquery.fieldOrLogIdx < AxiomV2FieldConstant.Receipt.AddressIdx) || + (subquery.fieldOrLogIdx > AxiomV2FieldConstant.Receipt.TxIndexFieldIdx && + subquery.fieldOrLogIdx < AxiomV2FieldConstant.Receipt.LogIdxOffset) + ) { + console.error(`Invalid receipt field/log index: ${subquery.fieldOrLogIdx}`); + return false; + } + if (subquery.fieldOrLogIdx >= AxiomV2FieldConstant.Receipt.LogIdxOffset) { + if (!ethers.isBytesLike(subquery.eventSchema) || getNumBytes(subquery.eventSchema) !== 32) { + console.error(`Must define event schema when using log index: ${subquery.eventSchema}`); + return false; + } + } + if ( + subquery.topicOrDataOrAddressIdx > 4 && + subquery.topicOrDataOrAddressIdx < AxiomV2FieldConstant.Receipt.LogIdxOffset && + subquery.topicOrDataOrAddressIdx !== AxiomV2FieldConstant.Receipt.AddressIdx + ) { + console.error(`Invalid receipt topic/data/address index index: ${subquery.topicOrDataOrAddressIdx}`); + return false; + } + + const txHash = await getTxHash(provider, subquery.blockNumber, subquery.txIdx); + if (!txHash) { + console.error(`Unable to get txHash from blockNumber: ${subquery.blockNumber} and txIdx: ${subquery.txIdx}`); + return false; + } + const rc = await getRawReceipt(provider, txHash); + if (!rc) { + console.error(`Unable to get receipt from txHash: ${txHash}`); + return false; + } + + if (rc.blockNumber === undefined || rc.transactionIndex === undefined) { + console.error("Unable to get blockNumber or txIdx from supplied txHash"); + return false; + } + const blockNumber = Number(rc.blockNumber); + const txIdx = Number(rc.transactionIndex); + + configLimitManager.processReceipt(rc); + + const value = await getReceiptFieldValue( + provider, + { + blockNumber, + txIdx, + fieldOrLogIdx: subquery.fieldOrLogIdx, + topicOrDataOrAddressIdx: subquery.topicOrDataOrAddressIdx, + eventSchema: subquery.eventSchema, + }, + console, + rc, + ); + if (value === null) { + console.error(`Receipt subquery ${JSON.stringify(subquery)} returned null`); + return false; + } + return true; +} + +export async function validateSolidityNestedMappingSubquery( + provider: ethers.JsonRpcProvider, + subquery: SolidityNestedMappingSubquery, +): Promise { + if (subquery.keys.length !== subquery.mappingDepth) { + console.error( + `Nested mapping keys length ${subquery.keys.length} does not match mapping depth ${subquery.mappingDepth}`, + ); + return false; + } + const latestBlock = await provider.getBlock("latest"); + if (latestBlock === null) { + throw new Error("Failed to get latest block; check your internet connection or provider RPC"); + } + if (subquery.blockNumber > latestBlock.number) { + console.warn(`Block number ${subquery.blockNumber} is in the future`); + } + + const value = await getSolidityNestedMappingValue(provider, subquery, console); + if (value === null) { + console.error(`Solidity nested mapping subquery ${JSON.stringify(subquery)} returned null`); + return false; + } + return true; +} + +export async function validateBeaconSubquery( + provider: ethers.JsonRpcProvider, + subquery: BeaconValidatorSubquery, +): Promise { + // WIP + return true; +} diff --git a/circuit/src/queryBuilderBase/index.ts b/circuit/src/queryBuilderBase/index.ts new file mode 100644 index 00000000..763e49b8 --- /dev/null +++ b/circuit/src/queryBuilderBase/index.ts @@ -0,0 +1,3 @@ +export * from "./queryBuilderBase"; +export * from "./utils"; +export * from "./types"; diff --git a/circuit/src/queryBuilderBase/queryBuilderBase.ts b/circuit/src/queryBuilderBase/queryBuilderBase.ts new file mode 100644 index 00000000..2199b8d6 --- /dev/null +++ b/circuit/src/queryBuilderBase/queryBuilderBase.ts @@ -0,0 +1,409 @@ +import { ethers } from "ethers"; +import { + AxiomV2ComputeQuery, + DataSubqueryType, + bytes32, + getQuerySchemaHash, + getQueryHashV2, + getDataQueryHashFromSubqueries, + AxiomV2CircuitConstant, + AxiomV2DataQuery, + Subquery, + HeaderSubquery, + AccountSubquery, + StorageSubquery, + TxSubquery, + ReceiptSubquery, + SolidityNestedMappingSubquery, + BeaconValidatorSubquery, +} from "@axiom-crypto/tools"; +import { + DataSubqueryCount, + QueryBuilderBaseConfig, + BuiltQueryV2Base, + QueryBuilderBaseInternalConfig, +} from "./types"; +import { ConstantsV2 } from "./constants"; +import { + validateAccountSubquery, + validateHeaderSubquery, + validateStorageSubquery, + validateTxSubquery, + validateReceiptSubquery, + validateSolidityNestedMappingSubquery, + validateBeaconSubquery, +} from "./dataSubquery/validate"; +import { getSubqueryTypeFromKeys } from "./utils"; +import { formatDataQuery, formatDataSubqueries, encodeBuilderDataQuery } from "./dataSubquery/format"; +import { deepCopyObject } from "../utils"; +import { ConfigLimitManager } from "./dataSubquery/configLimitManager"; +import { handleChainId, handleProvider, parseChainId, parseMock, parseProvider, parseVersion } from "./configure"; + +/** + * Base class for building Axiom queries. This is a base class is used to eventually build a dataQuery and computeQuery into a + * format that can be sent onchain. However, it requires QueryBuilderClient to build the client-facing pieces of the query. Most + * users will want to use QueryBuilderClient instead of this class. + */ +export class QueryBuilderBase { + // Configuration object + readonly config: QueryBuilderBaseInternalConfig; + + // Built Query base object; undefined if Query has not been built yet + protected builtQueryBase?: BuiltQueryV2Base; + + // The set of data subqueries + protected dataQuery?: Subquery[]; + + // The compute query + protected computeQuery?: AxiomV2ComputeQuery; + + // An object that handles the counts of all subquery types + protected dataSubqueryCount: DataSubqueryCount; + + constructor( + config: QueryBuilderBaseConfig, + dataQuery?: Subquery[], + computeQuery?: AxiomV2ComputeQuery, + ) { + this.config = this.configure(config); + this.dataSubqueryCount = deepCopyObject(ConstantsV2.EmptyDataSubqueryCount); + if (dataQuery !== undefined) { + this.append(dataQuery); + } + if (computeQuery !== undefined) { + this.computeQuery = this.handleComputeQueryRequest(computeQuery); + } + } + + protected configure(config: QueryBuilderBaseConfig): QueryBuilderBaseInternalConfig { + config = handleProvider(config); + const providerUri = parseProvider(config.providerUri); + + config = handleChainId(config); + const sourceChainId = parseChainId(config.sourceChainId); + const targetChainId = parseChainId(config.targetChainId); + + const mock = parseMock(config.mock, sourceChainId); + const version = parseVersion(config.version); + + const provider = new ethers.JsonRpcProvider(providerUri); + + return { + providerUri, + provider, + sourceChainId, + targetChainId, + mock, + version, + }; + } + + /** + * Gets the current set of unbuilt data subqueries + * @returns Array of unbuilt data subqueries + */ + getDataQuery(): Subquery[] | undefined { + return this.dataQuery; + } + + /** + * Gets the current compute query + * @returns The current compute query + */ + getComputeQuery(): AxiomV2ComputeQuery | undefined { + return this.computeQuery; + } + + + /** + * Gets the current count of each type of data subquery + * @returns Subquery counts + */ + getDataSubqueryCount(): DataSubqueryCount { + return this.dataSubqueryCount; + } + + /** + * Gets the built Query. Built Query resets if any data is changed. + * @returns The built Query; undefined if Query has not been built yet + */ + getBuiltQueryBase(): BuiltQueryV2Base | undefined { + return this.builtQueryBase; + } + + /** + * Gets the hash of the querySchema of the computeQuery + * @returns Query schema hash + */ + getQuerySchema(): string { + return getQuerySchemaHash( + this.computeQuery?.k ?? 0, + this.computeQuery?.resultLen ?? this.getDefaultResultLen(), + this.computeQuery?.vkey ?? [], + ); + } + + /** + * Gets the hash of the data query + * @returns Data query hash + */ + getDataQueryHash(): string { + if (this.builtQueryBase === undefined) { + throw new Error( + "Query must first be built with `.build()` before getting data query hash. If Query is modified after building, you will need to run `.build()` again.", + ); + } + return getDataQueryHashFromSubqueries(this.config.sourceChainId.toString(), this.builtQueryBase.dataQueryStruct.subqueries); + } + + getQueryHash(): string { + if (this.builtQueryBase === undefined) { + throw new Error( + "Query must first be built with `.build()` before getting query hash. If Query is modified after building, you will need to run `.build()` again.", + ); + } + const computeQuery = this.computeQuery ?? deepCopyObject(ConstantsV2.EmptyComputeQueryObject); + return getQueryHashV2(this.config.sourceChainId.toString(), this.getDataQueryHash(), computeQuery); + } + + setDataQuery(dataQuery: Subquery[]) { + this.unsetBuiltQueryBase(); + this.dataQuery = undefined; + this.append(dataQuery); + } + + setComputeQuery(computeQuery: AxiomV2ComputeQuery) { + this.unsetBuiltQueryBase(); + this.computeQuery = this.handleComputeQueryRequest(computeQuery); + } + + setMock(mock: boolean) { + this.config.mock = mock; + } + + /** + * Append a `Subquery[]` object to the current dataQuery + * @param dataQuery A `Subquery[]` object to append + */ + append(dataSubqueries: Subquery[], skipValidate?: boolean): void { + this.unsetBuiltQueryBase(); + + if (this.dataQuery === undefined) { + this.dataQuery = [] as Subquery[]; + } + + if (this.dataQuery?.length + dataSubqueries.length > ConstantsV2.UserMaxTotalSubqueries) { + throw new Error(`Cannot add more than ${ConstantsV2.UserMaxTotalSubqueries} subqueries`); + } + + // Append new dataSubqueries to existing dataQuery + this.dataQuery = [...(this.dataQuery ?? []), ...dataSubqueries]; + if (!skipValidate) { + this.validateSubqueryCount(); + } + } + + /** + * Appends a single subquery to the current dataQuery + * @param dataSubquery The data of the subquery to append + * @param type (optional) The type of subquery to append. If not provided, the type will be + * inferred from the keys of the subquery. + */ + appendDataSubquery(dataSubquery: Subquery): void { + this.append([dataSubquery]); + } + + /** + * Appends an already-built DataQuery. This is used when receiving an already-built DataQuery + * from some other service. Setting this will override any currently appended subqueries. + */ + setBuiltDataQuery(dataQuery: AxiomV2DataQuery, skipValidate?: boolean): void { + this.dataQuery = dataQuery.subqueries.map((subquery) => subquery.subqueryData); + if (!skipValidate) { + this.validateSubqueryCount(); + } + } + + /** + * Queries the required subquery data and builds the entire Query object into the format + * that is required by the backend/ZK circuit + * @param validate (optional) Runs validation on the Query before attempting to build it + * @returns A built Query object + */ + async buildBase(validate?: boolean): Promise { + if (validate === true) { + const valid = await this.validate(); + if (!valid) { + throw new Error("Query validation failed"); + } + } + + // Check if Query can be built: needs at least a dataQuery or computeQuery + let validDataQuery = true; + if (this.dataQuery === undefined || this.dataQuery.length === 0) { + validDataQuery = false; + } + let validComputeQuery = true; + if (this.computeQuery === undefined || this.computeQuery.k === 0) { + validComputeQuery = false; + } + if (!validDataQuery && !validComputeQuery) { + throw new Error("Cannot build Query without either a data query or a compute query"); + } + + // Handle Data Query + // Parse and get fetch appropriate data for all data subqueries + const builtDataSubqueries = await formatDataSubqueries(this.dataQuery ?? []); + + // Encode & build data query + const dataQuery = encodeBuilderDataQuery(this.config.sourceChainId, builtDataSubqueries); + const dataQueryHash = getDataQueryHashFromSubqueries(this.config.sourceChainId.toString(), builtDataSubqueries); + const dataQueryStruct = formatDataQuery(this.config.sourceChainId, builtDataSubqueries); + + // Handle compute query + let defaultResultLen = this.getDefaultResultLen(); + let computeQuery: AxiomV2ComputeQuery = { + k: 0, + resultLen: defaultResultLen, + vkey: [] as string[], + computeProof: "0x00", + }; + if (this.computeQuery !== undefined) { + computeQuery.k = this.computeQuery.k; + computeQuery.resultLen = this.computeQuery?.resultLen ?? defaultResultLen; + computeQuery.vkey = this.computeQuery.vkey; + computeQuery.computeProof = this.computeQuery.computeProof; + } + + const querySchema = getQuerySchemaHash( + computeQuery.k, + computeQuery.resultLen ?? defaultResultLen, + computeQuery.vkey, + ); + + // Get the hash of the full Query + const queryHash = getQueryHashV2(this.config.sourceChainId.toString(), dataQueryHash, computeQuery); + + this.builtQueryBase = { + sourceChainId: this.config.sourceChainId.toString(), + targetChainId: this.config.targetChainId.toString(), + queryHash, + dataQuery, + dataQueryHash, + dataQueryStruct, + computeQuery, + querySchema, + }; + + return this.builtQueryBase; + } + + /** + * @returns {boolean} Whether the query is valid or not + */ + async validate(): Promise { + // Check if data subqueries are valid + const data = await this.validateDataSubqueries(); + + // Check if compute query is valid + const compute = await this.validateComputeQuery(); + + return data && compute; + } + + private unsetBuiltQueryBase() { + // Reset built query if any data is changed + this.builtQueryBase = undefined; + } + + private getDefaultResultLen(): number { + return Math.min(this.dataQuery?.length ?? 0, AxiomV2CircuitConstant.UserMaxOutputs); + } + + protected handleComputeQueryRequest(computeQuery: AxiomV2ComputeQuery) { + computeQuery.resultLen = computeQuery.resultLen ?? this.getDefaultResultLen(); + computeQuery.vkey = computeQuery.vkey.map((x: string) => bytes32(x)); + return computeQuery; + } + + protected async validateDataSubqueries(): Promise { + if (this.dataQuery === undefined || this.dataQuery.length === 0) { + return true; + } + const provider = this.config.provider; + let validQuery = true; + const configLimitManager = new ConfigLimitManager(); + + for (const subquery of this.dataQuery) { + const type = getSubqueryTypeFromKeys(Object.keys(subquery)); + switch (type) { + case DataSubqueryType.Header: + validQuery = validQuery && (await validateHeaderSubquery(provider, subquery as HeaderSubquery)); + break; + case DataSubqueryType.Account: + validQuery = validQuery && (await validateAccountSubquery(provider, subquery as AccountSubquery)); + break; + case DataSubqueryType.Storage: + validQuery = validQuery && (await validateStorageSubquery(provider, subquery as StorageSubquery)); + break; + case DataSubqueryType.Transaction: + validQuery = + validQuery && (await validateTxSubquery(provider, subquery as TxSubquery, configLimitManager)); + break; + case DataSubqueryType.Receipt: + validQuery = + validQuery && + (await validateReceiptSubquery(provider, subquery as ReceiptSubquery, configLimitManager)); + break; + case DataSubqueryType.SolidityNestedMapping: + validQuery = + validQuery && + (await validateSolidityNestedMappingSubquery(provider, subquery as SolidityNestedMappingSubquery)); + break; + case DataSubqueryType.BeaconValidator: + validQuery = + validQuery && (await validateBeaconSubquery(provider, subquery as BeaconValidatorSubquery)); + break; + default: + throw new Error(`Invalid subquery type: ${type}`); + } + } + return validQuery; + } + + protected async validateComputeQuery(): Promise { + if (this.computeQuery === undefined) { + return true; + } + let valid = true; + + // Check resultLen + if ( + this.computeQuery.resultLen !== undefined && + this.computeQuery.resultLen > AxiomV2CircuitConstant.UserMaxOutputs + ) { + console.warn(`Callback resultLen is greater than maxOutputs (${AxiomV2CircuitConstant.UserMaxOutputs})`); + valid = false; + } + + // Check that vkey and computeProof are not zero if k is nonzero + if (this.computeQuery.k !== 0) { + if (this.computeQuery.vkey.length === 0) { + console.warn("Compute query vkey is empty"); + valid = false; + } + if (this.computeQuery.computeProof.length === 0) { + console.warn("Compute query computeProof is empty"); + valid = false; + } + } + + return valid; + } + + protected validateSubqueryCount() { + if (this.dataQuery && this.dataQuery.length > ConstantsV2.UserMaxTotalSubqueries) { + throw new Error(`Number of subqueries (${this.dataQuery.length}) exceeds maximum of ${ConstantsV2.UserMaxTotalSubqueries} subqueries`); + } + } +} diff --git a/circuit/src/queryBuilderBase/types.ts b/circuit/src/queryBuilderBase/types.ts new file mode 100644 index 00000000..60acc6e2 --- /dev/null +++ b/circuit/src/queryBuilderBase/types.ts @@ -0,0 +1,67 @@ +import { ethers } from "ethers"; + +import { + AxiomV2ComputeQuery, + AxiomV2DataQuery, +} from "@axiom-crypto/tools"; + +export { + AxiomV2Callback, + AxiomV2ComputeQuery, + AxiomV2DataQuery, + AxiomV2FeeData, + DataSubquery, + HeaderSubquery, + AccountSubquery, + StorageSubquery, + TxSubquery, + ReceiptSubquery, + Subquery, + SolidityNestedMappingSubquery, + BeaconValidatorSubquery, + DataSubqueryType, + HeaderField, + AccountField, + TxField, + ReceiptField, + AxiomV2CircuitConstant, + AxiomV2FieldConstant, +} from "@axiom-crypto/tools"; + +export interface QueryBuilderBaseConfig { + providerUri: string; + sourceChainId?: number | string | bigint; + targetChainId?: number | string | bigint; + version?: string; + mock?: boolean; +} + +export interface QueryBuilderBaseInternalConfig { + providerUri: string; + sourceChainId: bigint; + targetChainId: bigint; + mock: boolean; + provider: ethers.JsonRpcProvider; + version: string; +} + +export interface BuiltQueryV2Base { + sourceChainId: string; + targetChainId: string; + queryHash: string; + dataQuery: string; + dataQueryHash: string; + dataQueryStruct: AxiomV2DataQuery; + computeQuery: AxiomV2ComputeQuery; + querySchema: string; +} + +export interface DataSubqueryCount { + total: number; + header: number; + account: number; + storage: number; + transaction: number; + receipt: number; + solidityNestedMapping: number; +} diff --git a/circuit/src/queryBuilderBase/utils.ts b/circuit/src/queryBuilderBase/utils.ts new file mode 100644 index 00000000..34f64fd8 --- /dev/null +++ b/circuit/src/queryBuilderBase/utils.ts @@ -0,0 +1,20 @@ +import { DataSubqueryType } from "@axiom-crypto/tools"; + +export function getSubqueryTypeFromKeys(keys: string[]): DataSubqueryType { + switch (keys.join(",")) { + case ["blockNumber", "fieldIdx"].join(","): + return DataSubqueryType.Header; + case ["blockNumber", "addr", "fieldIdx"].join(","): + return DataSubqueryType.Account; + case ["blockNumber", "addr", "slot"].join(","): + return DataSubqueryType.Storage; + case ["blockNumber", "txIdx", "fieldOrCalldataIdx"].join(","): + return DataSubqueryType.Transaction; + case ["blockNumber", "txIdx", "fieldOrLogIdx", "topicOrDataOrAddressIdx", "eventSchema"].join(","): + return DataSubqueryType.Receipt; + case ["blockNumber", "addr", "mappingSlot", "mappingDepth", "keys"].join(","): + return DataSubqueryType.SolidityNestedMapping; + default: + throw new Error(`Could not infer subquery type from keys ${keys}`); + } +} diff --git a/circuit/src/scaffold.ts b/circuit/src/scaffold.ts index 259d476e..2dbd228d 100644 --- a/circuit/src/scaffold.ts +++ b/circuit/src/scaffold.ts @@ -7,10 +7,7 @@ import { DataSubquery, getQuerySchemaHash, } from "@axiom-crypto/tools"; -import { - AxiomSdkCore, - QueryV2, -} from "@axiom-crypto/core"; +import { QueryBuilderBase } from "./queryBuilderBase"; import { BaseCircuitScaffold } from "@axiom-crypto/halo2-lib-js"; import { DEFAULT_CAPACITY, DEFAULT_CIRCUIT_CONFIG, SUBQUERY_FE, USER_OUTPUT_FE } from "./constants"; import { AxiomV2CircuitCapacity, AxiomV2CircuitConfig, RawInput } from "./types"; @@ -23,12 +20,12 @@ export abstract class AxiomBaseCircuitScaffold extends BaseCircuitScaffold { protected halo2Lib!: Halo2LibWasm; protected provider: string; protected dataQuery: DataSubquery[]; - protected axiom: AxiomSdkCore; protected computeQuery: AxiomV2ComputeQuery | undefined; - protected chainId: string; + protected chainId?: string; protected f: (inputs: T) => Promise; protected results: { [key: string]: string }; protected inputSchema?: string; + protected isMock?: boolean; protected capacity: AxiomV2CircuitCapacity; constructor(inputs: { @@ -45,6 +42,7 @@ export abstract class AxiomBaseCircuitScaffold extends BaseCircuitScaffold { super(); this.resultLen = 0; this.provider = inputs.provider; + this.isMock = inputs.mock; this.config = inputs.config ?? DEFAULT_CIRCUIT_CONFIG; this.capacity = inputs.capacity ?? DEFAULT_CAPACITY; if ( @@ -55,13 +53,7 @@ export abstract class AxiomBaseCircuitScaffold extends BaseCircuitScaffold { } this.dataQuery = []; - this.axiom = new AxiomSdkCore({ - providerUri: inputs.provider, - chainId: inputs.chainId, - mock: inputs.mock, - version: "v2", - }); - this.chainId = inputs.chainId?.toString() ?? "undefined"; + this.chainId = inputs.chainId?.toString(); this.shouldTime = inputs.shouldTime ?? false; this.loadedVk = false; this.f = inputs.f; @@ -152,11 +144,17 @@ export abstract class AxiomBaseCircuitScaffold extends BaseCircuitScaffold { this.results = results; await this.populateCircuit(inputs); - let skipValidate = this.capacity !== DEFAULT_CAPACITY; + const skipValidate = this.capacity !== DEFAULT_CAPACITY; + // Validate max circuit subquery size - const queryBuilder = (this.axiom.query as QueryV2).new(); - queryBuilder.setBuiltDataQuery({ + const queryBuilderBase = new QueryBuilderBase({ + providerUri: this.provider, sourceChainId: this.chainId, + mock: this.isMock, + version: "v2", + }); + queryBuilderBase.setBuiltDataQuery({ + sourceChainId: queryBuilderBase.config.sourceChainId.toString(), subqueries: this.dataQuery, }, skipValidate); @@ -221,18 +219,20 @@ export abstract class AxiomBaseCircuitScaffold extends BaseCircuitScaffold { async run(inputs: RawInput) { await this.populateCircuit(inputs); - let skipValidate = this.capacity !== DEFAULT_CAPACITY; + const skipValidate = this.capacity !== DEFAULT_CAPACITY; // Validate data subqueries - const queryBuilder = (this.axiom.query as QueryV2).new(); - - // const unbuiltSubqueries = await convertBuiltSubqueries(this.provider, this.dataQuery); - // queryBuilder.append(unbuiltSubqueries, skipValidate); - queryBuilder.setBuiltDataQuery({ + const queryBuilderBase = new QueryBuilderBase({ + providerUri: this.provider, sourceChainId: this.chainId, + mock: this.isMock, + version: "v2", + }); + queryBuilderBase.setBuiltDataQuery({ + sourceChainId: queryBuilderBase.config.sourceChainId.toString(), subqueries: this.dataQuery, }, skipValidate); - if (!skipValidate && !queryBuilder.validate()) { + if (!skipValidate && !queryBuilderBase.validate()) { throw new Error("Subquery validation failed") } @@ -331,11 +331,6 @@ export abstract class AxiomBaseCircuitScaffold extends BaseCircuitScaffold { } setMock(mock: boolean) { - this.axiom = new AxiomSdkCore({ - providerUri: this.provider, - chainId: this.chainId, - mock, - version: "v2", - }); + this.isMock = mock; } } diff --git a/circuit/src/utils.ts b/circuit/src/utils.ts index 42709ac7..bf3dc74f 100644 --- a/circuit/src/utils.ts +++ b/circuit/src/utils.ts @@ -1,6 +1,5 @@ -import { UnbuiltAccountSubquery, UnbuiltHeaderSubquery, UnbuiltSolidityNestedMappingSubquery, UnbuiltStorageSubquery, UnbuiltSubquery, UnbuiltTxSubquery } from "@axiom-crypto/core"; import { CircuitValue, convertRawInput, RawCircuitInput, CircuitValue256 } from "@axiom-crypto/halo2-lib-js"; -import { DataSubquery, DataSubqueryType, ReceiptSubquery, TxSubquery, getBlockNumberAndTxIdx, getTxHash } from "@axiom-crypto/tools"; +import { DataSubquery, DataSubqueryType, ReceiptSubquery, TxSubquery, getTxHash } from "@axiom-crypto/tools"; import { ethers } from "ethers"; export const getCircuitValue256Witness = (value: RawCircuitInput) => { @@ -87,58 +86,7 @@ export function resizeArray(arr: T[], size: number, defaultValue: T): T[] { return arr.slice(0, size); } -export async function convertBuiltSubqueries(provider: string, builtSubqueries: DataSubquery[]): Promise { - let unbuiltSubqueries: UnbuiltSubquery[] = []; - const jsonRpcProvider = new ethers.JsonRpcProvider(provider); - for await (const builtSubquery of builtSubqueries) { - let unbuiltSubquery: {[key: string]: any} = {}; - const type = builtSubquery.type; - switch (type) { - case DataSubqueryType.Header: - unbuiltSubquery = builtSubquery.subqueryData as UnbuiltHeaderSubquery; - unbuiltSubqueries.push(unbuiltSubquery); - break; - case DataSubqueryType.Account: - unbuiltSubquery = builtSubquery.subqueryData as UnbuiltAccountSubquery; - unbuiltSubqueries.push(unbuiltSubquery); - break; - case DataSubqueryType.Storage: - unbuiltSubquery = builtSubquery.subqueryData as UnbuiltStorageSubquery; - unbuiltSubqueries.push(unbuiltSubquery); - break; - case DataSubqueryType.Transaction: - let builtTxData = builtSubquery.subqueryData as TxSubquery; - const txHashTx = await getTxHash(jsonRpcProvider, builtTxData.blockNumber, builtTxData.txIdx) - if (txHashTx === null) { - throw new Error(`Transaction at block ${builtTxData.blockNumber} and index ${builtTxData.txIdx} not found`); - } - unbuiltSubquery = { - txHash: txHashTx, - fieldOrCalldataIdx: builtTxData.fieldOrCalldataIdx, - } - unbuiltSubqueries.push(unbuiltSubquery); - break; - case DataSubqueryType.Receipt: - let builtData = builtSubquery.subqueryData as ReceiptSubquery; - const txHashRc = await getTxHash(jsonRpcProvider, builtData.blockNumber, builtData.txIdx) - if (txHashRc === null) { - throw new Error(`Transaction at block ${builtData.blockNumber} and index ${builtData.txIdx} not found`); - } - unbuiltSubquery = { - txHash: txHashRc, - fieldOrLogIdx: builtData.fieldOrLogIdx, - topicOrDataOrAddressIdx: builtData.topicOrDataOrAddressIdx, - eventSchema: builtData.eventSchema - } - unbuiltSubqueries.push(unbuiltSubquery); - break; - case DataSubqueryType.SolidityNestedMapping: - unbuiltSubquery = builtSubquery.subqueryData as UnbuiltSolidityNestedMappingSubquery; - unbuiltSubqueries.push(unbuiltSubquery); - break; - default: - throw new Error(`Invalid subquery type: ${type}`); - } - } - return unbuiltSubqueries; -} \ No newline at end of file +// Deep copy any object with nested objects. Will not deep copy functions inside the object. +export function deepCopyObject(obj: any): any { + return JSON.parse(JSON.stringify(obj)); +} diff --git a/circuit/test/unit/scaffold.test.ts b/circuit/test/unit/circuitScaffold/scaffold.test.ts similarity index 75% rename from circuit/test/unit/scaffold.test.ts rename to circuit/test/unit/circuitScaffold/scaffold.test.ts index 39bb260b..33773fe9 100644 --- a/circuit/test/unit/scaffold.test.ts +++ b/circuit/test/unit/circuitScaffold/scaffold.test.ts @@ -1,7 +1,6 @@ import { concat, zeroHash } from "viem"; -import { AxiomBaseCircuit } from "../../src/js"; -import { circuit as seven_balance_circuit } from "./circuits/7_balance.circuit"; -import { circuit as seven_balance_override_circuit } from "./circuits/7_balance_override.circuit"; +import { AxiomBaseCircuit } from "../../../src/js"; +import { circuit as seven_balance_circuit } from "../circuits/7_balance.circuit"; describe("Scaffold", () => { test("Build computeQuery", async () => { @@ -9,10 +8,6 @@ describe("Scaffold", () => { const testCircuit = new AxiomBaseCircuit({ provider: process.env.PROVIDER_URI_SEPOLIA as string, f: seven_balance_circuit, - inputSchema: `{ - "address": "CircuitValue", - "claimedBlockNumber": "CircuitValue" - }`, chainId: 5, mock: true, }); diff --git a/circuit/test/unit/scaffoldLimits.test.ts b/circuit/test/unit/circuitScaffold/scaffoldLimits.test.ts similarity index 82% rename from circuit/test/unit/scaffoldLimits.test.ts rename to circuit/test/unit/circuitScaffold/scaffoldLimits.test.ts index 4a917d31..03c0b72c 100644 --- a/circuit/test/unit/scaffoldLimits.test.ts +++ b/circuit/test/unit/circuitScaffold/scaffoldLimits.test.ts @@ -1,6 +1,6 @@ import { concat, zeroHash } from "viem"; -import { AxiomBaseCircuit } from "../../src/js"; -import { circuit as seven_balance_override_circuit } from "./circuits/7_balance_override.circuit"; +import { AxiomBaseCircuit } from "../../../src/js"; +import { circuit as seven_balance_override_circuit } from "../circuits/7_balance_override.circuit"; describe("Scaffold with limit overrides", () => { test("Build computeQuery with limit overrides", async () => { @@ -8,10 +8,6 @@ describe("Scaffold with limit overrides", () => { const testCircuit = new AxiomBaseCircuit({ provider: process.env.PROVIDER_URI_SEPOLIA as string, f: seven_balance_override_circuit, - inputSchema: `{ - "address": "CircuitValue", - "claimedBlockNumber": "CircuitValue" - }`, chainId: 5, mock: true, capacity: { diff --git a/circuit/test/unit/encoder.test.ts b/circuit/test/unit/encoder/encoder.test.ts similarity index 88% rename from circuit/test/unit/encoder.test.ts rename to circuit/test/unit/encoder/encoder.test.ts index 4ffab0c3..427e30fe 100644 --- a/circuit/test/unit/encoder.test.ts +++ b/circuit/test/unit/encoder/encoder.test.ts @@ -1,6 +1,6 @@ -import { encodeAxiomV2CircuitMetadata } from "../../src/encoder"; +import { encodeAxiomV2CircuitMetadata } from "../../../src/encoder"; import { AxiomV2CircuitConstant } from "@axiom-crypto/tools"; -import { AxiomV2CircuitMetadataParams } from "../../src/types"; +import { AxiomV2CircuitMetadataParams } from "../../../src/types"; describe("Encoder", () => { test("Encode AxiomV2CircuitMetadata", () => { diff --git a/circuit/test/unit/queryBuilderBase/basicInitialization.test.ts b/circuit/test/unit/queryBuilderBase/basicInitialization.test.ts new file mode 100644 index 00000000..d73fe371 --- /dev/null +++ b/circuit/test/unit/queryBuilderBase/basicInitialization.test.ts @@ -0,0 +1,46 @@ +import { QueryBuilderBase, QueryBuilderBaseConfig } from "../../../src"; + +// Test coverage areas: +// - Basic initialization +// - DataQuery +// - ComputeQuery +// - Callback + +describe("Basic Initialization", () => { + test("should initialize without an API key", () => { + const config: QueryBuilderBaseConfig = { + providerUri: process.env.PROVIDER_URI_MAINNET as string, + version: "v2", + }; + const ax = new QueryBuilderBase(config); + expect(typeof ax).toEqual("object"); + }); + + test("should initialize AxiomV2", () => { + const config: QueryBuilderBaseConfig = { + providerUri: process.env.PROVIDER_URI_MAINNET as string, + version: "v2", + }; + const ax = new QueryBuilderBase(config); + + expect(typeof ax).toEqual("object"); + }); + + test("should fail on invalid version number", () => { + const config: QueryBuilderBaseConfig = { + providerUri: process.env.PROVIDER_URI_MAINNET as string, + version: "v0.3", + }; + expect(() => new QueryBuilderBase(config)).toThrow(); + }); + + test("should set targetChainId to the same as (source) chainId", () => { + const config: QueryBuilderBaseConfig = { + providerUri: process.env.PROVIDER_URI_SEPOLIA as string, + sourceChainId: 11155111, + version: "v2", + }; + const ax = new QueryBuilderBase(config); + expect(ax.config.sourceChainId).toEqual(ax.config.targetChainId); + }); +}); diff --git a/circuit/test/unit/queryBuilderBase/buildAll.test.ts b/circuit/test/unit/queryBuilderBase/buildAll.test.ts new file mode 100644 index 00000000..66c3186a --- /dev/null +++ b/circuit/test/unit/queryBuilderBase/buildAll.test.ts @@ -0,0 +1,169 @@ +import { ethers } from "ethers"; +import { + QueryBuilderBase, + QueryBuilderBaseConfig, + AccountField, + AccountSubquery, + AxiomV2ComputeQuery, + ReceiptField, +} from "../../../src"; +import { resizeArray } from "../../../src/utils"; + +// Test coverage areas: +// - DataQuery +// - ComputeQuery +// - Callback +// - Options + +describe("Build Query w/ ComputeQuery, DataQuery, Callback, and Options set (core test)", () => { + const BLOCK_NUMBER = 15537394; + const WETH_ADDR = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"; + const WETH_WHALE = "0x2E15D7AA0650dE1009710FDd45C3468d75AE1392"; + const WSOL_ADDR = "0xd31a59c85ae9d8edefec411d448f90841571b89c"; + const UNI_V3_FACTORY_ADDR = "0x1F98431c8aD98523631AE4a59f267346ea31F984"; + + const provider = new ethers.JsonRpcProvider(process.env.PROVIDER_URI); + + const computeQuery: AxiomV2ComputeQuery = { + k: 13, + resultLen: 1, + vkey: [ + "0x4caffbbdc5d29b00b3e97df7fb169baadaff9443ea3ecfd62231541d2752e003", + "0xc04b25057d0bddf35d4542077516abb76445b8e745a457e3ccc1bf9aac2ba406", + "0x6f4cebf257ebe7a319dd5dedcd41085d35b11afe7254a55d5f33366084983a61", + "0xce36e621969a1e33547280e28d8158537284eb5b5d284ede4dc81d1e69ef2e28", + "0x0000000000000000000000000000000000000000000000000000000000000080", + "0x0000000000000000000000000000000000000000000000000000000000000080", + "0x0000000000000000000000000000000000000000000000000000000000000080", + "0xceb30489e39186b75336db29c5e0ce27e0c7480fc5a8ee071fc8642283700e42", + "0x4570a761b654d0422dba9042e1c2130284cca09e659d46b69739c99697ff4068", + "0x22e4c62aacfc240ed0553bfad00122ba8c7627c870c739f3f818584e066a8b1f", + "0x841485e0a9f109688bdc4f5ff851d9e2e44833ae573456742c1237322e938542", + "0x79a62f1cc2f1440cc9fdcd534b612a49da4b6139bbed8cf53a26f4568ac3f567", + "0x63bf6c5c2a2c6a568d6399d6658a320511dda5caf1dc5a84af03472a552ee510", + "0x1f3d22024e669b91ee856e925fcbe0b6da642b57b348823bf7ac26266b3e695d", + ], + computeProof: + "0x00000000000000000000000000000000000000000000000000000000000000960000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ca0d58f038fa1dea93aac4ae41d157f0894c4d857468a9da2d8999721f5691209442ccfd19f64af56d033662e58c382db23a6693a591a22e2706a9a7527c1f041e4ca2d69d9aec9cd4203ce4cf181dda917e93db04afd78953f872112797c710b38aa8b8c774c4f56bf471ac233b27f87791647e18d70be18f28570a4c948548a137f0d62b925e4f0f0c8b2c8de36c2c1c54b63061619cb391dc117d72dcea16ec2f0173413814f94fd7ab61bf134aab9cf7bf453d246d6a25746576377e8806eccf2692cab5ffd4d443e9ac325a479dcd51b72b9123f39a7ac77d94333469629987d1f0209effc6d3f71b9ed1622bc1e6fc68c575725eaf2bca1ae3674ee44ca652f57b0da21ecb9413d083cdeabe8e52d255177621112c3b3a22daf8eec7074c6e4ec115313e94a935e632ac5226a232abfb0910b3e5ff8a6ea58855028948d093f98691bac135ab827597dd3291bd7372298c4cc028af1b710972776f106637331c92b893f3db7a85c480f26a7083fe3052ec48c1360b42929ef950e643279fbb17dbef72b8e87321b8e8b911383a0913ecd1789960428aafd24d7939d45148e89f457178c188b065cf233f69a26d0195e8e9853e973fdfd3015612bae12b0f18ffa2e18550a7195beff3d684841ecf3cb869ba9668fda32514d83fcc801bbd72d06f730773bae66310f62c6eac2f58d6a88826adb520ef0c9b87ee7c371c40b6f73f27226ab90f0594860c30d892d4082925d83d8a7cfe885b743e49481a1b685dcefe3d8029e70d875b9b4902ac0a82895175881cd0a354090c0b1c9903465eb370ed07dbd3eba1367ec17095ea20278a6db3055f45b85be5862ceaa92b0cf0c3cb2f8f6df24a598f1b45c0f60a4308b44ce630c3e97c385aa664756500d6ea8cd7069d2b9fb8c0b389a9b325cca515a0e3a0498ca8ce67ef920358b12959761f8d863b39ee4e8036e816a110d1f4637f65c68d5ef3a9ba50f059aec10e39e9652b6594d85c86dd9b98889d7b854e5e3a4674cb54d66dff547409165f235637f037c8dc693649eebf8e6cede4474a92e3ac4091cc0eea855f0790ed8e06bffc7ddd79222f3423209826f6c99279f0f709a04a58de67d9ae12aeb1bc38261907ab51f8f4025cded6cfa1d54acccf85a39834721865723a9560dca880310a1444588fa6fa6cf1caa6d5282e0a401861cf4d7dbc60449086014e076f673c2f7eb23a6204f697d6209bca33b52453de1841c683390ac3f03eedcdfb1b92941f0c6c1e92c687955f343eec30f71cf78d8ff1ee4c38d44c19acd01e5fd910682391b066e657a08ef28362f40f918963b4228d657280688dafab61b4063c760d1ed8562c1b061850b49054f0816858a574bd79bb8d592423ea1d7f02b617b01e06327e6c6f120c69866bf81203ec2ebb274e118b44e87fe2e30dd77882de784b11243f41f5200ede478cb14c5c24c117fa987e149ccb67b7a7f758e26250158c20c515702aa9c28af2ea51cc9e135d6d635b3ddc259d5f5713a5615333f277a805b452afe6ec4205b927793ab473fc3fa40631d9d9cf365067a4c78906b7119b19e66f13936c69f4db1db9005b89187657772eae05d81530375d9def9fcff1450a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005ed4d210ce92739ea5af0066601fcc2a43a9ae8ccc8a49f1008940b5066c2326f419c6da9fbd9481ca099e405aa18403a4188d21832ee58a39975d6a9a49ea1bba8d1de4811547f6e3aa1d684c0c0cd57443729dbcf201ac20704a553d0b6b20a9cdb94058c8deb216792b9ef0ca51a26c54ca23e460b2b191ce6af8784bff2f90fc0a4ec281dd95beee516d3e15a04fb873038b949c44db2fb0ee943f6bfa1d4f2ff763d865adf55a29b37bee0f6ad8754fde6999125b6a779056d4bdf95b13ac41d86d841adec49bf27a7414b88074f27a975ee36d5f647f7dcbcc580df20e4d7e040bbb2c6c2a6dc5f18737259dee588657cbbe225ebd66fac66ca3386d16a9bef9c4664733a2619a50be2ac5a8f4ce7f272b4686526681415e79ff3baf0881d52948b3fc7d0b5d413d44a1cb985d4557ff651042fd2c8180fe9528b9cb1f400da2686d602ebbe2e24d6d6b0c9e12d6ba41c1db556ee1ecce44fe8513e0104353210ebba3f83cfd38b84509c47245cfa4544189949997fe36e96fcb68b10495d6632a553da9f1f1dec8251018793d44e30a30bf874fc56abeb9facdd04a25a1bd9fe412949086db288d3326b80b48e4d85ec44de11a8767032c1569c472141f44f80531c0becccbf5791f65ef4d21a6529a908b7e5386f5c9169d20082813684ee79e7ce7ddc0497301321f5fbda44ecaac3c157cf00c28d432411528f405c8ee72147fcd0ab094b58914163c875cca43bd1724ee1b448137e5afbe38bf24be5c46aa67200f1e19a9cd4c9abfa91af60f54751220c189206d64c314fe1622d827025d39024eb329090c2b496490306a52f721bb8e41f41266262b899c420ea10ef2211821bbcbcc3ae427053b97d3a6a3d3133893f373adab42c8d8e20a0beb5d12246bc590c4424fddcc8511c594fdcfa23fa55ed2a89af28947fc9e5f1f081992a5f470977f7c7e38ceaa69cc5d43ee604cd5bf6c4a5a861960f3c10e1c306c1e0999a0ac0b6e565e6bc205de0d807e7b3a686d03b559b040c0cd332518b1289a02a889400211e1e84f038faac5966e5d927f025c3ed0b0149644646f11d91d524604313e3382d86310325d000e462fb5705776ad3dd10ced1d3889f829370e0aa9669d80239514dad97bbfdd5bde7e5d74d341d45b9827cccf1ce57d0d", + }; + + test("should initialize with private key; build QueryV2 with dataQuery, computeQuery, and callback", async () => { + const config: QueryBuilderBaseConfig = { + providerUri: process.env.PROVIDER_URI_SEPOLIA as string, + version: "v2", + }; + + const dataQueryReq = [ + { + blockNumber: BLOCK_NUMBER, + fieldIdx: 0, + }, + { + blockNumber: BLOCK_NUMBER + 1, + fieldIdx: 1, + }, + { + blockNumber: BLOCK_NUMBER, + addr: WETH_WHALE, + fieldIdx: AccountField.Nonce, + }, + { + blockNumber: 17975259, + txIdx: 34, + // txHash: "0x47082a4eaba054312c652a21c6d75a44095b8be43c60bdaeffad03d38a8b1602", + fieldOrLogIdx: ReceiptField.CumulativeGas, + topicOrDataOrAddressIdx: 10, + eventSchema: ethers.ZeroHash, + }, + ]; + const computeQueryReq: AxiomV2ComputeQuery = { + k: 14, + vkey: computeQuery.vkey, + computeProof: computeQuery.computeProof, + }; + + const axiom = new QueryBuilderBase(config, dataQueryReq, computeQueryReq); + const unbiltDq = axiom.getDataQuery(); + expect((unbiltDq?.[2] as AccountSubquery).addr).toEqual(WETH_WHALE); + await axiom.buildBase(); + const builtQuery = axiom.getBuiltQueryBase(); + if (builtQuery === undefined) { + throw new Error("builtQuery is undefined"); + } + + const builtDq = builtQuery.dataQueryStruct.subqueries; + expect((builtDq?.[2].subqueryData as AccountSubquery).addr).toEqual(WETH_WHALE.toLowerCase()); + expect(builtQuery.queryHash).toEqual("0xf83d8c1a06ca57e6ac62998276ce1f4e091a28f93e8edcefb34682c30c34450c"); + expect(builtQuery.dataQueryHash).toEqual("0xa23b68c6445bf7850bfdb0921bef5c55d43bd6362133b1f3929dd7b8103502dd"); + expect(builtQuery.dataQuery).toEqual( + "0x00000000000000010004000100ed14f200000000000100ed14f300000001000200ed14f22e15d7aa0650de1009710fdd45c3468d75ae1392000000000005011247db0022000000020000000a0000000000000000000000000000000000000000000000000000000000000000", + ); + expect(builtQuery.computeQuery.k).toEqual(computeQueryReq.k); + expect(builtQuery.computeQuery.resultLen).toEqual(4); + expect(builtQuery.computeQuery.vkey.length).toEqual(computeQueryReq.vkey.length); + expect(builtQuery.computeQuery.vkey).toEqual( + resizeArray(computeQueryReq.vkey, computeQueryReq.vkey.length, ethers.ZeroHash), + ); + expect(builtQuery.computeQuery.computeProof).toEqual(computeQuery.computeProof); + }); + + test("should initialize without private key; build QueryV2 with dataQuery, computeQuery, and callback", async () => { + const config: QueryBuilderBaseConfig = { + providerUri: process.env.PROVIDER_URI_SEPOLIA as string, + version: "v2", + }; + + const dataQueryReq = [ + { + blockNumber: BLOCK_NUMBER, + fieldIdx: 0, + }, + { + blockNumber: BLOCK_NUMBER + 1, + fieldIdx: 1, + }, + { + blockNumber: BLOCK_NUMBER, + addr: WETH_WHALE, + fieldIdx: AccountField.Nonce, + }, + { + blockNumber: 17975259, + txIdx: 34, + // txHash: "0x47082a4eaba054312c652a21c6d75a44095b8be43c60bdaeffad03d38a8b1602", + fieldOrLogIdx: ReceiptField.CumulativeGas, + topicOrDataOrAddressIdx: 10, + eventSchema: ethers.ZeroHash, + }, + ]; + const computeQueryReq: AxiomV2ComputeQuery = { + k: 14, + vkey: computeQuery.vkey, + computeProof: computeQuery.computeProof, + }; + + const axiom = new QueryBuilderBase(config, dataQueryReq, computeQueryReq); + const unbiltDq = axiom.getDataQuery(); + expect((unbiltDq?.[2] as AccountSubquery).addr).toEqual(WETH_WHALE); + await axiom.buildBase(); + const builtQuery = axiom.getBuiltQueryBase(); + if (builtQuery === undefined) { + throw new Error("builtQuery is undefined"); + } + + const builtDq = builtQuery.dataQueryStruct.subqueries; + expect((builtDq?.[2].subqueryData as AccountSubquery).addr).toEqual(WETH_WHALE.toLowerCase()); + expect(builtQuery.queryHash).toEqual("0xf83d8c1a06ca57e6ac62998276ce1f4e091a28f93e8edcefb34682c30c34450c"); + expect(builtQuery.dataQueryHash).toEqual("0xa23b68c6445bf7850bfdb0921bef5c55d43bd6362133b1f3929dd7b8103502dd"); + expect(builtQuery.dataQuery).toEqual( + "0x00000000000000010004000100ed14f200000000000100ed14f300000001000200ed14f22e15d7aa0650de1009710fdd45c3468d75ae1392000000000005011247db0022000000020000000a0000000000000000000000000000000000000000000000000000000000000000", + ); + expect(builtQuery.computeQuery.k).toEqual(computeQueryReq.k); + expect(builtQuery.computeQuery.resultLen).toEqual(4); + expect(builtQuery.computeQuery.vkey.length).toEqual(computeQueryReq.vkey.length); + expect(builtQuery.computeQuery.vkey).toEqual( + resizeArray(computeQueryReq.vkey, computeQueryReq.vkey.length, ethers.ZeroHash), + ); + expect(builtQuery.computeQuery.computeProof).toEqual(computeQuery.computeProof); + }); +}); diff --git a/circuit/test/unit/queryBuilderBase/buildComputeQueryStandalone.test.ts b/circuit/test/unit/queryBuilderBase/buildComputeQueryStandalone.test.ts new file mode 100644 index 00000000..5ef6e314 --- /dev/null +++ b/circuit/test/unit/queryBuilderBase/buildComputeQueryStandalone.test.ts @@ -0,0 +1,157 @@ +import { bytes32 } from "@axiom-crypto/tools"; +import { QueryBuilderBase, QueryBuilderBaseConfig, AxiomV2Callback, AxiomV2ComputeQuery } from "../../../src"; + +// Test coverage areas: +// - ComputeQuery +// - Callback + +describe("Build ComputeQuery Standalone", () => { + const config: QueryBuilderBaseConfig = { + providerUri: process.env.PROVIDER_URI_SEPOLIA as string, + sourceChainId: 1, + version: "v2", + }; + const axiom = new QueryBuilderBase(config); + + test("simple computeQuery w/ no data subqueries", async () => { + /** Code + // x^2 + y + const x_2 = mul(x, x); + const val = add(x_2, y); + addToCallback(val) + */ + + /** Inputs + { + "x": 10, + "y": 50 + } + */ + + const computeQuery: AxiomV2ComputeQuery = { + k: 13, + resultLen: 1, + vkey: [ + "0x4caffbbdc5d29b00b3e97df7fb169baadaff9443ea3ecfd62231541d2752e003", + "0xc04b25057d0bddf35d4542077516abb76445b8e745a457e3ccc1bf9aac2ba406", + "0x6f4cebf257ebe7a319dd5dedcd41085d35b11afe7254a55d5f33366084983a61", + "0xce36e621969a1e33547280e28d8158537284eb5b5d284ede4dc81d1e69ef2e28", + "0x0000000000000000000000000000000000000000000000000000000000000080", + "0x0000000000000000000000000000000000000000000000000000000000000080", + "0x0000000000000000000000000000000000000000000000000000000000000080", + "0xceb30489e39186b75336db29c5e0ce27e0c7480fc5a8ee071fc8642283700e42", + "0x4570a761b654d0422dba9042e1c2130284cca09e659d46b69739c99697ff4068", + "0x22e4c62aacfc240ed0553bfad00122ba8c7627c870c739f3f818584e066a8b1f", + "0x841485e0a9f109688bdc4f5ff851d9e2e44833ae573456742c1237322e938542", + "0x79a62f1cc2f1440cc9fdcd534b612a49da4b6139bbed8cf53a26f4568ac3f567", + "0x63bf6c5c2a2c6a568d6399d6658a320511dda5caf1dc5a84af03472a552ee510", + "0x1f3d22024e669b91ee856e925fcbe0b6da642b57b348823bf7ac26266b3e695d", + ], + computeProof: + "0x00000000000000000000000000000000000000000000000000000000000000960000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ca0d58f038fa1dea93aac4ae41d157f0894c4d857468a9da2d8999721f5691209442ccfd19f64af56d033662e58c382db23a6693a591a22e2706a9a7527c1f041e4ca2d69d9aec9cd4203ce4cf181dda917e93db04afd78953f872112797c710b38aa8b8c774c4f56bf471ac233b27f87791647e18d70be18f28570a4c948548a137f0d62b925e4f0f0c8b2c8de36c2c1c54b63061619cb391dc117d72dcea16ec2f0173413814f94fd7ab61bf134aab9cf7bf453d246d6a25746576377e8806eccf2692cab5ffd4d443e9ac325a479dcd51b72b9123f39a7ac77d94333469629987d1f0209effc6d3f71b9ed1622bc1e6fc68c575725eaf2bca1ae3674ee44ca652f57b0da21ecb9413d083cdeabe8e52d255177621112c3b3a22daf8eec7074c6e4ec115313e94a935e632ac5226a232abfb0910b3e5ff8a6ea58855028948d093f98691bac135ab827597dd3291bd7372298c4cc028af1b710972776f106637331c92b893f3db7a85c480f26a7083fe3052ec48c1360b42929ef950e643279fbb17dbef72b8e87321b8e8b911383a0913ecd1789960428aafd24d7939d45148e89f457178c188b065cf233f69a26d0195e8e9853e973fdfd3015612bae12b0f18ffa2e18550a7195beff3d684841ecf3cb869ba9668fda32514d83fcc801bbd72d06f730773bae66310f62c6eac2f58d6a88826adb520ef0c9b87ee7c371c40b6f73f27226ab90f0594860c30d892d4082925d83d8a7cfe885b743e49481a1b685dcefe3d8029e70d875b9b4902ac0a82895175881cd0a354090c0b1c9903465eb370ed07dbd3eba1367ec17095ea20278a6db3055f45b85be5862ceaa92b0cf0c3cb2f8f6df24a598f1b45c0f60a4308b44ce630c3e97c385aa664756500d6ea8cd7069d2b9fb8c0b389a9b325cca515a0e3a0498ca8ce67ef920358b12959761f8d863b39ee4e8036e816a110d1f4637f65c68d5ef3a9ba50f059aec10e39e9652b6594d85c86dd9b98889d7b854e5e3a4674cb54d66dff547409165f235637f037c8dc693649eebf8e6cede4474a92e3ac4091cc0eea855f0790ed8e06bffc7ddd79222f3423209826f6c99279f0f709a04a58de67d9ae12aeb1bc38261907ab51f8f4025cded6cfa1d54acccf85a39834721865723a9560dca880310a1444588fa6fa6cf1caa6d5282e0a401861cf4d7dbc60449086014e076f673c2f7eb23a6204f697d6209bca33b52453de1841c683390ac3f03eedcdfb1b92941f0c6c1e92c687955f343eec30f71cf78d8ff1ee4c38d44c19acd01e5fd910682391b066e657a08ef28362f40f918963b4228d657280688dafab61b4063c760d1ed8562c1b061850b49054f0816858a574bd79bb8d592423ea1d7f02b617b01e06327e6c6f120c69866bf81203ec2ebb274e118b44e87fe2e30dd77882de784b11243f41f5200ede478cb14c5c24c117fa987e149ccb67b7a7f758e26250158c20c515702aa9c28af2ea51cc9e135d6d635b3ddc259d5f5713a5615333f277a805b452afe6ec4205b927793ab473fc3fa40631d9d9cf365067a4c78906b7119b19e66f13936c69f4db1db9005b89187657772eae05d81530375d9def9fcff1450a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005ed4d210ce92739ea5af0066601fcc2a43a9ae8ccc8a49f1008940b5066c2326f419c6da9fbd9481ca099e405aa18403a4188d21832ee58a39975d6a9a49ea1bba8d1de4811547f6e3aa1d684c0c0cd57443729dbcf201ac20704a553d0b6b20a9cdb94058c8deb216792b9ef0ca51a26c54ca23e460b2b191ce6af8784bff2f90fc0a4ec281dd95beee516d3e15a04fb873038b949c44db2fb0ee943f6bfa1d4f2ff763d865adf55a29b37bee0f6ad8754fde6999125b6a779056d4bdf95b13ac41d86d841adec49bf27a7414b88074f27a975ee36d5f647f7dcbcc580df20e4d7e040bbb2c6c2a6dc5f18737259dee588657cbbe225ebd66fac66ca3386d16a9bef9c4664733a2619a50be2ac5a8f4ce7f272b4686526681415e79ff3baf0881d52948b3fc7d0b5d413d44a1cb985d4557ff651042fd2c8180fe9528b9cb1f400da2686d602ebbe2e24d6d6b0c9e12d6ba41c1db556ee1ecce44fe8513e0104353210ebba3f83cfd38b84509c47245cfa4544189949997fe36e96fcb68b10495d6632a553da9f1f1dec8251018793d44e30a30bf874fc56abeb9facdd04a25a1bd9fe412949086db288d3326b80b48e4d85ec44de11a8767032c1569c472141f44f80531c0becccbf5791f65ef4d21a6529a908b7e5386f5c9169d20082813684ee79e7ce7ddc0497301321f5fbda44ecaac3c157cf00c28d432411528f405c8ee72147fcd0ab094b58914163c875cca43bd1724ee1b448137e5afbe38bf24be5c46aa67200f1e19a9cd4c9abfa91af60f54751220c189206d64c314fe1622d827025d39024eb329090c2b496490306a52f721bb8e41f41266262b899c420ea10ef2211821bbcbcc3ae427053b97d3a6a3d3133893f373adab42c8d8e20a0beb5d12246bc590c4424fddcc8511c594fdcfa23fa55ed2a89af28947fc9e5f1f081992a5f470977f7c7e38ceaa69cc5d43ee604cd5bf6c4a5a861960f3c10e1c306c1e0999a0ac0b6e565e6bc205de0d807e7b3a686d03b559b040c0cd332518b1289a02a889400211e1e84f038faac5966e5d927f025c3ed0b0149644646f11d91d524604313e3382d86310325d000e462fb5705776ad3dd10ced1d3889f829370e0aa9669d80239514dad97bbfdd5bde7e5d74d341d45b9827cccf1ce57d0d", + }; + + axiom.setComputeQuery(computeQuery); + const builtQuery = await axiom.buildBase(); + + expect(builtQuery.computeQuery).toEqual(computeQuery); + expect(builtQuery.dataQueryStruct.subqueries).toEqual([]); + }); + + test("larger computeQuery w/ no data subqueries", async () => { + /** Code + let xRes = []; + for (let i = 0; i < x.length; i++) { + // x^2 + y + const x_2 = mul(x[i], x[i]); + const val = add(x_2, y[i]); + xRes.push(val); + } + + let yRes = []; + for (let i = 0; i < y.length; i++) { + // x^2 + y + const y_2 = mul(y[i], y[i]); + const val = add(y_2, x[i]); + yRes.push(val); + } + + let zRes = []; + for (let i = 0; i < xRes.length; i++) { + const val = mul(xRes[i], yRes[i]); + zRes.push(val); + } + + let aRes = []; + for (let i = 0; i < xRes.length; i++) { + for (let j = 0; j < yRes.length; j++) { + const val = mul(xRes[i], yRes[j]); + aRes.push(val); + } + } + + let bRes = []; + for (let i = 0; i < yRes.length; i++) { + for (let j = 0; j < zRes.length; j++) { + const val = mul(yRes[i], zRes[j]); + bRes.push(val); + } + } + + let cRes = []; + for (let i = 0; i < zRes.length; i++) { + for (let j = 0; j < xRes.length; j++) { + const val = mul(zRes[i], xRes[j]); + cRes.push(val); + } + } + + for (let i = 0; i < xRes.length; i++) { + addToCallback(xRes[i]); + addToCallback(yRes[i]); + addToCallback(zRes[i]); + } + + for (let i = 0; i < aRes.length; i++) { + const val = mul(cRes[i], mul(aRes[i], bRes[i])); + addToCallback(val); + } + */ + + /** Inputs + { + "x": [100,50,200,150,80,95,25,88,12,50,11,20,55,18,955,36,29,603,90,111], + "y": [81,22,56,69,28,182,20,205,53,27,291,53,59,22,8,225,37,50,22,409] + } + */ + + const computeQuery: AxiomV2ComputeQuery = { + k: 17, + resultLen: 460, + vkey: [ + "0x4fb009623c05d071d1f861650caaa7ef20492c0c7816cfd73c6cdf703c3f9d26", + "0xb012831066d07bd7d9f6608f0e23570b685c7dfa17fafb06b216323744507d14", + "0x50faea8b89c783476fd04fa8f2958431e7902b0d911a7707bd707788e606350a", + "0x40aadbc2a6969d7d55238faed83dcdf4c16ae697131b7914ef9303acc989db4e", + "0x1e8c635254dae9dbd20eef96091b80183cfdfde5d9f2f0e6ca687b92dc8c6650", + "0x0000000000000000000000000000000000000000000000000000000000000080", + "0x0000000000000000000000000000000000000000000000000000000000000080", + "0x60139889d20c870c56f884f94595e7762f381a3121a3b8839e0ca6f2a1409e2d", + "0x735e2d6960f9b371dcd1b562fbc0eef28b39b7d5f630f586c1385ee34181751c", + "0xa7eea4d784430d7dec810c2062dac7e8d06ab804d2fa7752ada4128347f2ca21", + "0x841485e0a9f109688bdc4f5ff851d9e2e44833ae573456742c1237322e938542", + "0x79a62f1cc2f1440cc9fdcd534b612a49da4b6139bbed8cf53a26f4568ac3f567", + "0xa3cb75bfc1d0e3967b4dc886d4f922592b017985de19a40c2a19ba325de3b051", + "0x893b88c0c70acbfe7789b9cfed86018b99bb63a64d6cc8df1f7993bba51aa013", + ], + computeProof: + "0x00000000000000000000000000000000000000000000000000000000000027610000000000000000000000000000000000000000000000000000000000001a050000000000000000000000000000000000000000000000000000000004009ee500000000000000000000000000000000000000000000000000000000000009da00000000000000000000000000000000000000000000000000000000000002160000000000000000000000000000000000000000000000000000000000148cbc0000000000000000000000000000000000000000000000000000000000009c780000000000000000000000000000000000000000000000000000000000000d080000000000000000000000000000000000000000000000000000000007f6fbc00000000000000000000000000000000000000000000000000000000000005829000000000000000000000000000000000000000000000000000000000000132f00000000000000000000000000000000000000000000000000000000069b3a87000000000000000000000000000000000000000000000000000000000000191c0000000000000000000000000000000000000000000000000000000000000360000000000000000000000000000000000000000000000000000000000054be8000000000000000000000000000000000000000000000000000000000000023f700000000000000000000000000000000000000000000000000000000000081c300000000000000000000000000000000000000000000000000000000123adc25000000000000000000000000000000000000000000000000000000000000028500000000000000000000000000000000000000000000000000000000000001a90000000000000000000000000000000000000000000000000000000000042ecd0000000000000000000000000000000000000000000000000000000000001f0d000000000000000000000000000000000000000000000000000000000000a4810000000000000000000000000000000000000000000000000000000013f3f98d00000000000000000000000000000000000000000000000000000000000000c50000000000000000000000000000000000000000000000000000000000000b050000000000000000000000000000000000000000000000000000000000087ad900000000000000000000000000000000000000000000000000000000000009df000000000000000000000000000000000000000000000000000000000000030b00000000000000000000000000000000000000000000000000000000001e0995000000000000000000000000000000000000000000000000000000000000019c0000000000000000000000000000000000000000000000000000000000014ad40000000000000000000000000000000000000000000000000000000002146d3000000000000000000000000000000000000000000000000000000000000001c50000000000000000000000000000000000000000000000000000000000000b0d0000000000000000000000000000000000000000000000000000000000138e010000000000000000000000000000000000000000000000000000000000000c0c0000000000000000000000000000000000000000000000000000000000000dd00000000000000000000000000000000000000000000000000000000000a665c0000000000000000000000000000000000000000000000000000000000000015a00000000000000000000000000000000000000000000000000000000000001f6000000000000000000000000000000000000000000000000000000000002a67c00000000000000000000000000000000000000000000000000000000000deaa100000000000000000000000000000000000000000000000000000000000003fb000000000000000000000000000000000000000000000000000000003764eedb00000000000000000000000000000000000000000000000000000000000005f1000000000000000000000000000000000000000000000000000000000000c5e5000000000000000000000000000000000000000000000000000000000497c595000000000000000000000000000000000000000000000000000000000000036e0000000000000000000000000000000000000000000000000000000000000576000000000000000000000000000000000000000000000000000000000012bab40000000000000000000000000000000000000000000000000000000000058c8b0000000000000000000000000000000000000000000000000000000000000c1f00000000000000000000000000000000000000000000000000000000434288d50000000000000000000000000000000000000000000000000000000000001fba000000000000000000000000000000000000000000000000000000000000023e000000000000000000000000000000000000000000000000000000000047230c00000000000000000000000000000000000000000000000000000000000031ba0000000000000000000000000000000000000000000000000000000000028de0000000000000000000000000000000000000000000000000000000007f02f4c000000000000000000000000000000000000001009f09ffa0e1b24c5f4a9a27f100000000000000000000000000000000000000001a6cdd64627d1d373ed9279000000000000000000000000000000000000003f83bec7513df02f2824f4f900000000000000000000000000000000000000002bb26ab3b3b03e06b77cd729c890000000000000000000000000000000000000001c16472b375aa21f95ba8400000000000000000000000000000000000000014cbba8691da1250ebe4d8a9187100000000000000000000000000000000000000000118464bd4cee018f7d42ac100000000000000000000000000000000000018e9b2607148e5b90426a9d7c6410000000000000000000000000000000000000000047fed63144e0e9c95c997490000000000000000000000000000000000000000387575e9c9453512aa9da4d100000000000000000000000000000000000000454adbf8ad230536b679668100000000000000000000000000000000000000000017ed99fdecdeb895fd0a34d90000000000000000000000000000000000000006c49b0ccc2c2e27a6e45690000000000000000000000000000000000000000000007086346017a7c03e8eb990000000000000000000000000000000000000c003f016413f9d8b06a3643e9a710000000000000000000000000000000000000151eb3bbbc104952fdfd430bcd1000000000000000000000000000000000000000015f365f9291ed362aab9d8100000000000000000000000000000000000011b1614a4825cf741e0874a59c15100000000000000000000000000000000000000013ca9865be4febddcc3050210000000000000000000000000000000000003f177ec9a2635c9b32b8d7748100000000000000000000000000000000000000000001a6cdd64627d1d373ed9279000000000000000000000000000000000000000000002b89a80c52a53b6a94100000000000000000000000000000000000000000068a53b6fa7209c6c9fc10000000000000000000000000000000000000000000047fe8472b13a3979b6fb3d100000000000000000000000000000000000000000002e468f0905cf6e7aa40000000000000000000000000000000000000000000224344e7d31bb1dd2db186f90000000000000000000000000000000000000000000001cdc65ba717db0f9bc90000000000000000000000000000000000000000290bc41fcab4625613b69349000000000000000000000000000000000000000000000769e477917ffa40c491000000000000000000000000000000000000000000005d053bce4095e2009659000000000000000000000000000000000000000000722a30e3cbb25b3bf5890000000000000000000000000000000000000000000000276c6b4345e5dd407ea10000000000000000000000000000000000000000000b269b4786e3fe043b10000000000000000000000000000000000000000000000000b964874fab0ab2b61000000000000000000000000000000000000000013c5c57ee1840b4010a2918f90000000000000000000000000000000000000000022cbf97ef897f74d5b46e5900000000000000000000000000000000000000000000242a68a0475270ce48900000000000000000000000000000000000000001d26842aeefff33a3937f16d90000000000000000000000000000000000000000000209b9f16b1de33e60c29000000000000000000000000000000000000000067f2e1b650f261c8847389000000000000000000000000000000000000000003f83bec7513df02f2824f4f9000000000000000000000000000000000000000000068a53b6fa7209c6c9fc100000000000000000000000000000000000000000fb8579753948bbcacd6410000000000000000000000000000000000000000000ad0ad179f8362e950e4f52510000000000000000000000000000000000000000006f39e43a72ba0e4e4a4000000000000000000000000000000000000000000525a412981d09e922a8c6297900000000000000000000000000000000000000000000455e7122b57a24a4864900000000000000000000000000000000000000062a806972f8184e73492c3dc9000000000000000000000000000000000000000000011d1b1d54e44b256943110000000000000000000000000000000000000000000df947d3add0f5645728d9000000000000000000000000000000000000000011266d8ac2367866c440090000000000000000000000000000000000000000000005ec1b70025f9f8a1f6521000000000000000000000000000000000000000001acd366a17841ead1231000000000000000000000000000000000000000000000001bd9a2297c25708f1e10000000000000000000000000000000000000002f8642f2ffc001dd2bcf12bb79000000000000000000000000000000000000000053a2d57f9d7b6628c08700d9000000000000000000000000000000000000000000056ed1f6822f6cdd6af090000000000000000000000000000000000000004610974d52af48b476e700e9590000000000000000000000000000000000000000004e5ffe1e44c3c788366a9000000000000000000000000000000000000000f9d8cc77dedc3a8479fbe0900000000000000000000000000000000000000000002bb26ab3b3b03e06b77cd729c89000000000000000000000000000000000000000047fe8472b13a3979b6fb3d100000000000000000000000000000000000000ad0ad179f8362e950e4f52510000000000000000000000000000000000000000770ccd74dc66b1706b2c9ab0f610000000000000000000000000000000000000004c85887e1081f383fe8ee400000000000000000000000000000000000000038a837c2e661a95f5859c0931909000000000000000000000000000000000000000002fb97e5ca93d7b0c63ac2d900000000000000000000000000000000000043dfb2d0f9d4582fb0a4b4f1f25900000000000000000000000000000000000000000c425d7aa0f9e5b990360c21000000000000000000000000000000000000000099d1b0e98650962b2dc50e6900000000000000000000000000000000000000bcc89620e2ac24762a0018990000000000000000000000000000000000000000004130e0d6fa83629fc16fcf31000000000000000000000000000000000000001270648b0a64a40ca01cd410000000000000000000000000000000000000000000013290fc2bfd716756427f100000000000000000000000000000000000020b22c28c07cee7451521e758cb090000000000000000000000000000000000000398a464fb081fcf16a0f132666900000000000000000000000000000000000000003bcdc11e3a6f9794da1779900000000000000000000000000000000000030340e98d065c22ff180f8496d6e900000000000000000000000000000000000000035ebabf2698d5c2dbcb0a939000000000000000000000000000000000000abe3e59e667dc2548b2e6376990000000000000000000000000000000000000000001c16472b375aa21f95ba840000000000000000000000000000000000000000000002e468f0905cf6e7aa400000000000000000000000000000000000000000006f39e43a72ba0e4e4a40000000000000000000000000000000000000000000004c85887e1081f383fe8ee400000000000000000000000000000000000000000000312f89a9eb81fe51000000000000000000000000000000000000000000000246adb41e27e7235068dc8400000000000000000000000000000000000000000000001ead05976a7e28c1c4000000000000000000000000000000000000000002ba08de207ef212a4d0cfc400000000000000000000000000000000000000000000007e13e233f2751709e400000000000000000000000000000000000000000000062debec7ef06dbe96040000000000000000000000000000000000000000000795819a3cd4d03100c40000000000000000000000000000000000000000000000029e716752e41cf90c2400000000000000000000000000000000000000000000bda1ed6a69b311a6400000000000000000000000000000000000000000000000000c50d1ddbde657724000000000000000000000000000000000000000001504159f040430391eec648400000000000000000000000000000000000000000024fc28a1ebfa6e68ecf6040000000000000000000000000000000000000000000002670a14f15006d1cc4000000000000000000000000000000000000000001efbcd40688819c2c02f68040000000000000000000000000000000000000000000022a8913f5306be59f44000000000000000000000000000000000000000006e7c534970a631d87b8c400000000000000000000000000000000000000000014cbba8691da1250ebe4d8a91871000000000000000000000000000000000000000224344e7d31bb1dd2db186f90000000000000000000000000000000000000525a412981d09e922a8c6297900000000000000000000000000000000000000038a837c2e661a95f5859c093190900000000000000000000000000000000000000246adb41e27e7235068dc84000000000000000000000000000000000000001af6b41e89d746121593a7fec48f1000000000000000000000000000000000000000016b66daff15d08fba7d6034100000000000000000000000000000000000204d452d077dfbd8c076b938b5ec100000000000000000000000000000000000000005d59463333e05456777173c900000000000000000000000000000000000000049343d8e6c39ace452ab40551000000000000000000000000000000000000059d80fd69dbbdd9ca0c9b1f01000000000000000000000000000000000000000001f0667d1dc15cd90359fc5959000000000000000000000000000000000000008c67b8731c6761d084c31e90000000000000000000000000000000000000000000091e5e47f776cd62b607019000000000000000000000000000000000000f8f7314dbf8fbe44e99d0af32caf10000000000000000000000000000000000001b62494c40f792dbc05341131d510000000000000000000000000000000000000001c76110a35317ca031b0d6010000000000000000000000000000000000016f0c1f43cba6b9b8ca596beda61d10000000000000000000000000000000000000019a94e7e05b9bc9bbaa89d8a10000000000000000000000000000000000051cde604a58d445463cb0902d0100000000000000000000000000000000000000000000118464bd4cee018f7d42ac1000000000000000000000000000000000000000000001cdc65ba717db0f9bc9000000000000000000000000000000000000000000455e7122b57a24a48649000000000000000000000000000000000000000000002fb97e5ca93d7b0c63ac2d900000000000000000000000000000000000000000001ead05976a7e28c1c4000000000000000000000000000000000000000000016b66daff15d08fba7d603410000000000000000000000000000000000000000000001321bae095883e5a69100000000000000000000000000000000000000001b358b1002ee2fc9827c1a110000000000000000000000000000000000000000000004ea1a5cfc777062b999000000000000000000000000000000000000000000003da9ab05884d33803da10000000000000000000000000000000000000000004bade3a19ba70f2fae5100000000000000000000000000000000000000000000001a2236375dedb75dcc2900000000000000000000000000000000000000000007644dc369dc256c1b900000000000000000000000000000000000000000000000007ae556130a09a3ee900000000000000000000000000000000000000000d1b6bfdac4c4e6e7ba6325410000000000000000000000000000000000000000017110cbe7bf0e90757ed5a10000000000000000000000000000000000000000000017f959c87d29477955100000000000000000000000000000000000000001352dcef17f7730d306b702210000000000000000000000000000000000000000000159d983817a2fc0ac9f1000000000000000000000000000000000000000044e836de7c9b87c4eb1c5100000000000000000000000000000000000000018e9b2607148e5b90426a9d7c641000000000000000000000000000000000000000290bc41fcab4625613b69349000000000000000000000000000000000000062a806972f8184e73492c3dc900000000000000000000000000000000000000043dfb2d0f9d4582fb0a4b4f1f259000000000000000000000000000000000000002ba08de207ef212a4d0cfc400000000000000000000000000000000000000204d452d077dfbd8c076b938b5ec100000000000000000000000000000000000000001b358b1002ee2fc9827c1a110000000000000000000000000000000000026b26236682233ff1d56cca0acd9100000000000000000000000000000000000000006fd459bc3c978ab15643891900000000000000000000000000000000000000057b259a05933db541b2aee92100000000000000000000000000000000000006ba18316420c5e47eefa341d100000000000000000000000000000000000000000252acec8e43d21763f9ab13a900000000000000000000000000000000000000a833b2e46f5a1f33693013900000000000000000000000000000000000000000000aec8423175133bede326690000000000000000000000000000000000012a4134056f7d67970911432ff80c100000000000000000000000000000000000020ce26d5b5339aedcce05b01812100000000000000000000000000000000000000022188799b73e23d68d5ba8d1000000000000000000000000000000000001b7b6b8da0e66fc9a536bc01716da1000000000000000000000000000000000000001ebdde68900525c63c9020d710000000000000000000000000000000000061ffe1f548512c98e3c11efafd10000000000000000000000000000000000000000000047fed63144e0e9c95c9974900000000000000000000000000000000000000000000769e477917ffa40c4910000000000000000000000000000000000000000011d1b1d54e44b2569431100000000000000000000000000000000000000000000c425d7aa0f9e5b990360c2100000000000000000000000000000000000000000007e13e233f2751709e400000000000000000000000000000000000000000005d59463333e05456777173c90000000000000000000000000000000000000000000004ea1a5cfc777062b99900000000000000000000000000000000000000006fd459bc3c978ab156438919000000000000000000000000000000000000000000001432cc2650eb552598e100000000000000000000000000000000000000000000fd6f05e38ff4079af129000000000000000000000000000000000000000001370a98678b023a235f5900000000000000000000000000000000000000000000006b68bd577ba8040ce7f10000000000000000000000000000000000000000001e615c18b0911b4b2010000000000000000000000000000000000000000000000001f919f26f7f51ad0b1000000000000000000000000000000000000000035dec4afd868734e8de24a5c9000000000000000000000000000000000000000005ecdba3775342387cea49290000000000000000000000000000000000000000000062887bb18238e57fe5900000000000000000000000000000000000000004f6b959110988670c625d19a9000000000000000000000000000000000000000000058d70c607e3ec578e7f900000000000000000000000000000000000000011b35331d9eb83ef0a53d590000000000000000000000000000000000000000000387575e9c9453512aa9da4d100000000000000000000000000000000000000000005d053bce4095e200965900000000000000000000000000000000000000000df947d3add0f5645728d9000000000000000000000000000000000000000000099d1b0e98650962b2dc50e6900000000000000000000000000000000000000000062debec7ef06dbe960400000000000000000000000000000000000000000049343d8e6c39ace452ab40551000000000000000000000000000000000000000000003da9ab05884d33803da100000000000000000000000000000000000000057b259a05933db541b2aee92100000000000000000000000000000000000000000000fd6f05e38ff4079af1290000000000000000000000000000000000000000000c6be1fdb7448c7ecb25b100000000000000000000000000000000000000000f3eb2b60050ece1c74161000000000000000000000000000000000000000000000543af0e01bb5385ef0cb90000000000000000000000000000000000000000017d3013f2ec1e3493b490000000000000000000000000000000000000000000000018c19b68012cde92b790000000000000000000000000000000000000002a3eb827fb6400918a666f475100000000000000000000000000000000000000004a58517689ecb8eb73033db100000000000000000000000000000000000000000004d4509a0c3b023ef98610000000000000000000000000000000000000003e4806d411f56b7b04754d323100000000000000000000000000000000000000000045ab18bc39c4e2ebed701000000000000000000000000000000000000000de176f4bd1d4c8f0ebd8f6100000000000000000000000000000000000000000454adbf8ad230536b67966810000000000000000000000000000000000000000000722a30e3cbb25b3bf589000000000000000000000000000000000000000011266d8ac2367866c440090000000000000000000000000000000000000000000bcc89620e2ac24762a001899000000000000000000000000000000000000000000795819a3cd4d03100c400000000000000000000000000000000000000000059d80fd69dbbdd9ca0c9b1f01000000000000000000000000000000000000000000004bade3a19ba70f2fae510000000000000000000000000000000000000006ba18316420c5e47eefa341d100000000000000000000000000000000000000000001370a98678b023a235f590000000000000000000000000000000000000000000f3eb2b60050ece1c74161000000000000000000000000000000000000000012b5d0d0319922459cc6110000000000000000000000000000000000000000000006760631030e7ec2d68de9000000000000000000000000000000000000000001d3d5cbf90d0af52df79000000000000000000000000000000000000000000000001e62336b6ca173f50a900000000000000000000000000000000000000033d90009dd387068e9e337c10100000000000000000000000000000000000000005b3e880e8b5f94a7e83fd96100000000000000000000000000000000000000000005ed570fd6f146bdeed110000000000000000000000000000000000000004c703e7e18d67782e1df72e5e100000000000000000000000000000000000000000055812bbf23f5c36e879b100000000000000000000000000000000000000110932cc7f47ef8f69e4b41100000000000000000000000000000000000000000000017ed99fdecdeb895fd0a34d90000000000000000000000000000000000000000000276c6b4345e5dd407ea1000000000000000000000000000000000000000005ec1b70025f9f8a1f652100000000000000000000000000000000000000000004130e0d6fa83629fc16fcf3100000000000000000000000000000000000000000029e716752e41cf90c240000000000000000000000000000000000000000001f0667d1dc15cd90359fc5959000000000000000000000000000000000000000000001a2236375dedb75dcc29000000000000000000000000000000000000000252acec8e43d21763f9ab13a9000000000000000000000000000000000000000000006b68bd577ba8040ce7f10000000000000000000000000000000000000000000543af0e01bb5385ef0cb9000000000000000000000000000000000000000006760631030e7ec2d68de900000000000000000000000000000000000000000000023b2b5be06c5930e63801000000000000000000000000000000000000000000a18da69ea2fe4a2b311000000000000000000000000000000000000000000000000a7df9fbc5e50636cc100000000000000000000000000000000000000011e7724517c9e9dbf70ad4ab5900000000000000000000000000000000000000001f823151444fa3428c8be4b9000000000000000000000000000000000000000000020bf82f6bc6e6a141ce90000000000000000000000000000000000000001a65539e067eebe6794a6c3d390000000000000000000000000000000000000000001d86ca9ffc2d02e9940890000000000000000000000000000000000000005e2037d20f6d45aa5944be90000000000000000000000000000000000000000006c49b0ccc2c2e27a6e4569000000000000000000000000000000000000000000000b269b4786e3fe043b10000000000000000000000000000000000000000001acd366a17841ead1231000000000000000000000000000000000000000000001270648b0a64a40ca01cd4100000000000000000000000000000000000000000000bda1ed6a69b311a64000000000000000000000000000000000000000000008c67b8731c6761d084c31e900000000000000000000000000000000000000000000007644dc369dc256c1b900000000000000000000000000000000000000000a833b2e46f5a1f3369301390000000000000000000000000000000000000000000001e615c18b0911b4b2010000000000000000000000000000000000000000000017d3013f2ec1e3493b490000000000000000000000000000000000000000001d3d5cbf90d0af52df7900000000000000000000000000000000000000000000000a18da69ea2fe4a2b31100000000000000000000000000000000000000000002db1df209c37cf8f2100000000000000000000000000000000000000000000000002f7b8282ed2ab73d100000000000000000000000000000000000000000510698c21fb8f9ebbf0fa3e90000000000000000000000000000000000000000008e97ecb97e18db9b7b93490000000000000000000000000000000000000000000009433f750f6b59e5e79000000000000000000000000000000000000000007774976e75ed07a5e626f3c900000000000000000000000000000000000000000000859fa85650a62639c1900000000000000000000000000000000000000001a9f88a2c758e5e7367d790000000000000000000000000000000000000000000000007086346017a7c03e8eb990000000000000000000000000000000000000000000000b964874fab0ab2b6100000000000000000000000000000000000000000001bd9a2297c25708f1e100000000000000000000000000000000000000000000013290fc2bfd716756427f1000000000000000000000000000000000000000000000c50d1ddbde65772400000000000000000000000000000000000000000000091e5e47f776cd62b607019000000000000000000000000000000000000000000000007ae556130a09a3ee9000000000000000000000000000000000000000000aec8423175133bede3266900000000000000000000000000000000000000000000001f919f26f7f51ad0b100000000000000000000000000000000000000000000018c19b68012cde92b7900000000000000000000000000000000000000000001e62336b6ca173f50a9000000000000000000000000000000000000000000000000a7df9fbc5e50636cc1000000000000000000000000000000000000000000002f7b8282ed2ab73d10000000000000000000000000000000000000000000000000031570d306ebf3181000000000000000000000000000000000000000000543213fe07e86e5451e42190000000000000000000000000000000000000000000942c03467e6fbae08037900000000000000000000000000000000000000000000009a003bf7feab41fa90000000000000000000000000000000000000000007c20f3315ebbb45a7a4bbf90000000000000000000000000000000000000000000008ad9e989787f307b49000000000000000000000000000000000000000001baa2ae7c7a0cece38ea90000000000000000000000000000000000000000c003f016413f9d8b06a3643e9a710000000000000000000000000000000000000013c5c57ee1840b4010a2918f90000000000000000000000000000000000002f8642f2ffc001dd2bcf12bb790000000000000000000000000000000000000020b22c28c07cee7451521e758cb0900000000000000000000000000000000000001504159f040430391eec648400000000000000000000000000000000000000f8f7314dbf8fbe44e99d0af32caf10000000000000000000000000000000000000000d1b6bfdac4c4e6e7ba632541000000000000000000000000000000000012a4134056f7d67970911432ff80c100000000000000000000000000000000000000035dec4afd868734e8de24a5c9000000000000000000000000000000000000002a3eb827fb6400918a666f475100000000000000000000000000000000000033d90009dd387068e9e337c101000000000000000000000000000000000000000011e7724517c9e9dbf70ad4ab590000000000000000000000000000000000000510698c21fb8f9ebbf0fa3e90000000000000000000000000000000000000000000543213fe07e86e5451e4219000000000000000000000000000000000008faca65909249b8f050b1a78bd4cf1000000000000000000000000000000000000fcd88b19efb5f16b1c0a79fe5f5100000000000000000000000000000000000000106caec662ee49e09581b780100000000000000000000000000000000000d3d152f28beb94979d3239081ea3d100000000000000000000000000000000000000ecf0d0e92323a6d14ff5dbaa100000000000000000000000000000000002f35439c37fd7907a10d7e08cf010000000000000000000000000000000000000000151eb3bbbc104952fdfd430bcd1000000000000000000000000000000000000000022cbf97ef897f74d5b46e590000000000000000000000000000000000000053a2d57f9d7b6628c08700d90000000000000000000000000000000000000000398a464fb081fcf16a0f132666900000000000000000000000000000000000000024fc28a1ebfa6e68ecf6040000000000000000000000000000000000000001b62494c40f792dbc05341131d510000000000000000000000000000000000000000017110cbe7bf0e90757ed5a100000000000000000000000000000000000020ce26d5b5339aedcce05b018121000000000000000000000000000000000000000005ecdba3775342387cea492900000000000000000000000000000000000000004a58517689ecb8eb73033db1000000000000000000000000000000000000005b3e880e8b5f94a7e83fd9610000000000000000000000000000000000000000001f823151444fa3428c8be4b90000000000000000000000000000000000000008e97ecb97e18db9b7b9349000000000000000000000000000000000000000000000942c03467e6fbae0803790000000000000000000000000000000000000fcd88b19efb5f16b1c0a79fe5f5100000000000000000000000000000000000001bcf8bb8d7bf3fa4c245d7b55b100000000000000000000000000000000000000001ce79fcd8a896ef7f103061000000000000000000000000000000000000174c49bd34c224da748cdf8714a310000000000000000000000000000000000000001a0fb17240c000740d6e6f0100000000000000000000000000000000000053144a58a8b6e88abc75862761000000000000000000000000000000000000000000015f365f9291ed362aab9d8100000000000000000000000000000000000000000000242a68a0475270ce48900000000000000000000000000000000000000000056ed1f6822f6cdd6af09000000000000000000000000000000000000000000003bcdc11e3a6f9794da1779900000000000000000000000000000000000000000002670a14f15006d1cc400000000000000000000000000000000000000000001c76110a35317ca031b0d60100000000000000000000000000000000000000000000017f959c87d294779551000000000000000000000000000000000000000022188799b73e23d68d5ba8d100000000000000000000000000000000000000000000062887bb18238e57fe59000000000000000000000000000000000000000000004d4509a0c3b023ef98610000000000000000000000000000000000000000005ed570fd6f146bdeed11000000000000000000000000000000000000000000000020bf82f6bc6e6a141ce900000000000000000000000000000000000000000009433f750f6b59e5e7900000000000000000000000000000000000000000000000009a003bf7feab41fa90000000000000000000000000000000000000000106caec662ee49e09581b7801000000000000000000000000000000000000000001ce79fcd8a896ef7f103061000000000000000000000000000000000000000000001e0ab8850b6d002141100000000000000000000000000000000000000001836eb5c08954bae0fa32bce100000000000000000000000000000000000000000001b162741f358321200b100000000000000000000000000000000000000005658f8b7382a966348db1100000000000000000000000000000000000000011b1614a4825cf741e0874a59c151000000000000000000000000000000000000001d26842aeefff33a3937f16d90000000000000000000000000000000000004610974d52af48b476e700e9590000000000000000000000000000000000000030340e98d065c22ff180f8496d6e900000000000000000000000000000000000001efbcd40688819c2c02f6804000000000000000000000000000000000000016f0c1f43cba6b9b8ca596beda61d10000000000000000000000000000000000000001352dcef17f7730d306b7022100000000000000000000000000000000001b7b6b8da0e66fc9a536bc01716da10000000000000000000000000000000000000004f6b959110988670c625d19a9000000000000000000000000000000000000003e4806d411f56b7b04754d32310000000000000000000000000000000000004c703e7e18d67782e1df72e5e100000000000000000000000000000000000000001a65539e067eebe6794a6c3d3900000000000000000000000000000000000007774976e75ed07a5e626f3c900000000000000000000000000000000000000000007c20f3315ebbb45a7a4bbf900000000000000000000000000000000000d3d152f28beb94979d3239081ea3d100000000000000000000000000000000000174c49bd34c224da748cdf8714a31000000000000000000000000000000000000001836eb5c08954bae0fa32bce1000000000000000000000000000000000013847d2bd088dfc9e14cb54c3ff7eb1000000000000000000000000000000000000015d51b43e3c7e4a39d4de1cb81000000000000000000000000000000000045992d6916be7746e260fce833e100000000000000000000000000000000000000000013ca9865be4febddcc3050210000000000000000000000000000000000000000000209b9f16b1de33e60c29000000000000000000000000000000000000000004e5ffe1e44c3c788366a9000000000000000000000000000000000000000000035ebabf2698d5c2dbcb0a93900000000000000000000000000000000000000000022a8913f5306be59f4400000000000000000000000000000000000000000019a94e7e05b9bc9bbaa89d8a100000000000000000000000000000000000000000000159d983817a2fc0ac9f10000000000000000000000000000000000000001ebdde68900525c63c9020d710000000000000000000000000000000000000000000058d70c607e3ec578e7f9000000000000000000000000000000000000000000045ab18bc39c4e2ebed7010000000000000000000000000000000000000000055812bbf23f5c36e879b10000000000000000000000000000000000000000000001d86ca9ffc2d02e994089000000000000000000000000000000000000000000859fa85650a62639c190000000000000000000000000000000000000000000000008ad9e989787f307b490000000000000000000000000000000000000000ecf0d0e92323a6d14ff5dbaa100000000000000000000000000000000000000001a0fb17240c000740d6e6f0100000000000000000000000000000000000000000001b162741f358321200b100000000000000000000000000000000000000015d51b43e3c7e4a39d4de1cb81000000000000000000000000000000000000000000186c03352b7fba57711510000000000000000000000000000000000000004dda6a6e042690361e327b10000000000000000000000000000000000000003f177ec9a2635c9b32b8d774810000000000000000000000000000000000000000067f2e1b650f261c8847389000000000000000000000000000000000000000f9d8cc77dedc3a8479fbe0900000000000000000000000000000000000000000abe3e59e667dc2548b2e63769900000000000000000000000000000000000000006e7c534970a631d87b8c4000000000000000000000000000000000000000051cde604a58d445463cb0902d0100000000000000000000000000000000000000000044e836de7c9b87c4eb1c51000000000000000000000000000000000000061ffe1f548512c98e3c11efafd10000000000000000000000000000000000000000011b35331d9eb83ef0a53d5900000000000000000000000000000000000000000de176f4bd1d4c8f0ebd8f6100000000000000000000000000000000000000110932cc7f47ef8f69e4b41100000000000000000000000000000000000000000005e2037d20f6d45aa5944be90000000000000000000000000000000000000001a9f88a2c758e5e7367d790000000000000000000000000000000000000000000001baa2ae7c7a0cece38ea900000000000000000000000000000000000002f35439c37fd7907a10d7e08cf010000000000000000000000000000000000000053144a58a8b6e88abc75862761000000000000000000000000000000000000000005658f8b7382a966348db11000000000000000000000000000000000000045992d6916be7746e260fce833e100000000000000000000000000000000000000004dda6a6e042690361e327b10000000000000000000000000000000000000f82efa1582490ec05c730a211000000e8ba6a007daa987a97ce9171fb2f5b8a467f18931e32dbfb40b46b3cf99cab139bfbecea62938825c72df967fcb556d61b18813506e2788d2695201a7763d327bd5829005aa0031f25a3a278b6956663bfca334ee68fa7c7a8b5b3f0de93eb631963d3efaafea8139f64c1077d8da85cf1f564eb076abf8bc8d5f3b7d406252723aad8b598a02877725d60e45b9f27a3c4521818b13ecf1d19849b1b17db9146e655613b1a392449d4a08fae0953015027df0b2370f9d33bd03d013b1cf9c66e049d2e2c562c2c030f83529929969728d5bb7467198f6a7114f0c1261524fa12bb6fa10e7584128afbf00a2460b5c5e24175bbdf43b476c0401ed61fa7cf5c0a4bdb6a6955662e688b5174d7de02952283263b53ac368063d1c3b350f3abb41d2363d06ecaff5e47becd019d2b093c886d0d679bd30acf52ae0283720a202444e8c88268e702a992ed1e7ac9ca5ecb8393ea4d863f906983f3607fa41aa6054a912ea544a10d6e547289e9e1fc3c29256fcbc5b29d2fb7bce2d9ef213a230f266595d60b24774138c45c09d7497c62698498a8824cee267c05c8ba32bc88615296970636ef9acb75df5d1bffcf65977ae124a5e64613373a6772e9f1bdcc6322b3393bb2e56d6268b25e561631a54a3837134ae86e89ea63fd068df4c7fe170b067ad2a6bc82442090ae11512d83f7a134b364df1e58a8065ad6e8db3f5177105927931e5a11115427e8df4a942402548771f172afb90cdbfcb763db52b33512c628b945e869841607589853045b79c0da8e794d2e9cd5959472fb9c13793815503e1133573c01f74fb8448bd2a9cba768f34356738e25dcf228e6ce66bf8d28a91883b2d0da68a64931f1279240ebe3a96dc5b61b6e0477f123896783442d28a506b34e7561306fe8118baef476b4896548b361cb8e65d41a925d593dbdb31cd853f907a05f94027a80a7e874f14e29d835840f5bb985a096925fb7067db41a23814ab74381e38f00f32b0548c51344c64140a18d6270ca7fc63d17709ad0153e168b994e47d295e7061c74286cdf22ad563da09c5c956d8ceb0eff84f65f1a23a3b557ecc29fd8af3bf19790a534b762457afd1273a7fecd9b0b2e4628a009b62e3976677dc3d0ac943c6e22a0e3a96744cb20c62f8076d7fc5a443df8a40e89a21e9fd7678553cedb8fe6e5e44de95d07bd00b21e8afd2c1cc6906a6fe4234e6f007ca2e5d1b3b5a32b4e35268c892feb3b693e12ae898a1e3dc93d95981883b1df94ffc5d62ea5381ac06482ab8b4fe14a6594a6cb4cd2071bf936869a23a0d4d8b2b712a4a81488cb20d4d49256f64ac16c4a6a94c0fabe2c581d90f8256c4a4f1c067622c8907c9ee14d6e4a7bcffc2670d08a7c8aa109a55d42c3e411dede9f64ce82c7bb37038faeac4e64660ac529cdd97690af8dd969fa5135ef14259e914f3e5f5be3262b7f381ed9a3dbde171c9d3a9df738a705dea110ebab02bdf7d3210b0376386782a503a91eb3d379a30e69cfb29a405f008476d3f581211edd520814b35e4be2b912334e8293343dc815181dfa61c0f95dc9d7963c851223edd3b7d225d49000edbe26f47fd37bdcbc1e2b0d56d72ac32a4a45bd720c0ae5fc57a04e3b803f2b4222d38ed0e2a0caad643aca9b6b6780488ddbe155631f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005d415e4619b4dd8a5ff4f0887bf67b34f01daf7206c4913122c8c80e8791a0336073b54fd0d30c790ba139811b2cb6b772074dd1fbc19dd3694197ac6f6d0230752822ce65f77e8e70968dec3354004b60c942892e221418020e2364048ed0b355de640330907e81bdff7445282ae39458fee36560f21b390c2d34e11224825aa2d7b2113e144581ef1b7fbb140bbfd47977a65fad2cee0e8ae8a8c20b13b044a2cbe5fa9a524f62658cb56c8c885b443c0e8cda3baba18e89ad970d5185001a0d032c2144e030556a8549001b6969cc66b15a22406b25f92477879dd0bd50c9dc5463f0df7b390ecec1f9174d34be7625ab85a1c9cf53e46b769a552d090229dd7ca4692ae1572618b6c5f898b64fffa49b3825ca6f91f6b7cbd374ea04d0694c4542db740dba939c8f26e0cc1f4391221bc424f30d81114d7bb890eae2a0878834f5773d8e2089aa76b1ba8de765e65a62f2352a9b8680584b5dc976fab11f3683f93a5dc9c7383cd21358bc8ba718109dd66dbb5819b6a27014f9096e121aaceabff3773bdf6244a6ff33dfee35bce47db99298b8d3991370d4442467d1bda6466b956d6860125853be60573fe36c1d63176554d7e950a56d9e72f7c8e1a83659ff02581c9c6efc953f76216caa5667cd6a321dc46539e46509889aae70160004f180bfb94d5e9ac6020d6eb9c3ffe4a5f0f7e785586a108eeffcfa729052660b2c83a1f75558e6c86788dab48dfaee816660e7f0dd3d224dbac3d32ab010b444044a7ea6d419ae54329734cd91d2cc7187cb6843f226f66d815534baa0f571b251bd3ff9ae50da2ce79a2a2d9ac40cb28abd152bfc4c93fc76ef2fcdf165905433cb2056847b7d0a291f6c5946fd3288174a7039d628f323932400a9327601b7695648d810e7afa6b1a23f092d273e6867d7361a33faef046dd2aa525275a620a0a53c3405b3ee37f1096e58caa2f9be2c719ef7a859d42d0ebf211f70e1daad342a714e4a0c8dae95e1ed2434e4c516d260b7fe81f00a8cb1b5ffc3f2275385834da02ab30d6d3b7e77e48abac19c4c7b7051f7812243fef89f3ea312fee663b6b30d33b99998e7a4615844e7dfa764c84576ed71b0c369445c6dc2c295e823f3bd8f3b669b276046cdecd9c2232c64f6685cd2494d77bc50b89302557", + }; + + axiom.setComputeQuery(computeQuery); + const builtQuery = await axiom.buildBase(); + + expect(builtQuery.computeQuery).toEqual(computeQuery); + expect(builtQuery.dataQueryStruct.subqueries).toEqual([]); + }); +}); diff --git a/circuit/test/unit/queryBuilderBase/buildComputeQueryWithDataQuery.test.ts b/circuit/test/unit/queryBuilderBase/buildComputeQueryWithDataQuery.test.ts new file mode 100644 index 00000000..27db2e65 --- /dev/null +++ b/circuit/test/unit/queryBuilderBase/buildComputeQueryWithDataQuery.test.ts @@ -0,0 +1,165 @@ +import { bytes32 } from "@axiom-crypto/tools"; +import { + QueryBuilderBase, + QueryBuilderBaseConfig, + AxiomV2Callback, + AxiomV2ComputeQuery, + AxiomV2DataQuery, + AccountSubquery, +} from "../../../src"; + +// Test coverage areas: +// - DataQuery +// - Setting a built DataQuery +// - ComputeQuery +// - Callback + +describe("Build ComputeQuery with DataQuery", () => { + const config: QueryBuilderBaseConfig = { + providerUri: process.env.PROVIDER_URI_SEPOLIA as string, + sourceChainId: 1, + version: "v2", + }; + const axiom = new QueryBuilderBase(config); + + test("simple computeQuery with dataQuery", async () => { + const computeQuery: AxiomV2ComputeQuery = { + k: 13, + resultLen: 1, + vkey: [ + "0x83b88c6080be442679432e6c5634a3e3a7a26051a3b2581fba85dba0973fca20", + "0xc04b25057d0bddf35d4542077516abb76445b8e745a457e3ccc1bf9aac2ba406", + "0xa471542dc1c798279c6e094f7fae5174d83d5bd4f419d39f38a18a6aadadef23", + "0xa17889e08418a09cecdac9afac9ddb4d839a56cc50205cd8df90ab459f53e900", + "0x0000000000000000000000000000000000000000000000000000000000000080", + "0x0000000000000000000000000000000000000000000000000000000000000080", + "0x0000000000000000000000000000000000000000000000000000000000000080", + "0xdaa121f99b66245770900bec7f7df67ba081c1ea1ec4e85de531e5efcb05dc2b", + "0x72e95e6a67298de4d3da26492ee511e5b88295db678f739edb226e7947d38d0b", + "0x22e4c62aacfc240ed0553bfad00122ba8c7627c870c739f3f818584e066a8b1f", + "0x841485e0a9f109688bdc4f5ff851d9e2e44833ae573456742c1237322e938542", + "0x79a62f1cc2f1440cc9fdcd534b612a49da4b6139bbed8cf53a26f4568ac3f567", + "0x1c5846bb7c78a94b984ed2e0296334dd93085bdb3cbe3e69f89772ba64fa102c", + "0xb9681242289c63756173eed28ce8ff44a71fe1fcf683bd07fcd70fdaede5b769", + ], + computeProof: + "0x0000000000000000000000000000000000000000000000008713ff58e11eda2c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b742e3f91720ab2f43ece6b297314a246a28e8a37718433aee65e2452a1ebc57f4ca1a1e173855eaa5a9fbb74f96343f20e26d3d3ead44407e2e762f51ec4d0ed9b0aef7e5779df902223b4830ed0d12a02b950758107e35e5518d878cbff12da8658a104bf75f18aa7e3addaa8f4eaed64a353795f6e79b5faa6a633c3af06c2fb71ba568306ab02ca08f5a3a781b41f88696d30919d6bb1f849332d89f180065d76a0f0cbd417968fec77aee71be48054fcb4e6558be00fdce9a27a94aad593889074e456d9c1604b89eace24329a1e70091eaa7de84f0b5003719d5f4a7426599d89656cc63b4fe5889cbef9822b8bc72b13f5c17ce053168c479122de0024d54935ef42eacea4bcd71212dd3df7915258bb6b7e10b4fcba0cda608359a60e25ce4db9a4781e37fd89aa45b72b837bfedf2270abe6a71e39eb8a35bdbad1e967b1bc90fa8acee63c07191105168642f1d8b155342f1e0496ce9da38eade6bf41ba260e495de52802e49fa3cdc8df28a35b17c9d70420952e37034abfac36d7ab7dd54e0eccab23dcc53c12d0477046f6232c6e2b969eb38d432277ec24270e971c3d634f961848bbc9ae1a2e3c240056d3cd6f05cce571a417eeaf01c446fd30244b86c099a4c33d65f7b584152a3af87506b76c7ca75d4c1026becbf293003fbf082a70a5f59c8e04d4ff7ff6765c15881ece1da60dfd929e32c755239230bf43fc4550991af513d27dd6d6eaaf6722815574f6dfda59d2ccacf21f366037c7d3e718e28bc938f2f0bcc531106a6c080b1668af4cd43a1e78b6be2826b084788029be51d8e6a2c28aa3ff6a40a8cfad83258c9de474b927e9ab690760d159d29f54bcd509d436a9b5f9b823210ebc7270ed35a847e6a69a2c0144cb34d22cb4188b51dd1f066e2b81a8ca6b0eb71a63d70dc58cd6d6052c399afc220bd211595f31aa97ff14841347122e0339220f5d54e53fbf1637c9e06623279d27f11f855dc69c96c75d5c6eae7405d2818a9c3d23d278a98370d051cc807998374170c6b334eec536d0908e778e05f09dad697e6600b65664d452d95eccb96cfc1056dba89a96e878acf151abe100ba0bb9b5d312f78f71593b3362439beca96fb04d9e81ddf083b8d8d27761815149917c987b2f20d33fac83382bc3bbb06429c2c0fecd6ce7dc5dec284247b52df9c40eeda443cd2251f03dd7c273861a3416a102b62251dc9e7c2e5a31af17cf61e42ca536353041ff1e5c8250de0e4e3abbf268b59c095f2ac631d4d8096372bca388ab6d8a0fb65dede8377c79e8b7f7d900740e401f41adcbc17099e7aa8d460a5b83c4fad9778e47962049c22fdb3aaf51cff60d8b2f8f334918a30decf3e037a7a8c0e82f59164bdb64e39adfa8a63db052c82399a620c80d95bafcb87979a4de501948c0f1d3484f10c1a5ec4062e7f034043b6bc02b2e3b8827173e885cb1acbd835742c7cd7efcb96e4eddbf7831d1c1a7db7eb87c2949a9fdeccca48a072dcad163472f202312772eee02a1c3fd012d6b993f8a9f3f0948057f2cde182945fbf1c953fb6413a099180312c78da471289c0fa64c7c0228d79d7e432cfd00ef50973db40566a71221c1a0b89e6084526000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000de97f1ddfb2158546e5e03072fecbbe020f0dbd3de37507743e2fa0ebad01f1c90dabcf0e87726d1c855b8740ba4bd58e976a816d798c06a76eca992b5694f2e340984db397c67b1cff836cfe8511334d80b313b5b167849ac88bf68c7f9f11126a1dd52e4a44dbc34111734e572e47a6fcf395f1af6bc1ecd4513588038f51a5bdfc30a8b7eeb2bad8c6d353f405b65ca3644935ee6ce7b451420f6d7821c15c026098859e9e7ef0802201bb1d18cec3628d18858e307d8fc450cc487c3ed0e2ea995450e7d315de27bbe2dc3c984de54c4124fc5bfa316bab6782119610327f30bea752bc651ef7566c0a0b63019f80bba217203c82c9c81d9acb0ea60c01efddb1b4256395523642a5bc7d1b26a39326b7ae354a60bea41b514e8f1282312d26a6f35c969fa352d94a336118edd4cf01d9b84abdc817814d57cea99ac322ba025020705565ef4e356580bcaef735b1012bca412100c3a635d78a92683a12bfe47f0e03a21b89394bfb6a871da24eac0d61c38c7f3a0bb9dd80e2785065b157561e9f1c36d3f8002913bc37b2cda34d988af0154ce83536ba9b65093e61522927bc3c36119ca9d7cea8b57fda0957121358965c20f317ce227d816a411cd1daf43d3e16180dab1536b66944e96640f45b5583d4c351f72c126a02b995b102f1e4bc4a2d03b064cc6fdf6d8b0a919387002f22acfd6b6abb8676de7f4c8a607848a771aa2bea3f4d01d740a111e86282be89c83bf3ab7723fad017a453e6b07ac92550f2773027a09daf2c71030dce29042b7fa9d0e79a634b2990e49121510653a0d3a6939258ea5727164cc3ac9c8056391c0f3dae76a8eb6af86ee0c022a6abaf06d576ec79280cf5fdab040eb85b0bf89b0201b7cc39661671fe6f17b23b07a252e1da57576842a4c751ba7ed0a1e353e42acc64d97be8207ce9257d00ec9735011e00a5edba5dbbd8d7124911639526b0563911179c7bb6765745c6b0a10f7e06499deb91e71b5d52213b973cd761105e5950009e8a96b75c721f89c2f0e7e87d280431249edbaabe885198349651032396cb30bb20942d700abb8da2c0df5c2d5361dc487452cd3d7d5ea5da9a6b2fcceb8b49a4b84be63caf4fdce0e4e13218cbcdca3bc55a05981a169890efc7c8906500140c9c51aa75490d7c41e", + }; + const dataQuery: AxiomV2DataQuery = { + sourceChainId: "5", + subqueries: [ + { + subqueryData: { blockNumber: 9900000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as AccountSubquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9899000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as AccountSubquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9898000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as AccountSubquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9897000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as AccountSubquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9896000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as AccountSubquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9895000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as AccountSubquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9894000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as AccountSubquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9893000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as AccountSubquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9892000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as AccountSubquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9891000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as AccountSubquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9890000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as AccountSubquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9889000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as AccountSubquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9888000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as AccountSubquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9887000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as AccountSubquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9886000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as AccountSubquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9885000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as AccountSubquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9884000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as AccountSubquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9883000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as AccountSubquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9882000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as AccountSubquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9881000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as AccountSubquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9880000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as AccountSubquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9879000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as AccountSubquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9878000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as AccountSubquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9877000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as AccountSubquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9876000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as AccountSubquery, + type: 2, + }, + ], + }; + axiom.setBuiltDataQuery(dataQuery); + axiom.setComputeQuery(computeQuery); + await axiom.buildBase(); + }); + + test("build a query with no DataQuery or ComputeQuery", async () => { + const testFn = async () => { + const axiom = new QueryBuilderBase(config); + await axiom.buildBase(); + }; + await expect(testFn()).rejects.toThrow(); + }); +}); diff --git a/circuit/test/unit/queryBuilderBase/buildDataQueryStandalone.test.ts b/circuit/test/unit/queryBuilderBase/buildDataQueryStandalone.test.ts new file mode 100644 index 00000000..03664e6b --- /dev/null +++ b/circuit/test/unit/queryBuilderBase/buildDataQueryStandalone.test.ts @@ -0,0 +1,94 @@ +import { ethers } from "ethers"; +import { + AccountField, + QueryBuilderBase, + QueryBuilderBaseConfig, + AxiomV2Callback, + AxiomV2ComputeQuery, + HeaderField, + ReceiptField, + TxField, +} from "../../../src"; +import { bytes32 } from "@axiom-crypto/tools"; + +// Test coverage areas: +// - DataQuery +// - Callback + +describe("Build DataQuery Standalone", () => { + const WETH_ADDR = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"; + const WETH_WHALE = "0x2E15D7AA0650dE1009710FDd45C3468d75AE1392"; + const WSOL_ADDR = "0xd31a59c85ae9d8edefec411d448f90841571b89c"; + const UNI_V3_FACTORY_ADDR = "0x1F98431c8aD98523631AE4a59f267346ea31F984"; + + const config: QueryBuilderBaseConfig = { + providerUri: process.env.PROVIDER_URI_SEPOLIA as string, + sourceChainId: "1", + version: "v2", + }; + const axiom = new QueryBuilderBase(config); + + test("simple dataQuery", async () => { + const blockNumber = 18200000; + const dataQueryReq = [ + { + blockNumber: blockNumber, + fieldIdx: HeaderField.GasUsed, + }, + { + blockNumber: blockNumber + 100, + fieldIdx: HeaderField.GasUsed, + }, + ]; + axiom.append(dataQueryReq); + + const builtQuery = await axiom.buildBase(); + if (builtQuery === undefined) { + throw new Error("builtQuery is undefined"); + } + + expect(builtQuery.queryHash).toEqual("0xda1933a884934070a870d18243ec2f1a7efa869966c4cf52d03b179c998a4825"); + expect(builtQuery.dataQueryHash).toEqual("0xfaaac492509be62a2026a769d31140ee49e4b662e56c95251b8ca6ccace0e91b"); + expect(builtQuery.dataQuery).toEqual("0x0000000000000001000200010115b5c00000000a00010115b6240000000a"); + expect(builtQuery.computeQuery.k).toEqual(0); + expect(builtQuery.computeQuery.vkey.length).toEqual(0); + expect(builtQuery.computeQuery.vkey).toEqual([]); + expect(builtQuery.computeQuery.computeProof).toEqual("0x00"); + }); + + test("simple dataQuery with all types", async () => { + const blockNumber = 17000000; + const txHash = "0xc94a955a2f8c48dc4f14f4183aff4b23aede06ff7fcd7888b18cb407a707fa74"; + + const dataQueryReq = [ + { + blockNumber: blockNumber, + fieldIdx: HeaderField.GasLimit, + }, + { + blockNumber: blockNumber + 1, + addr: WETH_WHALE, + fieldIdx: 1, + }, + { + blockNumber: blockNumber, + addr: WETH_ADDR, + slot: 0, + }, + { + blockNumber: 17975259, + txIdx: 34, + // txHash: "0x47082a4eaba054312c652a21c6d75a44095b8be43c60bdaeffad03d38a8b1602", + fieldOrLogIdx: ReceiptField.CumulativeGas, + topicOrDataOrAddressIdx: 10, + eventSchema: ethers.ZeroHash, + }, + ]; + axiom.append(dataQueryReq); + + const builtQuery = await axiom.buildBase(); + if (builtQuery === undefined) { + throw new Error("builtQuery is undefined"); + } + }); +}); diff --git a/circuit/test/unit/queryBuilderBase/buildQueryNoCallback.test.ts b/circuit/test/unit/queryBuilderBase/buildQueryNoCallback.test.ts new file mode 100644 index 00000000..26b5efc0 --- /dev/null +++ b/circuit/test/unit/queryBuilderBase/buildQueryNoCallback.test.ts @@ -0,0 +1,61 @@ +import { ethers } from "ethers"; +import { QueryBuilderBase, QueryBuilderBaseConfig, AxiomV2Callback, AxiomV2ComputeQuery, HeaderField } from "../../../src"; + +// Test coverage areas: +// - DataQuery +// - ComputeQuery +// - No Callback + +describe("Build a Query with no Callback", () => { + const config: QueryBuilderBaseConfig = { + providerUri: process.env.PROVIDER_URI_SEPOLIA as string, + sourceChainId: 1, + version: "v2", + }; + const axiom = new QueryBuilderBase(config); + + test("simple computeQuery with no Callback", async () => { + /** Code + // x^2 + y + const x_2 = mul(x, x); + const val = add(x_2, y); + addToCallback(val) + */ + + /** Inputs + { + "x": 10, + "y": 50 + } + */ + + const computeQuery: AxiomV2ComputeQuery = { + k: 13, + resultLen: 1, + vkey: [ + "0x4caffbbdc5d29b00b3e97df7fb169baadaff9443ea3ecfd62231541d2752e003", + "0xc04b25057d0bddf35d4542077516abb76445b8e745a457e3ccc1bf9aac2ba406", + "0x6f4cebf257ebe7a319dd5dedcd41085d35b11afe7254a55d5f33366084983a61", + "0xce36e621969a1e33547280e28d8158537284eb5b5d284ede4dc81d1e69ef2e28", + "0x0000000000000000000000000000000000000000000000000000000000000080", + "0x0000000000000000000000000000000000000000000000000000000000000080", + "0x0000000000000000000000000000000000000000000000000000000000000080", + "0xceb30489e39186b75336db29c5e0ce27e0c7480fc5a8ee071fc8642283700e42", + "0x4570a761b654d0422dba9042e1c2130284cca09e659d46b69739c99697ff4068", + "0x22e4c62aacfc240ed0553bfad00122ba8c7627c870c739f3f818584e066a8b1f", + "0x841485e0a9f109688bdc4f5ff851d9e2e44833ae573456742c1237322e938542", + "0x79a62f1cc2f1440cc9fdcd534b612a49da4b6139bbed8cf53a26f4568ac3f567", + "0x63bf6c5c2a2c6a568d6399d6658a320511dda5caf1dc5a84af03472a552ee510", + "0x1f3d22024e669b91ee856e925fcbe0b6da642b57b348823bf7ac26266b3e695d", + ], + computeProof: + "0x00000000000000000000000000000000000000000000000000000000000000960000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ca0d58f038fa1dea93aac4ae41d157f0894c4d857468a9da2d8999721f5691209442ccfd19f64af56d033662e58c382db23a6693a591a22e2706a9a7527c1f041e4ca2d69d9aec9cd4203ce4cf181dda917e93db04afd78953f872112797c710b38aa8b8c774c4f56bf471ac233b27f87791647e18d70be18f28570a4c948548a137f0d62b925e4f0f0c8b2c8de36c2c1c54b63061619cb391dc117d72dcea16ec2f0173413814f94fd7ab61bf134aab9cf7bf453d246d6a25746576377e8806eccf2692cab5ffd4d443e9ac325a479dcd51b72b9123f39a7ac77d94333469629987d1f0209effc6d3f71b9ed1622bc1e6fc68c575725eaf2bca1ae3674ee44ca652f57b0da21ecb9413d083cdeabe8e52d255177621112c3b3a22daf8eec7074c6e4ec115313e94a935e632ac5226a232abfb0910b3e5ff8a6ea58855028948d093f98691bac135ab827597dd3291bd7372298c4cc028af1b710972776f106637331c92b893f3db7a85c480f26a7083fe3052ec48c1360b42929ef950e643279fbb17dbef72b8e87321b8e8b911383a0913ecd1789960428aafd24d7939d45148e89f457178c188b065cf233f69a26d0195e8e9853e973fdfd3015612bae12b0f18ffa2e18550a7195beff3d684841ecf3cb869ba9668fda32514d83fcc801bbd72d06f730773bae66310f62c6eac2f58d6a88826adb520ef0c9b87ee7c371c40b6f73f27226ab90f0594860c30d892d4082925d83d8a7cfe885b743e49481a1b685dcefe3d8029e70d875b9b4902ac0a82895175881cd0a354090c0b1c9903465eb370ed07dbd3eba1367ec17095ea20278a6db3055f45b85be5862ceaa92b0cf0c3cb2f8f6df24a598f1b45c0f60a4308b44ce630c3e97c385aa664756500d6ea8cd7069d2b9fb8c0b389a9b325cca515a0e3a0498ca8ce67ef920358b12959761f8d863b39ee4e8036e816a110d1f4637f65c68d5ef3a9ba50f059aec10e39e9652b6594d85c86dd9b98889d7b854e5e3a4674cb54d66dff547409165f235637f037c8dc693649eebf8e6cede4474a92e3ac4091cc0eea855f0790ed8e06bffc7ddd79222f3423209826f6c99279f0f709a04a58de67d9ae12aeb1bc38261907ab51f8f4025cded6cfa1d54acccf85a39834721865723a9560dca880310a1444588fa6fa6cf1caa6d5282e0a401861cf4d7dbc60449086014e076f673c2f7eb23a6204f697d6209bca33b52453de1841c683390ac3f03eedcdfb1b92941f0c6c1e92c687955f343eec30f71cf78d8ff1ee4c38d44c19acd01e5fd910682391b066e657a08ef28362f40f918963b4228d657280688dafab61b4063c760d1ed8562c1b061850b49054f0816858a574bd79bb8d592423ea1d7f02b617b01e06327e6c6f120c69866bf81203ec2ebb274e118b44e87fe2e30dd77882de784b11243f41f5200ede478cb14c5c24c117fa987e149ccb67b7a7f758e26250158c20c515702aa9c28af2ea51cc9e135d6d635b3ddc259d5f5713a5615333f277a805b452afe6ec4205b927793ab473fc3fa40631d9d9cf365067a4c78906b7119b19e66f13936c69f4db1db9005b89187657772eae05d81530375d9def9fcff1450a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005ed4d210ce92739ea5af0066601fcc2a43a9ae8ccc8a49f1008940b5066c2326f419c6da9fbd9481ca099e405aa18403a4188d21832ee58a39975d6a9a49ea1bba8d1de4811547f6e3aa1d684c0c0cd57443729dbcf201ac20704a553d0b6b20a9cdb94058c8deb216792b9ef0ca51a26c54ca23e460b2b191ce6af8784bff2f90fc0a4ec281dd95beee516d3e15a04fb873038b949c44db2fb0ee943f6bfa1d4f2ff763d865adf55a29b37bee0f6ad8754fde6999125b6a779056d4bdf95b13ac41d86d841adec49bf27a7414b88074f27a975ee36d5f647f7dcbcc580df20e4d7e040bbb2c6c2a6dc5f18737259dee588657cbbe225ebd66fac66ca3386d16a9bef9c4664733a2619a50be2ac5a8f4ce7f272b4686526681415e79ff3baf0881d52948b3fc7d0b5d413d44a1cb985d4557ff651042fd2c8180fe9528b9cb1f400da2686d602ebbe2e24d6d6b0c9e12d6ba41c1db556ee1ecce44fe8513e0104353210ebba3f83cfd38b84509c47245cfa4544189949997fe36e96fcb68b10495d6632a553da9f1f1dec8251018793d44e30a30bf874fc56abeb9facdd04a25a1bd9fe412949086db288d3326b80b48e4d85ec44de11a8767032c1569c472141f44f80531c0becccbf5791f65ef4d21a6529a908b7e5386f5c9169d20082813684ee79e7ce7ddc0497301321f5fbda44ecaac3c157cf00c28d432411528f405c8ee72147fcd0ab094b58914163c875cca43bd1724ee1b448137e5afbe38bf24be5c46aa67200f1e19a9cd4c9abfa91af60f54751220c189206d64c314fe1622d827025d39024eb329090c2b496490306a52f721bb8e41f41266262b899c420ea10ef2211821bbcbcc3ae427053b97d3a6a3d3133893f373adab42c8d8e20a0beb5d12246bc590c4424fddcc8511c594fdcfa23fa55ed2a89af28947fc9e5f1f081992a5f470977f7c7e38ceaa69cc5d43ee604cd5bf6c4a5a861960f3c10e1c306c1e0999a0ac0b6e565e6bc205de0d807e7b3a686d03b559b040c0cd332518b1289a02a889400211e1e84f038faac5966e5d927f025c3ed0b0149644646f11d91d524604313e3382d86310325d000e462fb5705776ad3dd10ced1d3889f829370e0aa9669d80239514dad97bbfdd5bde7e5d74d341d45b9827cccf1ce57d0d", + }; + + axiom.setComputeQuery(computeQuery); + const builtQuery = await axiom.buildBase(); + + expect(builtQuery.computeQuery).toEqual(computeQuery); + expect(builtQuery.dataQueryStruct.subqueries).toEqual([]); + }); +}); diff --git a/circuit/test/unit/queryBuilderBase/configLimitManager.test.ts b/circuit/test/unit/queryBuilderBase/configLimitManager.test.ts new file mode 100644 index 00000000..44e962a8 --- /dev/null +++ b/circuit/test/unit/queryBuilderBase/configLimitManager.test.ts @@ -0,0 +1,655 @@ +import { bytes32, getBlockNumberAndTxIdx } from "@axiom-crypto/tools"; +import { + QueryBuilderBase, + QueryBuilderBaseConfig, + ReceiptField, + TxField, +} from "../../../src"; +import { JsonRpcProvider } from "ethers"; + +function appendTx(axiom: QueryBuilderBase, txCache: {[key: string]: {blockNumber: number, txIdx: number}}, txHash: string) { + const { blockNumber, txIdx } = txCache[txHash]; + if (blockNumber === undefined || txIdx === undefined) { + throw new Error("Invalid block number or tx index"); + } + const subquery = { + blockNumber, + txIdx, + fieldOrCalldataIdx: TxField.MaxFeePerGas, + } + axiom.appendDataSubquery(subquery); +} + +function appendReceipt(axiom: QueryBuilderBase, txCache: {[key: string]: {blockNumber: number, txIdx: number}}, txHash: string) { + const { blockNumber, txIdx } = txCache[txHash]; + if (blockNumber === undefined || txIdx === undefined) { + throw new Error("Invalid block number or tx index"); + } + const subquery = { + blockNumber, + txIdx, + fieldOrLogIdx: ReceiptField.Status, + topicOrDataOrAddressIdx: 0, + eventSchema: bytes32(0), + } + axiom.appendDataSubquery(subquery); +} + +async function getBlockAndIdx(provider: JsonRpcProvider, arr: string[], name: string) { + let data = ""; + for await (const txHash of arr) { + const { blockNumber, txIdx } = await getBlockNumberAndTxIdx(provider, txHash); + if (blockNumber === null || txIdx === null) { + throw new Error("Block number or tx index is null"); + } + data += ` "${txHash}": { blockNumber: ${blockNumber}, txIdx: ${txIdx} },\n`; + } + console.log(data); +} + +describe("Config Limit Manager", () => { + const config: QueryBuilderBaseConfig = { + providerUri: process.env.PROVIDER_URI_SEPOLIA as string, + sourceChainId: "11155111", + version: "v2", + }; + const txHashesSmall = [ + "0x4db3409f8fd6ad120ef6e3714fb341d47bc8d49cac63280c7e4f9b39e5b0b8c3", + "0xa766ddd8f6bc8ad0a254e7074106f3c374142633512059f54fa3eb619f8bf627", + "0xdbc4ad1c40f58d8a3abf0dd237111e93b40192f2a0cd23ea5dffd8d8b687a113", + "0x2ee0b9fce233fbde1ab24ce33290e6ef50af94a785c62236ae4262609cb3442d", + "0xe1915f21e47c90e33eae1be7a69d99a154769c46a68cc711131da4bdbb6b2aad", + "0x70905905858f7e9674fbb3dd1331e022c961871a3b5b80b75927ba12f74eac7d", + "0xd22ddbaf47137388d4a620373210946a2ccf09f8f06f39f9f6ad7c7ca888209a", + "0xc2229a3016f44d44e137dc0e8a0886126d27dfcca35ddcf369797f082792022d", + "0x5cbca950a85a08e435c0318fb9bed65c0f1344701c6615e44034039091838fe5", + "0x32789c15d8e6702e66fcd0065c1a450cfdad0bca1d3ec37f2761a03e6c8eadae", + "0xac7b91561c5bdf743c34a70a83a5021bb833b1d429673e21fa1960b92e4a0b93", + "0x2df935a4a199ccc4dd3807462dbb1fc3f6ba038cc1782d38a6028e20db954ed2", + "0xb863a4177041aedf726de723080b001c31243ffe751418a54a04e6b0157b79b7", + "0x4120d87266a7e6d61f359edd0d6daf0e35d003f34be1940eb8c27bece11c6f11", + "0x77e6782f3323addcccf17049c8953cd4c5f9ba5fcb74ffdc484e5641c4edcd14", + "0xc1fff10556ea3e6d696ab319454473dc439e8d6a5b97a03676bddd6014465bc5", + "0x517892313697fae425a0c4a89d464da90729abf44c99d37e4936202374d21a5f", + "0xa864ffea41ed16c99970d54b7928b0daa3bfcc0fe9ef4ac211cf0e118125bd9f", + "0xcfbd0acf0aa9ddc66f0d24eb33140943d5e6493992a889453c410b813097d1e1", + "0xec990f92d9043345373c362005e8922ef7f07427d61d9d64ae2f2ed44714596d", + "0x801fc13c1cc5d5c85d9e8e83901a59eb39eebe7a7171869405c91c396a49dddd", + "0xd0e9041b8727e66e0be678d2e909c2be94714210cfd12cf3c4beacc8e362c103", + "0xbca4c0ae397b80c8492a1f389e5bd52f4c045a33837daf819349baffad4e9cdd", + "0xc65ee3091a0fe2297f98e91574cb0404cc580b81e91cd85b267e2e2568cd0983", + "0x388cde76a7d36eba14b0b98cccf0612ad1bea337901723977c39211b734ab030", + "0x61288c4109f0325aa68678e2f9f61b96b23d63c77b97de65263b638b527f9f99", + "0x81657da7cd05f3d4d9be6ce749bdd89b8b55d6bac89018531caab5a05e18af52", + "0x9ee2f5bec39680429a28059feeceda6c640748e7d6156fe0470853a8067cbaf9", + "0xcd78cadf6e84cb6e029b4c25b85067c20b40d6bd48fe54dfea7a759a4984b51a", + "0x6e920c097e5bad11778620dc4c08ec04bb83c2ce2467868183cc8c095854a0de", + "0xdf87297eed994bf6e8eef30e89a2e899fd4775bbac7731e300a75b1296eec0bc", + "0x95bd1012f75975852fa40069c89f78fb92fc1b8b82a9fc9441c0560ab10e3ce2", + "0xfeb5ed3d258457eeca0bffd9215b9ddbf5b8acef5a86f3345ae6549a63e4a685", + "0xd5b7a60f0aad3b2eb53f5fa33a7eebb23da2a3ed3bd16b4455a9f1e7f0d2ffda", + "0x2dcd0f2f97172014ad88b584b01de3aa1483a8dcd69ba4b3753b262c526227e1", + "0x5d43ff55995755c6398ebc96f8ae41f00c14ada0b1d56a46ae7a22c93d6af1e2", + "0x243c2f64eaa18197a1179dd72a337ed350eb7aeef4f7937919b879cb778274b6", + "0x4f9c3cd5618b49bda2d726d29b355528ca0c48a05862b8f16cec8e27063c9517", + "0xd2a86e1ef232ffa7b7c32195b79e2f27080d92dada8dfea157ec4fbb3c56b54c", + "0x650924c0d522c6feb5a48589489d1eb19c2bded73b2691c7001c919410b84f61", + "0xe4b0a271495700545e624eccf0ca0b9d7d3a8e280bd965f9c3a44e5485621060", + "0xdd4139b47559ffbf3474f750eec80922bfac9e7c44e0ac0d4ee80f1f665aad96", + "0x343b43164a660121628c24623a86659fcb1140b646b725b2b886a65dabe9d1ad", + "0xb5058c6ac0a311b82a3d51de760d7bf91a24869c2712dd96682a74de19f36d4a", + "0x1fe758ee2e1f2bb6ab1b774c2d30367b0cffbf5f13749a2f0e1342b0d726c27b", + "0x9e3fedd9a2361777c42d773b0f6880885e4e64575815b2cb838289bf14e053ad", + "0x7576c4c3728b559965a9ab147bda89ef763b5b13565e45288991f4747c9833ad", + "0xfdbe497d729639a84ac86ff508018cfef4b5d7ccc1b3ec409dbe2fea9414ee03", + "0xaad567001fa96380bb187f97e2dfa35d1a0cb020b6b3bc000d81623fcef13353", + "0xb4dbb9a18641f4aa272228c3c8281915b442d03a114f30e9344254b32dd9d08c", + "0x10e3ba6d299ed03b690fec942504c53d6e8a5340422d94315f67eb9d54b8ad36", + "0x41cac7557eb01485774148de87340fd2c58dac5fca9ef3434c880b70f10cd117", + "0x6aa02b8872d5a7bec8544381e4ab9d9cddf556fa233273b880ac0cd1d47f7e8a", + "0xd421129773ecef874ec34a9dd1cc819845cd24e4cda92f7c746f38726cf9c221", + "0x2ed248f05550563e2a6538080554b474fb9a0f2536e5724734ebdeaffd074b96", + "0x236977deae55ece5576a2af479dba290ff687ddcddeb5eba0060e9cd5dcb5167", + "0x0781d26ba87b19b8644ed43cab0a91c092119067319f49460bf1d93f98668791", + "0x7d872ef9114956a13dae56de170d5403336ff7d1ddfb52241de29a0e8f75da1a", + "0xbe81b7cadcc17429d3a61f91894271821c951425e4cb7303abed3bae6c9d6376", + "0x2e6f4d6e2d82e026ff2eb1e118e8f4b2f6c780667bf2ca47b38df04081a82140", + "0xd6e6a638a8b7d3b400170c9d29e872625b7c09cbbc5de82e9e3361628c6d1ace", + "0x1af8f5f51ea9bc393f5065a0db424165474a95db42402116ee3d37042e5d681f", + "0xbbc8a6531648a08e19121d91cab92aa22edcfa7b0691f5e59dee3a1344b3bf85", + "0xe65b6a4c77ae2bcdcfca6a276de7fd60fae0061c635f456488cf39cb13cc06d6", + "0x8bd3093c647e733328293acb1d98cc2d26289e1642b3c37aa45123a0af64aa03", + "0x9ba971cbbe1acde8b2702d859beffeb376fc941d08d4284030e5353219df42b1", + "0x14b08bf0ff8d0500a594a13b127b567891e2328c65a2ff8efe0c75478a73b54c", + "0x97b85c0c46416f4ff0f223c90a3f9fd12db5229062d1de4dd7e8a5bcf23b5185", + "0x002dfdc78384ba6fe65155e339b9b4e26ccf04f3c06fe9dd8e16804a75c26f96", + "0x81c69fb96466b74c04362d66a1912e9bcc4caaf054444917dcd440464f45f086", + "0x2905c4f42dcc6b029536a30101e0fd4cc0d243a817c6908a84c5f98263f4ae8a", + "0x784910e4c4270ecbffacd62014651d04e7b3543d2c2c0e775f24662e101b032e", + "0x4c4460bf5590b911a83fa89776e588b4834955d8b9c097b05ca1e27e660b22ec", + "0xcc8023ac1f98f674ba0ae7d858479d96c035000654a022285fb3b96de345799e", + "0x9fd943641713fce52253c6739721a91aa2ea362ad4c3c118c0ca8a25d696e526", + "0x6ba1d80608a9305bbbb56b9f46bffca318db2c8cf2de874e1e3d802f82ecf77e", + "0xb5b854735690d63f4d416d42638c6bbbdf8b9097d4745943a251a153e78a8e66", + "0x6c8889e4c72707a36d964756f50bc2a9b52c743aacb0b0a6fc1834eb1c185e4f", + "0xd9111f3e409a36a77643e9175152e7b741f217242c600b70b0fc208eed8ada8d", + "0x04ce81eb9f3648f07c10987abcc84b4754e84df07488b0ca9b492516efbd5964", + "0xfa5a218dc1110f15432c7a06e95cb3ceaf52fc38a380aa8765e8c163b25f7b3c", + "0x60f4dc4dfd52df6450028fdcdc589f7fb4448b9df2345104e9f275a8d44f0804", + "0xe3aae50e354aac5a8fe261b038e27a806b887588f84c43bc1dea11e4eeb8036f", + "0x3127f09801df19b6c9bafe69699b16478a2ec6cfd0d700a7371f4c975f3bea5d", + "0x55402b8cae5af848a9df654f26c78680d426f1e64590a47dc2eba3f4d7356f2a", + "0xf4f7f238c85ab6b60e065bb7eccb5a0b87b1246d9ad7d27996737c1d6feae9a1", + "0xd72a5365d3b2ae90997aab20bcc75c6b683e7941c473072c5afb6dac2cf41a18", + "0x1f8da216ee1d8e8526b3cee2eb262fd845074acb3de58a6779352018119b3517", + "0xc1c425b10de4803ea4e6dd5631ae0735db6cc7036359693ff81bcc77e4c56d1b", + "0x313639e550885a627da7bf81f4fe2819d6a39f85234a46f305ba4017c17d3a4b", + "0xbd80f306550040b3afa3da8773b5658d51c3eacb5f40f75748c946a7a2904354", + "0x679e7c9f852f21b16f759d41c5daa3cdbed8de9e63c083072137d8ff431798b8", + "0xd9c765a69dbc7d3aa976d03957f118b248ecb464d9dcc29d0b311461de2312da", + "0x4f28f9cfabc3db845fe629920612d0b9bd6d0c47e89eefc12cc63ee6c0e4e1c5", + "0x8fefc627ab45baf599b88199369d54188ef447ca4afc5c391b5ac72392710753", + "0xe213b61eb9bbb84ecfded04ff69752387ac5950f0f0ec526315d0685c6075c3e", + "0x30ef8f01068b76e3fab2b75fe3d0d8e7ab68b7861402372a4c45aac7800236f6", + "0x27cd2a0c2c588b6ad2dc66097a78c61d4719e2e72a1779bde1a8ca6f1f5308f3", + "0xdb6b3a04070ebffb58d8ddfe3b9fe41855d00069abc380dff5b4289598c59f55", + "0xf892c0a3e37963787eee5d73b3feddcc8fa3d5a4e5102f2a730ad138e0047ac2", + "0x0466ef98f76f2654bd98d08f946e963548c8d88989a18d673620dbbdc4ec0815", + "0x289d72465b1e79f2d33f45f29940b4b2b025f721b93504cbc0e3a5182ac0ed45", + "0x7349b075f1d09b2047a121bf8f497b43883faa0e5f065b547b07d4c81b557fa9", + "0x3e21bde95ad65616d067e1fc55dc91b74a5d7d5d249a445d862602e863f2a865", + "0xa7a80100d53c91ebdfcffb37335461d9f8204ed57e0a2362cda8dc1e0b3081a4", + "0x7770f8253fb9c9b54891231b2d6012d3bc2e5c2a9c6f86d3f6c7682f6b6ba07b", + "0xd111f00c73738e9e29d76b688328f5402e83a070c1917ec5d0e93ec9dc6169c3", + "0x78a4eb46e14469246d36546a7fcb9dd1b4db15f539952cfbac2eed99bcf99b56", + "0xa1673adc3601473a04df9f198ccb13e34a6755bc045f0d043b2601ce9e3ec9de", + "0xd3190ad266144140df4f2b0c9ae3160f56e78d85a29559e6cc1da99b35d1f334", + "0x968b7fd4f713ff5a58e460044d9a9595814a8fc60f54037150d47268a3635dd8", + "0x3af63ba4b5c62f3770ab78bda8318e6d7cc123a1aa757ead6ec329b5149f17b3", + "0x1b00c98a57ea5c7718954e6d7db34e494b2d7e169b28940fef9b41537a71a1a7", + "0xe943eea4703570bbd1420f583343d10702b84a206dd3c0677c426bb0a26bed49", + "0xdc14fc8a1c682cc49e14684f338069e6e9424548691903f76b4bccc9c274f3ff", + "0x53f2736b916e2908d4a2bfb42943c5c0f2055c37c8197c696f7e25a3c5a847b9", + "0xbb6056c80cf49cdcaf2d556a8a8a8abb48a36a7c2d6d060edd3fb7be14e5ff80", + "0xd2ac89302408cd0dcd1af2db7c06d108f72aef834c27485a8ed2d15ec2e0fb9a", + "0xe5cd6a9fa0dbe3ac3d8207be62db3f0c309a4b97cb3fd5fda51d53a210c597d0", + "0x597dbe0297117c1715a18f2e5121ed1b26085eaff6fdba0549e8fba7fba03259", + "0x7a1c6545bf15ffdcbecb056228970281dfe1bcf8ce59d0101eb26c63639cba53", + "0xe9baf3830f27443c66c1b003581ecbf62ed46cfb7fda672a7782b047c171bcaa", + "0x5dc74ac2689aaa666f1f5672d19d93a26ac34f783bf00a1a8b1bdddaf15b6517", + "0x90b4804396de0735799ad5dca65866d732e6e11138413a5460dbbbd92689bbe5", + "0xbad8c8be4dda0acf888b77464c395d2575be5386f9a22a03788cc3596fe013b3", + "0xe84f36ffb177dfbba93c4739aa31c5fa74e06d63695b567682f3c744e54e10d6", + "0xd6b99ceda57a36b843faee52fea87e26cc60d361dc7b65aa1c60d0397b5ec76e", + "0xc2653a70516a660719877145d764e122f7721ac7801283a886336d9959a7027e", + "0x11a3078310dcb8328599530c82488b61f8aff76beac43082d72e84cafd62ecca", + "0xc72fc27eff3c0321af6eb56021a916845e956d8d81284401b59f0fb881aba647", + "0xc9bee236bf5556712da9b580843eea4c889e4a3558b2ec27c5067fdb4a9c30f3", + "0x2f15e7b191f1245a104fc435e18f553288a45f0c446bcc9464efb50814de1f4a", + "0xbfd1808588cd7e37864fdcf4507631b56d4d8775116eb030b236f0b28b04a588", + "0x0436b209237746e36d3ab3f213da803e06a8c5e328b7138eec6552e51cfed8c1", + "0xe528125fd45724cd19d5716744a5af19c8ba13d9b26743a48fbfca02549d66e0", + "0x055fbf4876b8d2a8ff3639f16c49dc00e1348bf08b5ff52c7a55e1603dc2a882", + "0x26c33210b18f68364f237c9a7474210cc4ad4de7270822aad0d2261b633482f1", + "0x7a3b652f135e22c36fe39cd12e120ba0e9330113ad7db7d2afd62d4dd3df20a4", + "0xb62a1890ede8adb10a753427d89862c69ff74d595afce96df5a3a28cc0897f63", + "0xab8c3a18827d654146224555a5c20c5a7de5b6e248259716bb7f0c08210502d2", + "0x7f52d16132d4376ca58778ebd0da4e524246d6ab343eb778f8beb0ea05f0a0f6", + "0x93c2993c8247db15ccd9d9b1ad87d55d958ed87efc888a1fa0eaade814177f59", + "0x8a114cdcbb81a41a14e5d9fbe85847dd4210120e2673ccb5cd1551ec9fdaf10e", + "0x3a63da2fb90383e61ac3c49adeb28b809a548fdb683001039eda557b2502648e", + "0x7d658a58381aeadc4f0da6dd374c8b5d1964f2227894b25fee2cc43ba579be71", + "0xce5983856d4ccee25f316efba1f8288bc57ec3a578dca05d69e2eb119cea3366", + "0x81429487f883e64cb51ef6e8d5374883d8a104e93cd72d351f227c6c3f43859a", + "0x348947795a846a6c87c1726af054ed0beb94af5b46b25d5b894683faa0f7cdc2", + "0xd4963fab34c9b73e0d3ffde46aff268a33399782c0318d0b9c12aaf613b169ab", + "0x1cb1f5eb741abfd443574a17e436acb58ce37e660603b40058bbec672274e4be", + "0xf10d8d2ec4c5bd01575ceb85556996a91206d17ce4da935b9d15e5dea5ed0b05", + "0x2ca38ee20db43188d98d3a39d56edbc6b6202978805effecf7177b9a6a67eb8e", + "0x5c01adab7ee12a2c506b7683c12d535b7979a88d42f29f9fbf0f5d9daa4822cf", + "0xdf9a14994d061fc985b32b2a7ea70dd731358a68edb156669ae4dec36eee6b7b", + "0x43f3b484d7d795846afdb2c4db31ac40c9dcfac19e3baeb15c5bb96b083752ea", + "0xbbb9ff4208700dd8c2a9c0ab3cf2b7f88b33a79499c0d8cdb44e1a9ba39252ca", + "0xc9755de4a7d4039d6deab834fcfa950e84da58151f7746b3ce74134f115a4a6e", + "0x457a0b21336f8a5b4f0c0abc613349ba560707dc4ac5c4ff726d1d5f0140adf2", + "0x18379ed607c2a07ec8c8af3b8b3bf3913a76e6bd2eba8b1a2bc82e99f68f00a2", + "0xb7984b1294685e319b905af5009a43885b72e477b187928c228981328efb16ed", + "0x821c3f5abf022389b5dd6ec5446ef30483e0ea8893d204da8e7a8ad2fae737e5", + "0xb6d337679ab72f5b6e8fbf8a70052504d9f794512355025f145df17c055f3da3", + ]; + + const txHashesLarge = [ + "0x8eea148cadd73701e89672796c720dd6ba93f95a061dc5d78f65fbee31e30205", // contract creation + "0xd6cba43527b52089c3a7850202dc32e02b9bfe3f1fc5dadf274456405af824c3", + "0x59ada23f6dc651da3d1455763f265418cd66865b3c2f78e55922507bf6301227", + "0x393ee30e1fe45753c3b7bfa197b639d8f89f64f2a0cda6145c67358aeaf0fac0", + "0x11231cca21ad83323549bf36f49a11dc00c3e12ea8bde8d2a82f95f0cfe1083f", + "0x59ada23f6dc651da3d1455763f265418cd66865b3c2f78e55922507bf6301227", // CREATE2 call + "0x883640fbfce3710fabc0662a7e33d912450fa44130866a46a861538885c32b84", + ]; + + const txHashesMax = [ + "0x5858835aa0d379060b12fac0661b40a8cf51ff39643a828229dc62c089eb0121", + ]; + + const rcHashesMedium = [ + "0xa9a64e0b67b389c31db3db1479e39808aa801f2c9140b397691bb041d5389cfe", // 80 log, 1024b each + "0xacc68842cfca9111f402334d5f8b971843857d990d2b65240945692842030468", + "0xf9fca94f31a41ac7f705f964f53af679d8bd89ec0b25e82fdbfb2a2b4db536ff", + "0x7ab4446fd83a42e24a71ab7eee873d7571d6336ad9e63bc23e80093ea88c0af0", + "0x13c8504ebc6dd981518f5d88901968b52b8545698a43348dcafb80c0611eb4dc", + "0xe521c225670f2b0faa88ec07cb975f6d8fc717a50b994b6d5eaffeacc01b0a14", + "0xf498e607eaa6d3416d1c05085f254e0db60828daa98539d01484d643419f2d89", + "0xb900666ce02c2223ab4f7842f14f76197e61677bf9d6562a1239a938fa9987ff", + ]; + + const rcHashesLarge = [ + "0x0b78901654a6533defcf4883bdeeeaba6d316f50e8c42b84cfca828a24495a18", // 80 log, 2048b each + "0x46c9ec7358bd51bf19425ad0a464c3a4056fc956f89082f5611c886617d5d1a0", // 1184b log + "0xa35374016c4d80e1a48532f976b32d2645d7003a5b871b1557aaff3363ca45af", // 1120b log + "0x0a61363b6a033d4ddf842f4765ea729a4ac54e761398404618bd139a5f1ca0a7", // 1120b log + "0xb1919e75917103e1d2f23c54cb7e60decea6a10c28e871a7d463dce455faf263", // 1056b log + ]; + + const rcHashesMax = [ + "0x30a95958a33f7800bf77d4d5e028747a241c0cc2ae44bbb27316c8bf9b4217d4", // 400 log, 1024b each + "0x8d7cae7bdc262082866295a2efbddbef9028e80b000e0b6c1dfa9b4f0e59aa4a", // 400 log, 1024b each + ]; + + const rcHashesOverMax = [ + "0x4c4d02b5a0b9bd697b648983242a6ac3f7bb74f69c8e5204c5a089577c65c4c6", // 400 log, >1024b + "0x80b19a2f01456357682c9131d237dfb915f9d3e888962f3f828df439d8e550d2", // 80 log, >2048b log + ]; + + const txCache = { + "0x4db3409f8fd6ad120ef6e3714fb341d47bc8d49cac63280c7e4f9b39e5b0b8c3": { blockNumber: 5069241, txIdx: 0 }, + "0xa766ddd8f6bc8ad0a254e7074106f3c374142633512059f54fa3eb619f8bf627": { blockNumber: 5069241, txIdx: 1 }, + "0xdbc4ad1c40f58d8a3abf0dd237111e93b40192f2a0cd23ea5dffd8d8b687a113": { blockNumber: 5069241, txIdx: 2 }, + "0x2ee0b9fce233fbde1ab24ce33290e6ef50af94a785c62236ae4262609cb3442d": { blockNumber: 5069241, txIdx: 3 }, + "0xe1915f21e47c90e33eae1be7a69d99a154769c46a68cc711131da4bdbb6b2aad": { blockNumber: 5069241, txIdx: 4 }, + "0x70905905858f7e9674fbb3dd1331e022c961871a3b5b80b75927ba12f74eac7d": { blockNumber: 5069241, txIdx: 5 }, + "0xd22ddbaf47137388d4a620373210946a2ccf09f8f06f39f9f6ad7c7ca888209a": { blockNumber: 5069241, txIdx: 6 }, + "0xc2229a3016f44d44e137dc0e8a0886126d27dfcca35ddcf369797f082792022d": { blockNumber: 5069241, txIdx: 7 }, + "0x5cbca950a85a08e435c0318fb9bed65c0f1344701c6615e44034039091838fe5": { blockNumber: 5069241, txIdx: 8 }, + "0x32789c15d8e6702e66fcd0065c1a450cfdad0bca1d3ec37f2761a03e6c8eadae": { blockNumber: 5069241, txIdx: 9 }, + "0xac7b91561c5bdf743c34a70a83a5021bb833b1d429673e21fa1960b92e4a0b93": { blockNumber: 5069241, txIdx: 10 }, + "0x2df935a4a199ccc4dd3807462dbb1fc3f6ba038cc1782d38a6028e20db954ed2": { blockNumber: 5069241, txIdx: 11 }, + "0xb863a4177041aedf726de723080b001c31243ffe751418a54a04e6b0157b79b7": { blockNumber: 5069241, txIdx: 12 }, + "0x4120d87266a7e6d61f359edd0d6daf0e35d003f34be1940eb8c27bece11c6f11": { blockNumber: 5069241, txIdx: 13 }, + "0x77e6782f3323addcccf17049c8953cd4c5f9ba5fcb74ffdc484e5641c4edcd14": { blockNumber: 5069241, txIdx: 14 }, + "0xc1fff10556ea3e6d696ab319454473dc439e8d6a5b97a03676bddd6014465bc5": { blockNumber: 5069241, txIdx: 15 }, + "0x517892313697fae425a0c4a89d464da90729abf44c99d37e4936202374d21a5f": { blockNumber: 5069241, txIdx: 16 }, + "0xa864ffea41ed16c99970d54b7928b0daa3bfcc0fe9ef4ac211cf0e118125bd9f": { blockNumber: 5069241, txIdx: 17 }, + "0xcfbd0acf0aa9ddc66f0d24eb33140943d5e6493992a889453c410b813097d1e1": { blockNumber: 5069241, txIdx: 18 }, + "0xec990f92d9043345373c362005e8922ef7f07427d61d9d64ae2f2ed44714596d": { blockNumber: 5069241, txIdx: 19 }, + "0x801fc13c1cc5d5c85d9e8e83901a59eb39eebe7a7171869405c91c396a49dddd": { blockNumber: 5069241, txIdx: 20 }, + "0xd0e9041b8727e66e0be678d2e909c2be94714210cfd12cf3c4beacc8e362c103": { blockNumber: 5069241, txIdx: 21 }, + "0xbca4c0ae397b80c8492a1f389e5bd52f4c045a33837daf819349baffad4e9cdd": { blockNumber: 5069241, txIdx: 22 }, + "0xc65ee3091a0fe2297f98e91574cb0404cc580b81e91cd85b267e2e2568cd0983": { blockNumber: 5069241, txIdx: 23 }, + "0x388cde76a7d36eba14b0b98cccf0612ad1bea337901723977c39211b734ab030": { blockNumber: 5069241, txIdx: 24 }, + "0x61288c4109f0325aa68678e2f9f61b96b23d63c77b97de65263b638b527f9f99": { blockNumber: 5069241, txIdx: 25 }, + "0x81657da7cd05f3d4d9be6ce749bdd89b8b55d6bac89018531caab5a05e18af52": { blockNumber: 5069241, txIdx: 26 }, + "0x9ee2f5bec39680429a28059feeceda6c640748e7d6156fe0470853a8067cbaf9": { blockNumber: 5069241, txIdx: 27 }, + "0xcd78cadf6e84cb6e029b4c25b85067c20b40d6bd48fe54dfea7a759a4984b51a": { blockNumber: 5069241, txIdx: 28 }, + "0x6e920c097e5bad11778620dc4c08ec04bb83c2ce2467868183cc8c095854a0de": { blockNumber: 5069241, txIdx: 29 }, + "0xdf87297eed994bf6e8eef30e89a2e899fd4775bbac7731e300a75b1296eec0bc": { blockNumber: 5069241, txIdx: 30 }, + "0x95bd1012f75975852fa40069c89f78fb92fc1b8b82a9fc9441c0560ab10e3ce2": { blockNumber: 5069241, txIdx: 31 }, + "0xfeb5ed3d258457eeca0bffd9215b9ddbf5b8acef5a86f3345ae6549a63e4a685": { blockNumber: 5069241, txIdx: 32 }, + "0xd5b7a60f0aad3b2eb53f5fa33a7eebb23da2a3ed3bd16b4455a9f1e7f0d2ffda": { blockNumber: 5069241, txIdx: 33 }, + "0x2dcd0f2f97172014ad88b584b01de3aa1483a8dcd69ba4b3753b262c526227e1": { blockNumber: 5069241, txIdx: 34 }, + "0x5d43ff55995755c6398ebc96f8ae41f00c14ada0b1d56a46ae7a22c93d6af1e2": { blockNumber: 5069241, txIdx: 35 }, + "0x243c2f64eaa18197a1179dd72a337ed350eb7aeef4f7937919b879cb778274b6": { blockNumber: 5069241, txIdx: 36 }, + "0x4f9c3cd5618b49bda2d726d29b355528ca0c48a05862b8f16cec8e27063c9517": { blockNumber: 5069241, txIdx: 37 }, + "0xd2a86e1ef232ffa7b7c32195b79e2f27080d92dada8dfea157ec4fbb3c56b54c": { blockNumber: 5069241, txIdx: 38 }, + "0x650924c0d522c6feb5a48589489d1eb19c2bded73b2691c7001c919410b84f61": { blockNumber: 5069241, txIdx: 39 }, + "0xe4b0a271495700545e624eccf0ca0b9d7d3a8e280bd965f9c3a44e5485621060": { blockNumber: 5069241, txIdx: 40 }, + "0xdd4139b47559ffbf3474f750eec80922bfac9e7c44e0ac0d4ee80f1f665aad96": { blockNumber: 5069241, txIdx: 41 }, + "0x343b43164a660121628c24623a86659fcb1140b646b725b2b886a65dabe9d1ad": { blockNumber: 5069241, txIdx: 42 }, + "0xb5058c6ac0a311b82a3d51de760d7bf91a24869c2712dd96682a74de19f36d4a": { blockNumber: 5069241, txIdx: 43 }, + "0x1fe758ee2e1f2bb6ab1b774c2d30367b0cffbf5f13749a2f0e1342b0d726c27b": { blockNumber: 5069241, txIdx: 44 }, + "0x9e3fedd9a2361777c42d773b0f6880885e4e64575815b2cb838289bf14e053ad": { blockNumber: 5069241, txIdx: 45 }, + "0x7576c4c3728b559965a9ab147bda89ef763b5b13565e45288991f4747c9833ad": { blockNumber: 5069241, txIdx: 46 }, + "0xfdbe497d729639a84ac86ff508018cfef4b5d7ccc1b3ec409dbe2fea9414ee03": { blockNumber: 5069241, txIdx: 47 }, + "0xaad567001fa96380bb187f97e2dfa35d1a0cb020b6b3bc000d81623fcef13353": { blockNumber: 5069241, txIdx: 48 }, + "0xb4dbb9a18641f4aa272228c3c8281915b442d03a114f30e9344254b32dd9d08c": { blockNumber: 5069241, txIdx: 49 }, + "0x10e3ba6d299ed03b690fec942504c53d6e8a5340422d94315f67eb9d54b8ad36": { blockNumber: 5069241, txIdx: 50 }, + "0x41cac7557eb01485774148de87340fd2c58dac5fca9ef3434c880b70f10cd117": { blockNumber: 5069241, txIdx: 51 }, + "0x6aa02b8872d5a7bec8544381e4ab9d9cddf556fa233273b880ac0cd1d47f7e8a": { blockNumber: 5069241, txIdx: 52 }, + "0xd421129773ecef874ec34a9dd1cc819845cd24e4cda92f7c746f38726cf9c221": { blockNumber: 5069241, txIdx: 53 }, + "0x2ed248f05550563e2a6538080554b474fb9a0f2536e5724734ebdeaffd074b96": { blockNumber: 5069241, txIdx: 54 }, + "0x236977deae55ece5576a2af479dba290ff687ddcddeb5eba0060e9cd5dcb5167": { blockNumber: 5069241, txIdx: 55 }, + "0x0781d26ba87b19b8644ed43cab0a91c092119067319f49460bf1d93f98668791": { blockNumber: 5069241, txIdx: 56 }, + "0x7d872ef9114956a13dae56de170d5403336ff7d1ddfb52241de29a0e8f75da1a": { blockNumber: 5069241, txIdx: 57 }, + "0xbe81b7cadcc17429d3a61f91894271821c951425e4cb7303abed3bae6c9d6376": { blockNumber: 5069241, txIdx: 58 }, + "0x2e6f4d6e2d82e026ff2eb1e118e8f4b2f6c780667bf2ca47b38df04081a82140": { blockNumber: 5069241, txIdx: 59 }, + "0xd6e6a638a8b7d3b400170c9d29e872625b7c09cbbc5de82e9e3361628c6d1ace": { blockNumber: 5069241, txIdx: 60 }, + "0x1af8f5f51ea9bc393f5065a0db424165474a95db42402116ee3d37042e5d681f": { blockNumber: 5069241, txIdx: 61 }, + "0xbbc8a6531648a08e19121d91cab92aa22edcfa7b0691f5e59dee3a1344b3bf85": { blockNumber: 5069241, txIdx: 62 }, + "0xe65b6a4c77ae2bcdcfca6a276de7fd60fae0061c635f456488cf39cb13cc06d6": { blockNumber: 5069241, txIdx: 63 }, + "0x8bd3093c647e733328293acb1d98cc2d26289e1642b3c37aa45123a0af64aa03": { blockNumber: 5069241, txIdx: 64 }, + "0x9ba971cbbe1acde8b2702d859beffeb376fc941d08d4284030e5353219df42b1": { blockNumber: 5069241, txIdx: 65 }, + "0x14b08bf0ff8d0500a594a13b127b567891e2328c65a2ff8efe0c75478a73b54c": { blockNumber: 5069241, txIdx: 66 }, + "0x97b85c0c46416f4ff0f223c90a3f9fd12db5229062d1de4dd7e8a5bcf23b5185": { blockNumber: 5069241, txIdx: 67 }, + "0x002dfdc78384ba6fe65155e339b9b4e26ccf04f3c06fe9dd8e16804a75c26f96": { blockNumber: 5069241, txIdx: 68 }, + "0x81c69fb96466b74c04362d66a1912e9bcc4caaf054444917dcd440464f45f086": { blockNumber: 5069241, txIdx: 69 }, + "0x2905c4f42dcc6b029536a30101e0fd4cc0d243a817c6908a84c5f98263f4ae8a": { blockNumber: 5069241, txIdx: 70 }, + "0x784910e4c4270ecbffacd62014651d04e7b3543d2c2c0e775f24662e101b032e": { blockNumber: 5069241, txIdx: 71 }, + "0x4c4460bf5590b911a83fa89776e588b4834955d8b9c097b05ca1e27e660b22ec": { blockNumber: 5069241, txIdx: 72 }, + "0xcc8023ac1f98f674ba0ae7d858479d96c035000654a022285fb3b96de345799e": { blockNumber: 5069241, txIdx: 73 }, + "0x9fd943641713fce52253c6739721a91aa2ea362ad4c3c118c0ca8a25d696e526": { blockNumber: 5069241, txIdx: 74 }, + "0x6ba1d80608a9305bbbb56b9f46bffca318db2c8cf2de874e1e3d802f82ecf77e": { blockNumber: 5069241, txIdx: 75 }, + "0xb5b854735690d63f4d416d42638c6bbbdf8b9097d4745943a251a153e78a8e66": { blockNumber: 5069241, txIdx: 76 }, + "0x6c8889e4c72707a36d964756f50bc2a9b52c743aacb0b0a6fc1834eb1c185e4f": { blockNumber: 5069241, txIdx: 77 }, + "0xd9111f3e409a36a77643e9175152e7b741f217242c600b70b0fc208eed8ada8d": { blockNumber: 5072963, txIdx: 69 }, + "0x04ce81eb9f3648f07c10987abcc84b4754e84df07488b0ca9b492516efbd5964": { blockNumber: 5072963, txIdx: 74 }, + "0xfa5a218dc1110f15432c7a06e95cb3ceaf52fc38a380aa8765e8c163b25f7b3c": { blockNumber: 5072963, txIdx: 75 }, + "0x60f4dc4dfd52df6450028fdcdc589f7fb4448b9df2345104e9f275a8d44f0804": { blockNumber: 5072963, txIdx: 76 }, + "0xe3aae50e354aac5a8fe261b038e27a806b887588f84c43bc1dea11e4eeb8036f": { blockNumber: 5072963, txIdx: 77 }, + "0x3127f09801df19b6c9bafe69699b16478a2ec6cfd0d700a7371f4c975f3bea5d": { blockNumber: 5072963, txIdx: 78 }, + "0x55402b8cae5af848a9df654f26c78680d426f1e64590a47dc2eba3f4d7356f2a": { blockNumber: 5072963, txIdx: 79 }, + "0xf4f7f238c85ab6b60e065bb7eccb5a0b87b1246d9ad7d27996737c1d6feae9a1": { blockNumber: 5072963, txIdx: 80 }, + "0xd72a5365d3b2ae90997aab20bcc75c6b683e7941c473072c5afb6dac2cf41a18": { blockNumber: 5072963, txIdx: 81 }, + "0x1f8da216ee1d8e8526b3cee2eb262fd845074acb3de58a6779352018119b3517": { blockNumber: 5072963, txIdx: 82 }, + "0xc1c425b10de4803ea4e6dd5631ae0735db6cc7036359693ff81bcc77e4c56d1b": { blockNumber: 5069241, txIdx: 90 }, + "0x313639e550885a627da7bf81f4fe2819d6a39f85234a46f305ba4017c17d3a4b": { blockNumber: 5069241, txIdx: 91 }, + "0xbd80f306550040b3afa3da8773b5658d51c3eacb5f40f75748c946a7a2904354": { blockNumber: 5069241, txIdx: 92 }, + "0x679e7c9f852f21b16f759d41c5daa3cdbed8de9e63c083072137d8ff431798b8": { blockNumber: 5069241, txIdx: 93 }, + "0xd9c765a69dbc7d3aa976d03957f118b248ecb464d9dcc29d0b311461de2312da": { blockNumber: 5069241, txIdx: 94 }, + "0x4f28f9cfabc3db845fe629920612d0b9bd6d0c47e89eefc12cc63ee6c0e4e1c5": { blockNumber: 5069241, txIdx: 95 }, + "0x8fefc627ab45baf599b88199369d54188ef447ca4afc5c391b5ac72392710753": { blockNumber: 5069241, txIdx: 96 }, + "0xe213b61eb9bbb84ecfded04ff69752387ac5950f0f0ec526315d0685c6075c3e": { blockNumber: 5069241, txIdx: 97 }, + "0x30ef8f01068b76e3fab2b75fe3d0d8e7ab68b7861402372a4c45aac7800236f6": { blockNumber: 5069241, txIdx: 98 }, + "0x27cd2a0c2c588b6ad2dc66097a78c61d4719e2e72a1779bde1a8ca6f1f5308f3": { blockNumber: 5069241, txIdx: 99 }, + "0xdb6b3a04070ebffb58d8ddfe3b9fe41855d00069abc380dff5b4289598c59f55": { blockNumber: 5069241, txIdx: 100 }, + "0xf892c0a3e37963787eee5d73b3feddcc8fa3d5a4e5102f2a730ad138e0047ac2": { blockNumber: 5069241, txIdx: 101 }, + "0x0466ef98f76f2654bd98d08f946e963548c8d88989a18d673620dbbdc4ec0815": { blockNumber: 5069241, txIdx: 102 }, + "0x289d72465b1e79f2d33f45f29940b4b2b025f721b93504cbc0e3a5182ac0ed45": { blockNumber: 5069241, txIdx: 103 }, + "0x7349b075f1d09b2047a121bf8f497b43883faa0e5f065b547b07d4c81b557fa9": { blockNumber: 5073859, txIdx: 64 }, + "0x3e21bde95ad65616d067e1fc55dc91b74a5d7d5d249a445d862602e863f2a865": { blockNumber: 5073859, txIdx: 65 }, + "0xa7a80100d53c91ebdfcffb37335461d9f8204ed57e0a2362cda8dc1e0b3081a4": { blockNumber: 5073859, txIdx: 66 }, + "0x7770f8253fb9c9b54891231b2d6012d3bc2e5c2a9c6f86d3f6c7682f6b6ba07b": { blockNumber: 5073859, txIdx: 67 }, + "0xd111f00c73738e9e29d76b688328f5402e83a070c1917ec5d0e93ec9dc6169c3": { blockNumber: 5073859, txIdx: 68 }, + "0x78a4eb46e14469246d36546a7fcb9dd1b4db15f539952cfbac2eed99bcf99b56": { blockNumber: 5073859, txIdx: 69 }, + "0xa1673adc3601473a04df9f198ccb13e34a6755bc045f0d043b2601ce9e3ec9de": { blockNumber: 5073859, txIdx: 70 }, + "0xd3190ad266144140df4f2b0c9ae3160f56e78d85a29559e6cc1da99b35d1f334": { blockNumber: 5073859, txIdx: 71 }, + "0x968b7fd4f713ff5a58e460044d9a9595814a8fc60f54037150d47268a3635dd8": { blockNumber: 5073859, txIdx: 72 }, + "0x3af63ba4b5c62f3770ab78bda8318e6d7cc123a1aa757ead6ec329b5149f17b3": { blockNumber: 5073859, txIdx: 73 }, + "0x1b00c98a57ea5c7718954e6d7db34e494b2d7e169b28940fef9b41537a71a1a7": { blockNumber: 5073859, txIdx: 74 }, + "0xe943eea4703570bbd1420f583343d10702b84a206dd3c0677c426bb0a26bed49": { blockNumber: 5073859, txIdx: 75 }, + "0xdc14fc8a1c682cc49e14684f338069e6e9424548691903f76b4bccc9c274f3ff": { blockNumber: 5073859, txIdx: 28 }, + "0x53f2736b916e2908d4a2bfb42943c5c0f2055c37c8197c696f7e25a3c5a847b9": { blockNumber: 5073859, txIdx: 29 }, + "0xbb6056c80cf49cdcaf2d556a8a8a8abb48a36a7c2d6d060edd3fb7be14e5ff80": { blockNumber: 5073859, txIdx: 30 }, + "0xd2ac89302408cd0dcd1af2db7c06d108f72aef834c27485a8ed2d15ec2e0fb9a": { blockNumber: 5073859, txIdx: 31 }, + "0xe5cd6a9fa0dbe3ac3d8207be62db3f0c309a4b97cb3fd5fda51d53a210c597d0": { blockNumber: 5073859, txIdx: 32 }, + "0x597dbe0297117c1715a18f2e5121ed1b26085eaff6fdba0549e8fba7fba03259": { blockNumber: 5073859, txIdx: 33 }, + "0x7a1c6545bf15ffdcbecb056228970281dfe1bcf8ce59d0101eb26c63639cba53": { blockNumber: 5073859, txIdx: 34 }, + "0xe9baf3830f27443c66c1b003581ecbf62ed46cfb7fda672a7782b047c171bcaa": { blockNumber: 5073859, txIdx: 35 }, + "0x5dc74ac2689aaa666f1f5672d19d93a26ac34f783bf00a1a8b1bdddaf15b6517": { blockNumber: 5073859, txIdx: 36 }, + "0x90b4804396de0735799ad5dca65866d732e6e11138413a5460dbbbd92689bbe5": { blockNumber: 5073859, txIdx: 37 }, + "0xbad8c8be4dda0acf888b77464c395d2575be5386f9a22a03788cc3596fe013b3": { blockNumber: 5073859, txIdx: 38 }, + "0xe84f36ffb177dfbba93c4739aa31c5fa74e06d63695b567682f3c744e54e10d6": { blockNumber: 5073859, txIdx: 39 }, + "0xd6b99ceda57a36b843faee52fea87e26cc60d361dc7b65aa1c60d0397b5ec76e": { blockNumber: 5073859, txIdx: 40 }, + "0xc2653a70516a660719877145d764e122f7721ac7801283a886336d9959a7027e": { blockNumber: 5073859, txIdx: 41 }, + "0x11a3078310dcb8328599530c82488b61f8aff76beac43082d72e84cafd62ecca": { blockNumber: 5074078, txIdx: 30 }, + "0xc72fc27eff3c0321af6eb56021a916845e956d8d81284401b59f0fb881aba647": { blockNumber: 5074078, txIdx: 31 }, + "0xc9bee236bf5556712da9b580843eea4c889e4a3558b2ec27c5067fdb4a9c30f3": { blockNumber: 5074078, txIdx: 32 }, + "0x2f15e7b191f1245a104fc435e18f553288a45f0c446bcc9464efb50814de1f4a": { blockNumber: 5074078, txIdx: 33 }, + "0xbfd1808588cd7e37864fdcf4507631b56d4d8775116eb030b236f0b28b04a588": { blockNumber: 5074078, txIdx: 34 }, + "0x0436b209237746e36d3ab3f213da803e06a8c5e328b7138eec6552e51cfed8c1": { blockNumber: 5074078, txIdx: 35 }, + "0xe528125fd45724cd19d5716744a5af19c8ba13d9b26743a48fbfca02549d66e0": { blockNumber: 5074078, txIdx: 36 }, + "0x055fbf4876b8d2a8ff3639f16c49dc00e1348bf08b5ff52c7a55e1603dc2a882": { blockNumber: 5074078, txIdx: 37 }, + "0x26c33210b18f68364f237c9a7474210cc4ad4de7270822aad0d2261b633482f1": { blockNumber: 5074078, txIdx: 38 }, + "0x7a3b652f135e22c36fe39cd12e120ba0e9330113ad7db7d2afd62d4dd3df20a4": { blockNumber: 5074078, txIdx: 39 }, + "0xb62a1890ede8adb10a753427d89862c69ff74d595afce96df5a3a28cc0897f63": { blockNumber: 5074078, txIdx: 40 }, + "0xab8c3a18827d654146224555a5c20c5a7de5b6e248259716bb7f0c08210502d2": { blockNumber: 5074078, txIdx: 41 }, + "0x7f52d16132d4376ca58778ebd0da4e524246d6ab343eb778f8beb0ea05f0a0f6": { blockNumber: 5074078, txIdx: 42 }, + "0x93c2993c8247db15ccd9d9b1ad87d55d958ed87efc888a1fa0eaade814177f59": { blockNumber: 5074078, txIdx: 43 }, + "0x8a114cdcbb81a41a14e5d9fbe85847dd4210120e2673ccb5cd1551ec9fdaf10e": { blockNumber: 5074078, txIdx: 44 }, + "0x3a63da2fb90383e61ac3c49adeb28b809a548fdb683001039eda557b2502648e": { blockNumber: 5074078, txIdx: 45 }, + "0x7d658a58381aeadc4f0da6dd374c8b5d1964f2227894b25fee2cc43ba579be71": { blockNumber: 5074078, txIdx: 46 }, + "0xce5983856d4ccee25f316efba1f8288bc57ec3a578dca05d69e2eb119cea3366": { blockNumber: 5074078, txIdx: 47 }, + "0x81429487f883e64cb51ef6e8d5374883d8a104e93cd72d351f227c6c3f43859a": { blockNumber: 5074078, txIdx: 48 }, + "0x348947795a846a6c87c1726af054ed0beb94af5b46b25d5b894683faa0f7cdc2": { blockNumber: 5074078, txIdx: 49 }, + "0xd4963fab34c9b73e0d3ffde46aff268a33399782c0318d0b9c12aaf613b169ab": { blockNumber: 5074078, txIdx: 50 }, + "0x1cb1f5eb741abfd443574a17e436acb58ce37e660603b40058bbec672274e4be": { blockNumber: 5074078, txIdx: 51 }, + "0xf10d8d2ec4c5bd01575ceb85556996a91206d17ce4da935b9d15e5dea5ed0b05": { blockNumber: 5074078, txIdx: 52 }, + "0x2ca38ee20db43188d98d3a39d56edbc6b6202978805effecf7177b9a6a67eb8e": { blockNumber: 5074078, txIdx: 53 }, + "0x5c01adab7ee12a2c506b7683c12d535b7979a88d42f29f9fbf0f5d9daa4822cf": { blockNumber: 5074078, txIdx: 54 }, + "0xdf9a14994d061fc985b32b2a7ea70dd731358a68edb156669ae4dec36eee6b7b": { blockNumber: 5074078, txIdx: 55 }, + "0x43f3b484d7d795846afdb2c4db31ac40c9dcfac19e3baeb15c5bb96b083752ea": { blockNumber: 5074078, txIdx: 56 }, + "0xbbb9ff4208700dd8c2a9c0ab3cf2b7f88b33a79499c0d8cdb44e1a9ba39252ca": { blockNumber: 5074078, txIdx: 57 }, + "0xc9755de4a7d4039d6deab834fcfa950e84da58151f7746b3ce74134f115a4a6e": { blockNumber: 5074078, txIdx: 58 }, + "0x457a0b21336f8a5b4f0c0abc613349ba560707dc4ac5c4ff726d1d5f0140adf2": { blockNumber: 5074078, txIdx: 59 }, + "0x18379ed607c2a07ec8c8af3b8b3bf3913a76e6bd2eba8b1a2bc82e99f68f00a2": { blockNumber: 5074078, txIdx: 60 }, + "0xb7984b1294685e319b905af5009a43885b72e477b187928c228981328efb16ed": { blockNumber: 5074078, txIdx: 61 }, + "0x821c3f5abf022389b5dd6ec5446ef30483e0ea8893d204da8e7a8ad2fae737e5": { blockNumber: 5074078, txIdx: 62 }, + "0xb6d337679ab72f5b6e8fbf8a70052504d9f794512355025f145df17c055f3da3": { blockNumber: 5074078, txIdx: 63 }, + "0x8eea148cadd73701e89672796c720dd6ba93f95a061dc5d78f65fbee31e30205": { blockNumber: 5073502, txIdx: 18 }, + "0xd6cba43527b52089c3a7850202dc32e02b9bfe3f1fc5dadf274456405af824c3": { blockNumber: 5073538, txIdx: 14 }, + "0x59ada23f6dc651da3d1455763f265418cd66865b3c2f78e55922507bf6301227": { blockNumber: 5054814, txIdx: 7 }, + "0x393ee30e1fe45753c3b7bfa197b639d8f89f64f2a0cda6145c67358aeaf0fac0": { blockNumber: 5051335, txIdx: 49 }, + "0x11231cca21ad83323549bf36f49a11dc00c3e12ea8bde8d2a82f95f0cfe1083f": { blockNumber: 5068744, txIdx: 25 }, + "0x883640fbfce3710fabc0662a7e33d912450fa44130866a46a861538885c32b84": { blockNumber: 3975383, txIdx: 102 }, + "0x5858835aa0d379060b12fac0661b40a8cf51ff39643a828229dc62c089eb0121": { blockNumber: 5075370, txIdx: 4 }, + "0xa9a64e0b67b389c31db3db1479e39808aa801f2c9140b397691bb041d5389cfe": { blockNumber: 5068591, txIdx: 28 }, + "0xacc68842cfca9111f402334d5f8b971843857d990d2b65240945692842030468": { blockNumber: 5052903, txIdx: 1 }, + "0xf9fca94f31a41ac7f705f964f53af679d8bd89ec0b25e82fdbfb2a2b4db536ff": { blockNumber: 5048643, txIdx: 50 }, + "0x7ab4446fd83a42e24a71ab7eee873d7571d6336ad9e63bc23e80093ea88c0af0": { blockNumber: 5054607, txIdx: 1 }, + "0x13c8504ebc6dd981518f5d88901968b52b8545698a43348dcafb80c0611eb4dc": { blockNumber: 5054607, txIdx: 93 }, + "0xe521c225670f2b0faa88ec07cb975f6d8fc717a50b994b6d5eaffeacc01b0a14": { blockNumber: 5054607, txIdx: 97 }, + "0xf498e607eaa6d3416d1c05085f254e0db60828daa98539d01484d643419f2d89": { blockNumber: 5054607, txIdx: 37 }, + "0xb900666ce02c2223ab4f7842f14f76197e61677bf9d6562a1239a938fa9987ff": { blockNumber: 5052903, txIdx: 77 }, + "0x0b78901654a6533defcf4883bdeeeaba6d316f50e8c42b84cfca828a24495a18": { blockNumber: 5085342, txIdx: 15 }, + "0x46c9ec7358bd51bf19425ad0a464c3a4056fc956f89082f5611c886617d5d1a0": { blockNumber: 5052051, txIdx: 97 }, + "0xa35374016c4d80e1a48532f976b32d2645d7003a5b871b1557aaff3363ca45af": { blockNumber: 5053755, txIdx: 42 }, + "0x0a61363b6a033d4ddf842f4765ea729a4ac54e761398404618bd139a5f1ca0a7": { blockNumber: 5050347, txIdx: 46 }, + "0xb1919e75917103e1d2f23c54cb7e60decea6a10c28e871a7d463dce455faf263": { blockNumber: 5049495, txIdx: 184 }, + "0x30a95958a33f7800bf77d4d5e028747a241c0cc2ae44bbb27316c8bf9b4217d4": { blockNumber: 5085336, txIdx: 45 }, + "0x8d7cae7bdc262082866295a2efbddbef9028e80b000e0b6c1dfa9b4f0e59aa4a": { blockNumber: 5098341, txIdx: 32 }, + "0x4c4d02b5a0b9bd697b648983242a6ac3f7bb74f69c8e5204c5a089577c65c4c6": { blockNumber: 5068617, txIdx: 16 }, + "0x80b19a2f01456357682c9131d237dfb915f9d3e888962f3f828df439d8e550d2": { blockNumber: 5068606, txIdx: 20 }, + } + + const provider = new JsonRpcProvider(process.env.PROVIDER_URI_SEPOLIA as string); + + // test("cache data", async () => { + // await getBlockAndIdx(provider, txHashesSmall, "txHashesSmall"); + // await getBlockAndIdx(provider, txHashesLarge, "txHashesLarge"); + // await getBlockAndIdx(provider, txHashesMax, "txHashesMax"); + // await getBlockAndIdx(provider, rcHashesMedium, "rcHashesMedium"); + // await getBlockAndIdx(provider, rcHashesLarge, "rcHashesLarge"); + // await getBlockAndIdx(provider, rcHashesMax, "rcHashesMax"); + // await getBlockAndIdx(provider, rcHashesOverMax, "rcHashesOverMax"); + // }, 9999999); + + test("default config: 128 tx", async () => { + const axiom = new QueryBuilderBase(config); + for (let i = 0; i < 128; i++) { + appendTx(axiom, txCache, txHashesSmall[i]); + } + const built = await axiom.buildBase(true); + expect(built.dataQueryStruct.subqueries.length).toEqual(128); + }, 300000); + + test("default config: 128 rc", async () => { + const axiom = new QueryBuilderBase(config); + for (let i = 0; i < 128; i++) { + appendReceipt(axiom, txCache, txHashesSmall[i]); + } + const built = await axiom.buildBase(true); + expect(built.dataQueryStruct.subqueries.length).toEqual(128); + }, 300000); + + test("default config: 64 tx, 64 rc", async () => { + const axiom = new QueryBuilderBase(config); + for (let i = 0; i < 64; i++) { + appendTx(axiom, txCache, txHashesSmall[i]); + appendReceipt(axiom, txCache, txHashesSmall[i]); + } + const built = await axiom.buildBase(true); + expect(built.dataQueryStruct.subqueries.length).toEqual(128); + }, 300000); + + test("default config (fail): 65 tx, 64 rc", async () => { + const axiom = new QueryBuilderBase(config); + const testFn = () => { + for (let i = 0; i < 64; i++) { + appendTx(axiom, txCache, txHashesSmall[i]); + appendReceipt(axiom, txCache, txHashesSmall[i]); + } + appendTx(axiom, txCache, txHashesSmall[65]); + } + expect(testFn).toThrow(); + }, 300000); + + test("large config: 1 lg tx, 15 small tx", async () => { + const axiom = new QueryBuilderBase(config); + + appendTx(axiom, txCache, txHashesLarge[0]); + for (let i = 0; i < 15; i++) { + appendTx(axiom, txCache, txHashesSmall[i]); + } + const built = await axiom.buildBase(true); + expect(built.dataQueryStruct.subqueries.length).toEqual(16); + }, 120000); + + test("large config: 1 lg rc, 15 small rc", async () => { + const axiom = new QueryBuilderBase(config); + appendReceipt(axiom, txCache, rcHashesLarge[0]); + for (let i = 0; i < 15; i++) { + appendReceipt(axiom, txCache, txHashesSmall[i]); + } + const built = await axiom.buildBase(true); + expect(built.dataQueryStruct.subqueries.length).toEqual(16); + }, 120000); + + test("large config: 1 lg tx, 16 small rc", async () => { + const axiom = new QueryBuilderBase(config); + for (let i = 0; i < 1; i++) { + appendTx(axiom, txCache, txHashesLarge[i]); + } + for (let i = 0; i < 16; i++) { + appendReceipt(axiom, txCache, txHashesSmall[i]); + } + const built = await axiom.buildBase(true); + expect(built.dataQueryStruct.subqueries.length).toEqual(17); + }, 120000); + + test("large config (fail): 17 tx", async () => { + const axiom = new QueryBuilderBase(config); + const testFn = async () => { + for (let i = 0; i < 1; i++) { + appendTx(axiom, txCache, txHashesLarge[i]); + } + for (let i = 0; i < 16; i++) { + appendTx(axiom, txCache, txHashesSmall[i]); + } + await axiom.buildBase(true); + }; + await expect(testFn).rejects.toThrow(); + }, 120000); + + test("large config (fail): 4 lg rc, 16 small rc", async () => { + const axiom = new QueryBuilderBase(config); + const testFn = async () => { + for (let i = 0; i < 4; i++) { + appendReceipt(axiom, txCache, rcHashesLarge[i]); + } + for (let i = 0; i < 16; i++) { + appendReceipt(axiom, txCache, txHashesSmall[i]); + } + await axiom.buildBase(true); + }; + await expect(testFn).rejects.toThrow(); + }, 120000); + + test("large config (fail): 1 lg tx, 17 small rc", async () => { + const axiom = new QueryBuilderBase(config); + const testFn = async () => { + for (let i = 0; i < 1; i++) { + appendTx(axiom, txCache, txHashesLarge[i]); + } + for (let i = 0; i < 17; i++) { + appendReceipt(axiom, txCache, txHashesSmall[i]); + } + await axiom.buildBase(true); + }; + await expect(testFn).rejects.toThrow(); + }, 120000); + + test("max config: 1 max tx, 3 large tx", async () => { + const axiom = new QueryBuilderBase(config); + appendTx(axiom, txCache, txHashesMax[0]); + for (let i = 0; i < 3; i++) { + appendTx(axiom, txCache, txHashesLarge[i]); + } + const built = await axiom.buildBase(true); + expect(built.dataQueryStruct.subqueries.length).toEqual(4); + }, 120000); + + test("max config: 1 max tx, 3 large tx, 1 max rc", async () => { + const axiom = new QueryBuilderBase(config); + appendTx(axiom, txCache, txHashesMax[0]); + for (let i = 0; i < 3; i++) { + appendTx(axiom, txCache, txHashesLarge[i]); + } + for (let i = 0; i < 1; i++) { + appendReceipt(axiom, txCache, rcHashesMax[i]); + } + const built = await axiom.buildBase(true); + expect(built.dataQueryStruct.subqueries.length).toEqual(5); + }, 120000); + + test("max config (fail): 1 max tx, 4 large tx", async () => { + const axiom = new QueryBuilderBase(config); + const testFn = async () => { + appendTx(axiom, txCache, txHashesMax[0]); + for (let i = 0; i < 4; i++) { + appendTx(axiom, txCache, txHashesLarge[i]); + } + await axiom.buildBase(true); + }; + await expect(testFn).rejects.toThrow(); + }, 120000); + + test("max config (fail): 2 max rc", async () => { + const axiom = new QueryBuilderBase(config); + const testFn = async () => { + for (let i = 0; i < 2; i++) { + appendReceipt(axiom, txCache, rcHashesMax[i]); + } + await axiom.buildBase(true); + } + await expect(testFn).rejects.toThrow(); + }, 120000); + + test("max config (fail): 4 large rc, 1 max tx", async () => { + const axiom = new QueryBuilderBase(config); + const testFn = async () => { + for (let i = 0; i < 4; i++) { + appendReceipt(axiom, txCache, rcHashesLarge[i]); + } + appendTx(axiom, txCache, txHashesMax[0]); + await axiom.buildBase(true); + } + await expect(testFn).rejects.toThrow(); + }, 120000); + + test("max config (fail): oversize 1 max rc (max config log data len)", async () => { + const axiom = new QueryBuilderBase(config); + const testFn = async () => { + appendReceipt(axiom, txCache, rcHashesOverMax[0]); + const built = await axiom.buildBase(true); + } + await expect(testFn).rejects.toThrow(); + }, 120000); + + test("max config (fail): oversize 1 max rc (large config log data len)", async () => { + const axiom = new QueryBuilderBase(config); + const testFn = async () => { + appendReceipt(axiom, txCache, rcHashesOverMax[1]); + const built = await axiom.buildBase(true); + } + await expect(testFn).rejects.toThrow(); + }, 120000); +}); \ No newline at end of file diff --git a/circuit/test/unit/queryBuilderBase/crosschain.test.ts b/circuit/test/unit/queryBuilderBase/crosschain.test.ts new file mode 100644 index 00000000..3e74f9c1 --- /dev/null +++ b/circuit/test/unit/queryBuilderBase/crosschain.test.ts @@ -0,0 +1,49 @@ +import { bytes32 } from "@axiom-crypto/tools"; +import { + QueryBuilderBase, + QueryBuilderBaseConfig, + AxiomV2Callback, + HeaderField, +} from "../../../src"; + +// Test coverage areas: +// - Crosschain + +describe("Crosschain", () => { + test("Build a query with a different target chain", async () => { + const config: QueryBuilderBaseConfig = { + providerUri: process.env.PROVIDER_URI_SEPOLIA as string, + targetChainId: 5, + version: "v2", + }; + const axiom = new QueryBuilderBase(config); + const blockNumber = 18200000; + const dataQueryReq = [ + { + blockNumber: blockNumber, + fieldIdx: HeaderField.GasUsed, + }, + { + blockNumber: blockNumber + 100, + fieldIdx: HeaderField.GasUsed, + }, + ]; + axiom.append(dataQueryReq); + + await axiom.buildBase(); + const builtQuery = axiom.getBuiltQueryBase(); + if (!builtQuery) { + throw new Error("Query is not built"); + } + + expect(builtQuery.sourceChainId).toEqual("1"); + expect(builtQuery.targetChainId).toEqual("5"); + expect(builtQuery.queryHash).toEqual("0xda1933a884934070a870d18243ec2f1a7efa869966c4cf52d03b179c998a4825"); + expect(builtQuery.dataQueryHash).toEqual("0xfaaac492509be62a2026a769d31140ee49e4b662e56c95251b8ca6ccace0e91b"); + expect(builtQuery.dataQuery).toEqual("0x0000000000000001000200010115b5c00000000a00010115b6240000000a"); + expect(builtQuery.computeQuery.k).toEqual(0); + expect(builtQuery.computeQuery.vkey.length).toEqual(0); + expect(builtQuery.computeQuery.vkey).toEqual([]); + expect(builtQuery.computeQuery.computeProof).toEqual("0x00"); + }); +}); \ No newline at end of file diff --git a/circuit/test/unit/queryBuilderBase/dataQueryCapacitySdk.test.ts b/circuit/test/unit/queryBuilderBase/dataQueryCapacitySdk.test.ts new file mode 100644 index 00000000..889b3558 --- /dev/null +++ b/circuit/test/unit/queryBuilderBase/dataQueryCapacitySdk.test.ts @@ -0,0 +1,393 @@ +import { bytes32, getBlockNumberAndTxIdx } from "@axiom-crypto/tools"; +import { + AccountField, + QueryBuilderBase, + QueryBuilderBaseConfig, + HeaderField, + ReceiptField, + TxField, + Subquery, +} from "../../../src"; +import { ConstantsV2 } from "../../../src/queryBuilderBase/constants"; +import { JsonRpcProvider } from "ethers"; + +// Test coverage areas: +// - DataQuery capacity +// - Appending subqueries + +describe("DataQuery Capacity (SDK-enforced)", () => { + const WETH_ADDR = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"; + const WETH_WHALE = "0x2E15D7AA0650dE1009710FDd45C3468d75AE1392"; + const WSOL_ADDR = "0xd31a59c85ae9d8edefec411d448f90841571b89c"; + const UNI_V3_FACTORY_ADDR = "0x1F98431c8aD98523631AE4a59f267346ea31F984"; + + const config: QueryBuilderBaseConfig = { + providerUri: process.env.PROVIDER_URI_MAINNET as string, + version: "v2", + } + + // mainnet block 18500000 txIdx [0,33) + const validMainnetTxHashes = [ + "0x122f25a52c76682fb0e6b904b3b666e6a9bf5008af0d4c3b474d4e3010c4d5f9", + "0xb0c21cf68a743788c10d759845db5b922c8ac3971b0583d169174f6e2da086f5", + "0xb3fb7ac99ecd6a981a08d94665d08b8303e6b907c33c6562b8226f2ee64e15c5", + "0x35a39c1d1c8ac6f6e8c175de0cdfcb1e9ed7ee4303f2e562f86d2290d93215ba", + "0x1fafb1edf72f30a5db7835421d0869d155d9a4cf53d077ca18b7ec572febdcf8", + "0x080281b5ccd4c6d3210ab08806bdf27cad889e61ed526a6e0636cdc00aa74705", + "0x17c26492b5211cb4fa038f2960319e8bd6e90f9c1e9731534e841d09c4e5c2df", + "0xef9ac5c744f9e1d6c07d02c11c8a2ae5acccf4bb1fc05608d6b025bca2f6b1f5", + "0xd89a3851ceb10019d1613a623e68c187292c05a12d70d8c28c312b2153999c8e", + "0x7e8b9c439e8dca9e660ffa071ccf24dd6a12e20e8d7ad31d50bb059b031c0975", + "0xdd5b8c85fd74861566d38da30a58deef0dcb6a0c7e7b4eeff28102dd227786ff", + "0xd5f40ce15676c81c160f3da5dd09398957a2c6918e32f377c767cdab1bb5bf93", + "0xba4345f28b7c714a478b989a2474cee11a6062d6b9f838cc27bec77c46767bcd", + "0xc94a955a2f8c48dc4f14f4183aff4b23aede06ff7fcd7888b18cb407a707fa74", + "0xb9a9682b520feeaf099b6643dfae9b6432263da5e7469a01276aa39064509031", + "0x741fb87be70e45db2d82d7f5cdbb2e7ef39fb19b5ef4ab544c09b9c83a67c7b7", + "0x1f34e4e287336fa22b3bb950c7933aac122a5add167468a9681265faa963ff40", + "0x2e8e7d7e17a076b0b69dbc188049d02ee983cc066356274cc8f424fa0edc26fd", + "0x87f77e87290836e5174bf340c3a44d78cd033845d32617cdd55bf12136b17233", + "0x5e6e43d3310878616d60b7760f9bd39f0aedcb2c65134738fb5354b9eb35be95", + "0x7355606b0ca4f85467d5c56ea1ae3fcfa2d4f9238cf20bee7a71ada6a889dcd8", + "0x4506010aa2ce63e97a141bacb9e10147b3eeeae53e98a5ef0475c3320c0ad466", + "0x4cbae4bac1cf87cf8f32ada1727950be149ef294a2166310d3f67e574c03c300", + "0xb1724fd30f5d5a77b2199fceac48ce60df66f074d59dcccdb12bcef56b9e4e3e", + "0xc02472f7ef14a9c960defe6ecac170bcb98c24829cc75027c63d7659e9262464", + "0xec2e654d06498ed0f47d68762e862059e3f8971c92b189aee92538db604e4605", + "0x4f46e2c0d19ce1bb1e0cb50bf0e884b13b50f13bdbd92eddcd1676af599545f6", + "0x73a028b6c5a1babdb4081df839b9a7a3bf7c0ada4df14060c670ab25eef89851", + "0x6c9bd68a38d01dc374fc57053b0b9c1737f2611f00254446d5ca3db9dac740b5", + "0x161944cb3d51e7d531ff0f45bcba612dd04a0973cd38e219fc85bbc061e0ab4f", + "0x16b844a564c78386f62ad934474243a9ec97c171cb3bd3080757f677fadea788", + "0xd85e411ae03daa7cf11352795b05a2b1c6bba1cb4144284f510ea379481994a1", + // "0x079fe983f70c4c176e2b15d0fa4392c5a30fc535055d10fca31003cb48037ba0", // 33 + ]; + + const provider = new JsonRpcProvider(process.env.PROVIDER_URI_MAINNET as string); + + test(`Append ${ConstantsV2.UserMaxTotalSubqueries} Header subqueries`, () => { + const axiom = new QueryBuilderBase(config); + const blockNumber = 18000000; + for (let i = 0; i < ConstantsV2.UserMaxTotalSubqueries; i++) { + axiom.appendDataSubquery({ + blockNumber: blockNumber + i, + fieldIdx: HeaderField.Nonce, + } as Subquery); + } + }); + + test(`Append ${ConstantsV2.UserMaxTotalSubqueries + 1} Header subqueries fail`, () => { + const axiom = new QueryBuilderBase(config); + const testFn = () => { + const blockNumber = 18000000; + for (let i = 0; i < ConstantsV2.UserMaxTotalSubqueries + 1; i++) { + axiom.appendDataSubquery({ + blockNumber: blockNumber + i, + fieldIdx: HeaderField.Nonce, + } as Subquery); + } + }; + expect(testFn).toThrow(); + }); + + test(`Append ${ConstantsV2.UserMaxTotalSubqueries} Account subqueries`, () => { + const axiom = new QueryBuilderBase(config); + const blockNumber = 18000000; + for (let i = 0; i < ConstantsV2.UserMaxTotalSubqueries; i++) { + axiom.appendDataSubquery({ + blockNumber: blockNumber + i, + addr: WETH_WHALE, + fieldIdx: AccountField.Balance, + } as Subquery); + } + }); + + test(`Append ${ConstantsV2.UserMaxTotalSubqueries + 1} Account subqueries fail`, () => { + const axiom = new QueryBuilderBase(config); + const testFn = () => { + const blockNumber = 18000000; + for (let i = 0; i < ConstantsV2.UserMaxTotalSubqueries + 1; i++) { + axiom.appendDataSubquery({ + blockNumber: blockNumber + i, + addr: WETH_WHALE, + fieldIdx: AccountField.Balance, + } as Subquery); + } + }; + expect(testFn).toThrow(); + }); + + test(`Append ${ConstantsV2.UserMaxTotalSubqueries} Storage subqueries`, () => { + const axiom = new QueryBuilderBase(config); + const blockNumber = 18000000; + for (let i = 0; i < ConstantsV2.UserMaxTotalSubqueries; i++) { + axiom.appendDataSubquery({ + blockNumber: blockNumber + i, + addr: WETH_ADDR, + slot: 0, + } as Subquery); + } + }); + + test(`Append ${ConstantsV2.UserMaxTotalSubqueries + 1} Storage subqueries fail`, () => { + const axiom = new QueryBuilderBase(config); + const testFn = () => { + const blockNumber = 18000000; + for (let i = 0; i < ConstantsV2.UserMaxTotalSubqueries + 1; i++) { + axiom.appendDataSubquery({ + blockNumber: blockNumber + i, + addr: WETH_ADDR, + slot: 0, + } as Subquery); + } + }; + expect(testFn).toThrow(); + }); + + test(`Append ${ConstantsV2.UserMaxTotalSubqueries} Solidity Nested Mapping subqueries`, () => { + const axiom = new QueryBuilderBase(config); + const blockNumber = 18000000; + for (let i = 0; i < ConstantsV2.UserMaxTotalSubqueries; i++) { + axiom.appendDataSubquery({ + blockNumber: blockNumber + i, + addr: UNI_V3_FACTORY_ADDR, + mappingSlot: 5, + mappingDepth: 3, + keys: [WETH_ADDR, WSOL_ADDR, 10000], + } as Subquery); + } + }); + + test(`Append ${ConstantsV2.UserMaxTotalSubqueries + 1} Solidity Nested Mapping subqueries fail`, () => { + const axiom = new QueryBuilderBase(config); + const testFn = () => { + const blockNumber = 18000000; + for (let i = 0; i < ConstantsV2.UserMaxTotalSubqueries + 1; i++) { + axiom.appendDataSubquery({ + blockNumber: blockNumber + i, + addr: UNI_V3_FACTORY_ADDR, + mappingSlot: 5, + mappingDepth: 3, + keys: [WETH_ADDR, WSOL_ADDR, 10000], + } as Subquery); + } + }; + expect(testFn).toThrow(); + }); + + test(`Append 43 Account + 43 Storage + 42 Nested Mapping subqueries`, () => { + const axiom = new QueryBuilderBase(config); + const blockNumber = 18000000; + for (let i = 0; i < 43; i++) { + axiom.appendDataSubquery({ + blockNumber: blockNumber + i, + addr: WETH_WHALE, + fieldIdx: AccountField.Balance, + } as Subquery); + axiom.appendDataSubquery({ + blockNumber: blockNumber + i, + addr: WETH_ADDR, + slot: 0, + } as Subquery); + if (i === 42) { + continue; + } + axiom.appendDataSubquery({ + blockNumber: blockNumber + i, + addr: UNI_V3_FACTORY_ADDR, + mappingSlot: 5, + mappingDepth: 3, + keys: [WETH_ADDR, WSOL_ADDR, 10000], + } as Subquery); + } + }); + + test(`Append 43 Account + 43 Storage + 43 Nested Mapping subqueries fail`, () => { + const axiom = new QueryBuilderBase(config); + const testFn = () => { + const blockNumber = 18000000; + for (let i = 0; i < 43; i++) { + axiom.appendDataSubquery({ + blockNumber: blockNumber + i, + addr: WETH_WHALE, + field: AccountField.Balance, + } as Subquery); + axiom.appendDataSubquery({ + blockNumber: blockNumber + i, + addr: WETH_ADDR, + slot: 0, + } as Subquery); + axiom.appendDataSubquery({ + blockNumber: blockNumber + i, + addr: UNI_V3_FACTORY_ADDR, + mappingSlot: 5, + keys: [WETH_ADDR, WSOL_ADDR, 10000], + } as Subquery); + } + }; + expect(testFn).toThrow(); + }); + + test(`Append ${ConstantsV2.UserMaxTotalSubqueries} Tx subqueries`, async () => { + const axiom = new QueryBuilderBase(config); + for (let i = 0; i < validMainnetTxHashes.length; i++) { + const { blockNumber, txIdx } = await getBlockNumberAndTxIdx(provider, validMainnetTxHashes[i]); + if (blockNumber === null || txIdx === null) { + throw new Error("blockNumber or txIdx is null"); + } + axiom.appendDataSubquery({ + blockNumber, + txIdx, + fieldOrCalldataIdx: TxField.To, + } as Subquery); + axiom.appendDataSubquery({ + blockNumber, + txIdx, + fieldOrCalldataIdx: TxField.ChainId, + } as Subquery); + axiom.appendDataSubquery({ + blockNumber, + txIdx, + fieldOrCalldataIdx: TxField.GasPrice, + } as Subquery); + axiom.appendDataSubquery({ + blockNumber, + txIdx, + fieldOrCalldataIdx: TxField.Nonce, + } as Subquery); + } + }, 60000); + + test(`Append ${ConstantsV2.UserMaxTotalSubqueries + 1} Tx subqueries fail`, async () => { + const axiom = new QueryBuilderBase(config); + for (let i = 0; i < validMainnetTxHashes.length; i++) { + const { blockNumber, txIdx } = await getBlockNumberAndTxIdx(provider, validMainnetTxHashes[i]); + if (blockNumber === null || txIdx === null) { + throw new Error("blockNumber or txIdx is null"); + } + axiom.appendDataSubquery({ + blockNumber, + txIdx, + fieldOrCalldataIdx: TxField.To, + } as Subquery); + axiom.appendDataSubquery({ + blockNumber, + txIdx, + fieldOrCalldataIdx: TxField.ChainId, + } as Subquery); + axiom.appendDataSubquery({ + blockNumber, + txIdx, + fieldOrCalldataIdx: TxField.GasPrice, + } as Subquery); + axiom.appendDataSubquery({ + blockNumber, + txIdx, + fieldOrCalldataIdx: TxField.Nonce, + } as Subquery); + } + const oneMore = async () => { + const { blockNumber, txIdx } = await getBlockNumberAndTxIdx(provider, validMainnetTxHashes[0]); + if (blockNumber === null || txIdx === null) { + throw new Error("blockNumber or txIdx is null"); + } + axiom.appendDataSubquery({ + blockNumber, + txIdx, + fieldOrCalldataIdx: TxField.To, + } as Subquery); + }; + await expect(oneMore()).rejects.toThrow(); + }, 60000); + + test(`Append ${ConstantsV2.UserMaxTotalSubqueries} Receipt subqueries`, async () => { + const axiom = new QueryBuilderBase(config); + for (let i = 0; i < validMainnetTxHashes.length; i++) { + const { blockNumber, txIdx } = await getBlockNumberAndTxIdx(provider, validMainnetTxHashes[i]); + if (blockNumber === null || txIdx === null) { + throw new Error("blockNumber or txIdx is null"); + } + axiom.appendDataSubquery({ + blockNumber, + txIdx, + fieldOrLogIdx: ReceiptField.Status, + topicOrDataOrAddressIdx: 0, + eventSchema: bytes32(0), + } as Subquery); + axiom.appendDataSubquery({ + blockNumber, + txIdx, + fieldOrLogIdx: ReceiptField.LogsBloom, + topicOrDataOrAddressIdx: 0, + eventSchema: bytes32(0), + } as Subquery); + axiom.appendDataSubquery({ + blockNumber, + txIdx, + fieldOrLogIdx: ReceiptField.Logs, + topicOrDataOrAddressIdx: 0, + eventSchema: bytes32(0), + } as Subquery); + axiom.appendDataSubquery({ + blockNumber, + txIdx, + fieldOrLogIdx: ReceiptField.CumulativeGas, + topicOrDataOrAddressIdx: 0, + eventSchema: bytes32(0), + } as Subquery); + } + }, 60000); + + test(`Append ${ConstantsV2.UserMaxTotalSubqueries + 1} Receipt subqueries fail`, async () => { + const axiom = new QueryBuilderBase(config); + const testFn = async () => { + const txHashes = validMainnetTxHashes.slice(0, ConstantsV2.UserMaxTotalSubqueries + 1); + for (let i = 0; i < ConstantsV2.UserMaxTotalSubqueries + 1; i++) { + const { blockNumber, txIdx } = await getBlockNumberAndTxIdx(provider, txHashes[i]); + if (blockNumber === null || txIdx === null) { + throw new Error("blockNumber or txIdx is null"); + } + axiom.appendDataSubquery({ + blockNumber, + txIdx, + fieldOrLogIdx: ReceiptField.Status, + topicOrDataOrAddressIdx: 0, + eventSchema: bytes32(0), + } as Subquery); + } + }; + await expect(testFn()).rejects.toThrow(); + }, 60000); + + test(`Append ${ConstantsV2.UserMaxTotalSubqueries} subqueries`, async () => { + const axiom = new QueryBuilderBase(config); + + for (let i = 0; i < ConstantsV2.UserMaxTotalSubqueries / 4; i++) { + const { blockNumber, txIdx } = await getBlockNumberAndTxIdx(provider, validMainnetTxHashes[i]); + if (blockNumber === null || txIdx === null) { + throw new Error("blockNumber or txIdx is null"); + } + axiom.appendDataSubquery({ + blockNumber: blockNumber + i, + fieldIdx: HeaderField.Nonce, + } as Subquery); + axiom.appendDataSubquery({ + blockNumber: blockNumber + i, + addr: WETH_WHALE, + fieldIdx: AccountField.Balance, + } as Subquery); + axiom.appendDataSubquery({ + blockNumber, + txIdx, + fieldOrCalldataIdx: TxField.To, + } as Subquery); + axiom.appendDataSubquery({ + blockNumber, + txIdx, + fieldOrLogIdx: ReceiptField.Status, + topicOrDataOrAddressIdx: 0, + eventSchema: bytes32(0), + } as Subquery); + } + }, 60000); +}); diff --git a/circuit/test/unit/queryBuilderBase/dataSubqueryBuilders.test.ts b/circuit/test/unit/queryBuilderBase/dataSubqueryBuilders.test.ts new file mode 100644 index 00000000..a40a3361 --- /dev/null +++ b/circuit/test/unit/queryBuilderBase/dataSubqueryBuilders.test.ts @@ -0,0 +1,253 @@ +import { + AccountField, + HeaderField, + TxField, + getBlockNumberAndTxIdx, + bytes32, + AxiomV2FieldConstant, + TxSubquery, + ReceiptSubquery, + getFieldIdxHeaderLogsBloomIdx, + getEventSchema, + getFieldIdxReceiptLogIdx, + getFieldIdxReceiptLogAddress, + getFieldIdxReceiptLogsBloomIdx, +} from "@axiom-crypto/tools"; +import { + QueryBuilderBase, + QueryBuilderBaseConfig, + HeaderSubquery, + AccountSubquery, + SolidityNestedMappingSubquery, + StorageSubquery, + Subquery, +} from "../../../src"; +import { ethers } from "ethers"; + +// Test coverage areas: +// - DataQuery subquery builders +// - DataQuery subquery types + +describe("Data Subquery Builders", () => { + const WETH_ADDR = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2".toLowerCase(); + const WETH_WHALE = "0x2E15D7AA0650dE1009710FDd45C3468d75AE1392".toLowerCase(); + + const provider = new ethers.JsonRpcProvider(process.env.PROVIDER_URI_MAINNET as string); + const blockNumber = 18000000; + + const config: QueryBuilderBaseConfig = { + providerUri: process.env.PROVIDER_URI_MAINNET as string, + sourceChainId: 1, + version: "v2", + }; + + test("Build and append a header subquery", () => { + const axiom = new QueryBuilderBase(config); + axiom.appendDataSubquery({ + blockNumber: blockNumber, + fieldIdx: HeaderField.GasUsed, + } as Subquery); + const dataQuery = axiom.getDataQuery(); + + const subquery = dataQuery?.[0] as HeaderSubquery; + expect(subquery?.blockNumber).toEqual(blockNumber); + expect(subquery?.fieldIdx).toEqual(HeaderField.GasUsed); + }); + + test("Build and append a header logsBloom subquery", () => { + const axiom = new QueryBuilderBase(config); + axiom.appendDataSubquery({ + blockNumber: blockNumber, + fieldIdx: getFieldIdxHeaderLogsBloomIdx(2), + } as Subquery); + const dataQuery = axiom.getDataQuery(); + + const subquery = dataQuery?.[0] as HeaderSubquery; + expect(subquery?.blockNumber).toEqual(blockNumber); + expect(subquery?.fieldIdx).toEqual(AxiomV2FieldConstant.Header.LogsBloomFieldIdxOffset + 2); + }); + + test("Build and append an account subquery", () => { + const axiom = new QueryBuilderBase(config); + axiom.appendDataSubquery({ + blockNumber: blockNumber, + addr: WETH_WHALE, + fieldIdx: AccountField.Balance, + } as Subquery); + const dataQuery = axiom.getDataQuery(); + + const subquery = dataQuery?.[0] as AccountSubquery; + expect(subquery?.blockNumber).toEqual(blockNumber); + expect(subquery?.addr).toEqual(WETH_WHALE); + expect(subquery?.fieldIdx).toEqual(AccountField.Balance); + }); + + test("Build and append a storage subquery", () => { + const axiom = new QueryBuilderBase(config); + axiom.appendDataSubquery({ + blockNumber: blockNumber, + addr: WETH_ADDR, + slot: 1, + } as Subquery); + const dataQuery = axiom.getDataQuery(); + + const subquery = dataQuery?.[0] as StorageSubquery; + expect(subquery?.blockNumber).toEqual(blockNumber); + expect(subquery?.addr).toEqual(WETH_ADDR); + expect(subquery?.slot).toEqual(1); + }); + + test("Build and append a tx subquery", async () => { + const axiom = new QueryBuilderBase(config); + const txHash = "0x8d2e6cbd7cf1f88ee174600f31b79382e0028e239bb1af8301ba6fc782758bc6"; + const { blockNumber, txIdx } = await getBlockNumberAndTxIdx(provider, txHash); + if (blockNumber === null || txIdx === null) { + throw new Error("Failed to get block number and tx idx"); + } + axiom.appendDataSubquery({ + blockNumber: blockNumber, + txIdx: txIdx, + fieldOrCalldataIdx: TxField.MaxPriorityFeePerGas, + } as Subquery); + const dataQuery = axiom.getDataQuery(); + + // Check the unbuilt subquery + const subquery = dataQuery?.[0] as TxSubquery; + expect(subquery?.blockNumber).toEqual(blockNumber); + expect(subquery?.txIdx).toEqual(txIdx); + expect(subquery?.fieldOrCalldataIdx).toEqual(2); + + // Build the Query and validate the built subquery + const built = await axiom.buildBase(); + const builtSubquery = built.dataQueryStruct.subqueries?.[0].subqueryData as TxSubquery; + expect(builtSubquery?.blockNumber).toEqual(blockNumber); + expect(builtSubquery?.txIdx).toEqual(txIdx); + expect(builtSubquery?.fieldOrCalldataIdx).toEqual(2); + }); + + test("Build and append a receipt subquery", async () => { + const axiom = new QueryBuilderBase(config); + const txHash = "0x8d2e6cbd7cf1f88ee174600f31b79382e0028e239bb1af8301ba6fc782758bc6"; + const { blockNumber, txIdx } = await getBlockNumberAndTxIdx(provider, txHash); + if (blockNumber === null || txIdx === null) { + throw new Error("Failed to get block number and tx idx"); + } + axiom.appendDataSubquery({ + blockNumber: blockNumber, + txIdx: txIdx, + fieldOrLogIdx: getFieldIdxReceiptLogIdx(0), + topicOrDataOrAddressIdx: 1, + eventSchema: getEventSchema("Transfer (address from, address to, uint256 value)"), + } as Subquery); + const dataQuery = axiom.getDataQuery(); + + // Check the unbuilt subquery + const subquery = dataQuery?.[0] as ReceiptSubquery; + expect(subquery?.blockNumber).toEqual(blockNumber); + expect(subquery?.txIdx).toEqual(txIdx); + expect(subquery?.fieldOrLogIdx).toEqual(100); + expect(subquery?.topicOrDataOrAddressIdx).toEqual(1); + expect(subquery?.eventSchema).toEqual("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"); + + // Build the Query and validate the built subquery + const built = await axiom.buildBase(); + const builtSubquery = built.dataQueryStruct.subqueries?.[0].subqueryData as ReceiptSubquery; + expect(builtSubquery?.blockNumber).toEqual(blockNumber); + expect(builtSubquery?.txIdx).toEqual(txIdx); + expect(builtSubquery?.fieldOrLogIdx).toEqual(100); + expect(builtSubquery?.topicOrDataOrAddressIdx).toEqual(1); + expect(builtSubquery?.eventSchema).toEqual("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"); + }); + + test("Build and append a receipt log address subquery", async () => { + const axiom = new QueryBuilderBase(config); + const txHash = "0x8d2e6cbd7cf1f88ee174600f31b79382e0028e239bb1af8301ba6fc782758bc6"; + const { blockNumber, txIdx } = await getBlockNumberAndTxIdx(provider, txHash); + if (blockNumber === null || txIdx === null) { + throw new Error("Failed to get block number and tx idx"); + } + axiom.appendDataSubquery({ + blockNumber: blockNumber, + txIdx: txIdx, + fieldOrLogIdx: getFieldIdxReceiptLogIdx(0), + topicOrDataOrAddressIdx: getFieldIdxReceiptLogAddress(), + eventSchema: bytes32(0), + } as Subquery); + const dataQuery = axiom.getDataQuery(); + + // Check the unbuilt subquery + const subquery = dataQuery?.[0] as ReceiptSubquery; + expect(subquery?.blockNumber).toEqual(blockNumber); + expect(subquery?.txIdx).toEqual(txIdx); + expect(subquery?.fieldOrLogIdx).toEqual(100); + expect(subquery?.topicOrDataOrAddressIdx).toEqual(50); + expect(subquery?.eventSchema).toEqual(bytes32(0)); + + // Build the Query and validate the built subquery + const built = await axiom.buildBase(); + const builtSubquery = built.dataQueryStruct.subqueries?.[0].subqueryData as ReceiptSubquery; + expect(builtSubquery?.blockNumber).toEqual(blockNumber); + expect(builtSubquery?.txIdx).toEqual(txIdx); + expect(builtSubquery?.fieldOrLogIdx).toEqual(100); + expect(builtSubquery?.topicOrDataOrAddressIdx).toEqual(50); + expect(builtSubquery?.eventSchema).toEqual(bytes32(0)); + }); + + test("Build and append a receipt logsBloom subquery", async () => { + const axiom = new QueryBuilderBase(config); + + const txHash = "0x8d2e6cbd7cf1f88ee174600f31b79382e0028e239bb1af8301ba6fc782758bc6"; + const { blockNumber, txIdx } = await getBlockNumberAndTxIdx(provider, txHash); + axiom.appendDataSubquery({ + blockNumber: blockNumber, + txIdx: txIdx, + fieldOrLogIdx: getFieldIdxReceiptLogsBloomIdx(2), + topicOrDataOrAddressIdx: 0, + eventSchema: bytes32(0), + } as Subquery); + const dataQuery = axiom.getDataQuery(); + + // Check the unbuilt subquery + const subquery = dataQuery?.[0] as ReceiptSubquery; + expect(subquery?.blockNumber).toEqual(blockNumber); + expect(subquery?.txIdx).toEqual(txIdx); + expect(subquery?.fieldOrLogIdx).toEqual(AxiomV2FieldConstant.Receipt.LogsBloomIdxOffset + 2); + + // Build the Query and validate the built subquery + const built = await axiom.buildBase(); + const builtSubquery = built.dataQueryStruct.subqueries?.[0].subqueryData as ReceiptSubquery; + expect(builtSubquery?.blockNumber).toEqual(blockNumber); + expect(builtSubquery?.txIdx).toEqual(txIdx); + expect(builtSubquery?.fieldOrLogIdx).toEqual(AxiomV2FieldConstant.Receipt.LogsBloomIdxOffset + 2); + expect(builtSubquery?.topicOrDataOrAddressIdx).toEqual(0); + expect(builtSubquery?.eventSchema).toEqual(bytes32(0)); + }); + + test("Build and append a nested mapping subquery", async () => { + const axiom = new QueryBuilderBase(config); + axiom.appendDataSubquery({ + blockNumber: blockNumber, + addr: WETH_ADDR, + mappingSlot: 0, + mappingDepth: 3, + keys: [WETH_ADDR, WETH_WHALE, 100000], + } as Subquery); + const dataQuery = axiom.getDataQuery(); + + const subquery = dataQuery?.[0] as SolidityNestedMappingSubquery; + expect(subquery?.blockNumber).toEqual(blockNumber); + expect(subquery?.addr).toEqual(WETH_ADDR); + expect(subquery?.mappingSlot).toEqual(0); + expect(subquery?.mappingDepth).toEqual(3); + expect(subquery?.keys).toEqual([WETH_ADDR, WETH_WHALE, 100000]); + + // Build the Query and validate the built subquery + const built = await axiom.buildBase(); + const builtSubquery = built.dataQueryStruct.subqueries?.[0].subqueryData as SolidityNestedMappingSubquery; + expect(builtSubquery?.blockNumber).toEqual(blockNumber); + expect(builtSubquery?.addr).toEqual(WETH_ADDR); + expect(builtSubquery?.mappingSlot).toEqual(0); + expect(builtSubquery?.mappingDepth).toEqual(3); + expect(builtSubquery?.keys).toEqual([bytes32(WETH_ADDR), bytes32(WETH_WHALE), bytes32(100000)]); + }); +}); diff --git a/circuit/test/unit/queryBuilderBase/validate.test.ts b/circuit/test/unit/queryBuilderBase/validate.test.ts new file mode 100644 index 00000000..572e79d6 --- /dev/null +++ b/circuit/test/unit/queryBuilderBase/validate.test.ts @@ -0,0 +1,187 @@ +import { getSlotForMapping, HeaderField, AccountField, TxField, getBlockNumberAndTxIdx, getFieldIdxTxCalldataIdx, getFieldIdxTxContractDataIdx, getEventSchema, getFieldIdxReceiptLogIdx } from "@axiom-crypto/tools"; +import { + QueryBuilderBase, + QueryBuilderBaseConfig, + Subquery, +} from "../../../src"; +import { ethers } from "ethers"; + +describe("Query Validation Tests", () => { + const WETH_ADDR = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"; + const WSOL_ADDR = "0xd31a59c85ae9d8edefec411d448f90841571b89c"; + const WETH_WHALE = "0x2E15D7AA0650dE1009710FDd45C3468d75AE1392"; + const UNI_V3_FACTORY_ADDR = "0x1F98431c8aD98523631AE4a59f267346ea31F984"; + + const provider = new ethers.JsonRpcProvider(process.env.PROVIDER_URI_MAINNET as string); + const sepoliaProvider = new ethers.JsonRpcProvider(process.env.PROVIDER_URI_SEPOLIA as string); + + const config: QueryBuilderBaseConfig = { + providerUri: process.env.PROVIDER_URI_MAINNET as string, + version: "v2", + sourceChainId: 1, + }; + const sepoliaConfig = { + providerUri: process.env.PROVIDER_URI_SEPOLIA as string, + version: "v2", + sourceChainId: "11155111", + }; + + test("Validate pass: Header subquery", async () => { + const axiom = new QueryBuilderBase(config); + axiom.appendDataSubquery({ + blockNumber: 17000000, + fieldIdx: HeaderField.GasUsed, + } as Subquery); + const isValid = await axiom.validate(); + expect(isValid).toEqual(true); + }); + + test("Validate pass: Account subquery", async () => { + const axiom = new QueryBuilderBase(config); + const subquery = { + blockNumber: 18000000, + addr: WETH_WHALE, + fieldIdx: AccountField.Balance + }; + axiom.appendDataSubquery(subquery); + const isValid = await axiom.validate(); + expect(isValid).toEqual(true); + }); + + test("Validate pass: Storage subquery", async () => { + const axiom = new QueryBuilderBase(config); + const slot = getSlotForMapping("3", "address", WETH_WHALE); + const subquery = { + blockNumber: 18000000, + addr: WETH_ADDR, + slot: slot + }; + axiom.appendDataSubquery(subquery); + const isValid = await axiom.validate(); + expect(isValid).toEqual(true); + }); + + test("Validate pass: Tx subquery", async () => { + const axiom = new QueryBuilderBase(config); + const txHash = "0x8d2e6cbd7cf1f88ee174600f31b79382e0028e239bb1af8301ba6fc782758bc6"; + const { blockNumber, txIdx } = await getBlockNumberAndTxIdx(provider, txHash); + if (blockNumber === null || txIdx === null) { + throw new Error("Failed to get block number and tx idx"); + } + const subquery = { + blockNumber, + txIdx, + fieldOrCalldataIdx: TxField.To + }; + axiom.appendDataSubquery(subquery); + const isValid = await axiom.validate(); + expect(isValid).toEqual(true); + }); + + test("Validate pass: Tx subquery calldata", async () => { + const axiom = new QueryBuilderBase(config); + const txHash = "0x192bc136b4637e0c31dc80b7c4e8cd63328c7c411ba8574af1841ed2c4a6dd80"; + const { blockNumber, txIdx } = await getBlockNumberAndTxIdx(provider, txHash); + if (blockNumber === null || txIdx === null) { + throw new Error("Failed to get block number and tx idx"); + } + const subquery = { + blockNumber, + txIdx, + fieldOrCalldataIdx: getFieldIdxTxCalldataIdx(0), + }; + axiom.appendDataSubquery(subquery); + const isValid = await axiom.validate(); + expect(isValid).toEqual(true); + }); + + test("Validate pass: Larger Tx subquery contractData", async () => { + const axiom = new QueryBuilderBase(config); + const txHash = "0xc9ef13429be1a3f44c75af95c4e2ac2083a3469e2751a42a04fcdace94ff98a5"; + const { blockNumber, txIdx } = await getBlockNumberAndTxIdx(provider, txHash); + if (blockNumber === null || txIdx === null) { + throw new Error("Failed to get block number and tx idx"); + } + const subquery = { + blockNumber, + txIdx, + fieldOrCalldataIdx: getFieldIdxTxContractDataIdx(0), + }; + axiom.appendDataSubquery(subquery); + const isValid = await axiom.validate(); + expect(isValid).toEqual(true); + }); + + test("Validate pass: Receipt subquery", async () => { + const axiom = new QueryBuilderBase(config); + const txHash = "0x8d2e6cbd7cf1f88ee174600f31b79382e0028e239bb1af8301ba6fc782758bc6"; + const { blockNumber, txIdx } = await getBlockNumberAndTxIdx(provider, txHash); + if (blockNumber === null || txIdx === null) { + throw new Error("Failed to get block number and tx idx"); + } + const subquery = { + blockNumber, + txIdx, + fieldOrLogIdx: getFieldIdxReceiptLogIdx(0), + topicOrDataOrAddressIdx: 1, + eventSchema: getEventSchema("Transfer(address,address,uint256)"), + }; + axiom.appendDataSubquery(subquery); + const isValid = await axiom.validate(); + expect(isValid).toEqual(true); + }); + + test("Validate pass: Solidity nested mapping subquery", async () => { + const axiom = new QueryBuilderBase(config); + const subquery = { + blockNumber: 17000000, + addr: UNI_V3_FACTORY_ADDR, + mappingSlot: 5, + mappingDepth: 3, + keys: [WETH_ADDR, WSOL_ADDR, 10000] + }; + axiom.appendDataSubquery(subquery); + const isValid = await axiom.validate(); + expect(isValid).toEqual(true); + }); + + test("Validate fail: Header subquery", async () => { + const axiom = new QueryBuilderBase(config); + const testFn = async () => { + const subquery = { + // Fail test case: blockNumber is an address + blockNumber: "0x2E15D7AA0650dE1009710FDd45C3468d75AE1392", + fieldIdx: HeaderField.Miner + } as unknown as Subquery; + axiom.appendDataSubquery(subquery); + await axiom.validate(); + }; + await expect(testFn()).rejects.toThrow(); + }); + + test("Validate fail: type 3 tx subquery", async () => { + const axiom = new QueryBuilderBase(sepoliaConfig); + const sepoliaTransactions = [ + // type 3 + "0x8fd091f4b5b1b17431110afa99fbd9cabdabecb92a1315afa458fc3dcb91efde", + "0x95ea8f5b10f8ac9f48943ac32014705a10c76d54551391f1ed34c72c6c28fa83", + "0x48c6fcfd6cbc753938d486cb33711b63d4330b48371a7919648c9e1506d6b6e9", + "0xbdb6eb8982db0695f6685840d01667d9c7beb5140b96e6af38c346c6a0de2edf", + "0xaeac36b485d4c6672f6d7337ab8015b0d4483724151dfda88214c0e4fd675542", + ]; + + for (const txHash of sepoliaTransactions) { + const { blockNumber, txIdx } = await getBlockNumberAndTxIdx(sepoliaProvider, txHash); + if (blockNumber === null || txIdx === null) { + throw new Error("Failed to get block number and tx idx"); + } + axiom.appendDataSubquery({ + blockNumber, + txIdx, + fieldOrCalldataIdx: TxField.To + } as Subquery); + const isValid = await axiom.validate(); + expect(isValid).toEqual(false); + } + }); +}); diff --git a/client/package.json b/client/package.json index 112e89fa..06a71f90 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "@axiom-crypto/client", - "version": "2.0.8", + "version": "2.0.9", "author": "Intrinsic Technologies", "license": "MIT", "description": "Client SDK to write custom queries for Axiom, the ZK Coprocessor for Ethereum.", @@ -25,20 +25,20 @@ ], "dependencies": { "@axiom-crypto/circuit": "link:../circuit/dist", - "@axiom-crypto/core": "2.3.8", "chalk": "^4.1.2", "commander": "^11.1.0", "prompts": "^2.4.2", - "viem": "^2.3.1" + "viem": "2.8.18" }, "devDependencies": { "@axiom-crypto/halo2-lib-js": "^0.3.4", - "@axiom-crypto/tools": "2.1.0", + "@axiom-crypto/tools": "2.1.1", "@types/jest": "^29.5.11", "@types/node": "18.15.13", "@types/prompts": "^2.4.9", "dotenv": "^16.4.5", "dts-bundle-generator": "^9.0.0", + "ethers": "^6.11.1", "jest": "^29.7.0", "ts-jest": "^29.1.1", "tslib": "^2.6.2", diff --git a/client/pnpm-lock.yaml b/client/pnpm-lock.yaml index 6fdca2e9..c0633ee5 100644 --- a/client/pnpm-lock.yaml +++ b/client/pnpm-lock.yaml @@ -8,9 +8,6 @@ dependencies: '@axiom-crypto/circuit': specifier: link:../circuit/dist version: link:../circuit/dist - '@axiom-crypto/core': - specifier: 2.3.8 - version: 2.3.8 chalk: specifier: ^4.1.2 version: 4.1.2 @@ -21,16 +18,16 @@ dependencies: specifier: ^2.4.2 version: 2.4.2 viem: - specifier: ^2.3.1 - version: 2.7.14(typescript@5.3.3) + specifier: 2.8.18 + version: 2.8.18(typescript@5.4.5) devDependencies: '@axiom-crypto/halo2-lib-js': specifier: ^0.3.4 version: 0.3.4 '@axiom-crypto/tools': - specifier: 2.1.0 - version: 2.1.0 + specifier: 2.1.1 + version: 2.1.1 '@types/jest': specifier: ^29.5.11 version: 29.5.12 @@ -45,22 +42,25 @@ devDependencies: version: 16.4.5 dts-bundle-generator: specifier: ^9.0.0 - version: 9.3.1 + version: 9.4.0 + ethers: + specifier: ^6.11.1 + version: 6.12.0 jest: specifier: ^29.7.0 version: 29.7.0(@types/node@18.15.13) ts-jest: specifier: ^29.1.1 - version: 29.1.2(@babel/core@7.23.9)(jest@29.7.0)(typescript@5.3.3) + version: 29.1.2(@babel/core@7.24.4)(jest@29.7.0)(typescript@5.4.5) tslib: specifier: ^2.6.2 version: 2.6.2 tsx: specifier: ^4.6.2 - version: 4.7.1 + version: 4.7.2 typescript: specifier: ^5.3.2 - version: 5.3.3 + version: 5.4.5 packages: @@ -70,34 +70,21 @@ packages: /@adraffy/ens-normalize@1.10.1: resolution: {integrity: sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==} + dev: true - /@ampproject/remapping@2.2.1: - resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} + /@ampproject/remapping@2.3.0: + resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} dependencies: - '@jridgewell/gen-mapping': 0.3.4 - '@jridgewell/trace-mapping': 0.3.23 + '@jridgewell/gen-mapping': 0.3.5 + '@jridgewell/trace-mapping': 0.3.25 dev: true - /@axiom-crypto/core@2.3.8: - resolution: {integrity: sha512-WpokNTai2C/JK26CUSo14XPy2Vh/IqhAQsNDuMMvXn0gMonYJ0DSffpJtMZ78xCi2WH2Q1K91Bjd2f66XPH01g==} - dependencies: - '@axiom-crypto/tools': 2.1.0 - axios: 1.6.7 - bs58: 5.0.0 - ethers: 6.11.1 - merkletreejs: 0.3.11 - transitivePeerDependencies: - - bufferutil - - debug - - utf-8-validate - dev: false - /@axiom-crypto/halo2-lib-js@0.3.4: resolution: {integrity: sha512-E/i7EqlcvjcfXZejL8HcpvFQIIMJxcMrVBXsdaDJGgEXVc6pEDJ07Hy3drLbhQ007ZJ8aultw3HSfD9gJRkh4w==} dependencies: '@axiom-crypto/halo2-wasm': 0.3.4 - ethers: 6.11.1 + ethers: 6.12.0 prettier: 1.18.2 transitivePeerDependencies: - bufferutil @@ -108,45 +95,46 @@ packages: resolution: {integrity: sha512-SUHXnydtx5rY0gQ2zWy0Br6L3iaAFo5RH/AMnOCSM4Nb3inqinBEnXQgEPZ45+EFmeOfRi1xOVUBdo6keZlacQ==} dev: true - /@axiom-crypto/tools@2.1.0: - resolution: {integrity: sha512-kuW4y+OcbHoYviCBNnpbkCYd4FRaewFMitq5N5CDOdt4CNHamlQ2HNxLU00t2yD3oFZyjmMRVU4aGLkFoyNSAg==} + /@axiom-crypto/tools@2.1.1: + resolution: {integrity: sha512-JqKz+S8wIOqoa42h5TMoPCNxatLEoJwOYabFUB1GWSkQ/Ep3ZPDP5ydk/ky3VeDG/KFidBa0/uvVQk5EEK/Rpw==} dependencies: - axios: 1.6.7 + axios: 1.6.8 bs58: 5.0.0 - ethers: 6.11.1 + ethers: 6.12.0 form-data: 4.0.0 transitivePeerDependencies: - bufferutil - debug - utf-8-validate + dev: true - /@babel/code-frame@7.23.5: - resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==} + /@babel/code-frame@7.24.2: + resolution: {integrity: sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/highlight': 7.23.4 - chalk: 2.4.2 + '@babel/highlight': 7.24.2 + picocolors: 1.0.0 dev: true - /@babel/compat-data@7.23.5: - resolution: {integrity: sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==} + /@babel/compat-data@7.24.4: + resolution: {integrity: sha512-vg8Gih2MLK+kOkHJp4gBEIkyaIi00jgWot2D9QOmmfLC8jINSOzmCLta6Bvz/JSBCqnegV0L80jhxkol5GWNfQ==} engines: {node: '>=6.9.0'} dev: true - /@babel/core@7.23.9: - resolution: {integrity: sha512-5q0175NOjddqpvvzU+kDiSOAk4PfdO6FvwCWoQ6RO7rTzEe8vlo+4HVfcnAREhD4npMs0e9uZypjTwzZPCf/cw==} + /@babel/core@7.24.4: + resolution: {integrity: sha512-MBVlMXP+kkl5394RBLSxxk/iLTeVGuXTV3cIDXavPpMMqnSnt6apKgan/U8O3USWZCWZT/TbgfEpKa4uMgN4Dg==} engines: {node: '>=6.9.0'} dependencies: - '@ampproject/remapping': 2.2.1 - '@babel/code-frame': 7.23.5 - '@babel/generator': 7.23.6 + '@ampproject/remapping': 2.3.0 + '@babel/code-frame': 7.24.2 + '@babel/generator': 7.24.4 '@babel/helper-compilation-targets': 7.23.6 - '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.9) - '@babel/helpers': 7.23.9 - '@babel/parser': 7.23.9 - '@babel/template': 7.23.9 - '@babel/traverse': 7.23.9 - '@babel/types': 7.23.9 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.24.4) + '@babel/helpers': 7.24.4 + '@babel/parser': 7.24.4 + '@babel/template': 7.24.0 + '@babel/traverse': 7.24.1 + '@babel/types': 7.24.0 convert-source-map: 2.0.0 debug: 4.3.4 gensync: 1.0.0-beta.2 @@ -156,13 +144,13 @@ packages: - supports-color dev: true - /@babel/generator@7.23.6: - resolution: {integrity: sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==} + /@babel/generator@7.24.4: + resolution: {integrity: sha512-Xd6+v6SnjWVx/nus+y0l1sxMOTOMBkyL4+BIdbALyatQnAe/SRVjANeDPSCYaX+i1iJmuGSKf3Z+E+V/va1Hvw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.9 - '@jridgewell/gen-mapping': 0.3.4 - '@jridgewell/trace-mapping': 0.3.23 + '@babel/types': 7.24.0 + '@jridgewell/gen-mapping': 0.3.5 + '@jridgewell/trace-mapping': 0.3.25 jsesc: 2.5.2 dev: true @@ -170,7 +158,7 @@ packages: resolution: {integrity: sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/compat-data': 7.23.5 + '@babel/compat-data': 7.24.4 '@babel/helper-validator-option': 7.23.5 browserslist: 4.23.0 lru-cache: 5.1.1 @@ -186,40 +174,40 @@ packages: resolution: {integrity: sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/template': 7.23.9 - '@babel/types': 7.23.9 + '@babel/template': 7.24.0 + '@babel/types': 7.24.0 dev: true /@babel/helper-hoist-variables@7.22.5: resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.9 + '@babel/types': 7.24.0 dev: true - /@babel/helper-module-imports@7.22.15: - resolution: {integrity: sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==} + /@babel/helper-module-imports@7.24.3: + resolution: {integrity: sha512-viKb0F9f2s0BCS22QSF308z/+1YWKV/76mwt61NBzS5izMzDPwdq1pTrzf+Li3npBWX9KdQbkeCt1jSAM7lZqg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.9 + '@babel/types': 7.24.0 dev: true - /@babel/helper-module-transforms@7.23.3(@babel/core@7.23.9): + /@babel/helper-module-transforms@7.23.3(@babel/core@7.24.4): resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.4 '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-module-imports': 7.22.15 + '@babel/helper-module-imports': 7.24.3 '@babel/helper-simple-access': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 '@babel/helper-validator-identifier': 7.22.20 dev: true - /@babel/helper-plugin-utils@7.22.5: - resolution: {integrity: sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==} + /@babel/helper-plugin-utils@7.24.0: + resolution: {integrity: sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==} engines: {node: '>=6.9.0'} dev: true @@ -227,18 +215,18 @@ packages: resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.9 + '@babel/types': 7.24.0 dev: true /@babel/helper-split-export-declaration@7.22.6: resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.9 + '@babel/types': 7.24.0 dev: true - /@babel/helper-string-parser@7.23.4: - resolution: {integrity: sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==} + /@babel/helper-string-parser@7.24.1: + resolution: {integrity: sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==} engines: {node: '>=6.9.0'} dev: true @@ -252,195 +240,196 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/helpers@7.23.9: - resolution: {integrity: sha512-87ICKgU5t5SzOT7sBMfCOZQ2rHjRU+Pcb9BoILMYz600W6DkVRLFBPwQ18gwUVvggqXivaUakpnxWQGbpywbBQ==} + /@babel/helpers@7.24.4: + resolution: {integrity: sha512-FewdlZbSiwaVGlgT1DPANDuCHaDMiOo+D/IDYRFYjHOuv66xMSJ7fQwwODwRNAPkADIO/z1EoF/l2BCWlWABDw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/template': 7.23.9 - '@babel/traverse': 7.23.9 - '@babel/types': 7.23.9 + '@babel/template': 7.24.0 + '@babel/traverse': 7.24.1 + '@babel/types': 7.24.0 transitivePeerDependencies: - supports-color dev: true - /@babel/highlight@7.23.4: - resolution: {integrity: sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==} + /@babel/highlight@7.24.2: + resolution: {integrity: sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-validator-identifier': 7.22.20 chalk: 2.4.2 js-tokens: 4.0.0 + picocolors: 1.0.0 dev: true - /@babel/parser@7.23.9: - resolution: {integrity: sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==} + /@babel/parser@7.24.4: + resolution: {integrity: sha512-zTvEBcghmeBma9QIGunWevvBAp4/Qu9Bdq+2k0Ot4fVMD6v3dsC9WOcRSKk7tRRyBM/53yKMJko9xOatGQAwSg==} engines: {node: '>=6.0.0'} hasBin: true dependencies: - '@babel/types': 7.23.9 + '@babel/types': 7.24.0 dev: true - /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.23.9): + /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.24.4): resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/core': 7.24.4 + '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.23.9): + /@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.24.4): resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/core': 7.24.4 + '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.23.9): + /@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.24.4): resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/core': 7.24.4 + '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.23.9): + /@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.24.4): resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/core': 7.24.4 + '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.23.9): + /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.24.4): resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/core': 7.24.4 + '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-syntax-jsx@7.23.3(@babel/core@7.23.9): - resolution: {integrity: sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==} + /@babel/plugin-syntax-jsx@7.24.1(@babel/core@7.24.4): + resolution: {integrity: sha512-2eCtxZXf+kbkMIsXS4poTvT4Yu5rXiRa+9xGVT56raghjmBTKMpFNc9R4IDiB4emao9eO22Ox7CxuJG7BgExqA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/core': 7.24.4 + '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.23.9): + /@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.24.4): resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/core': 7.24.4 + '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.23.9): + /@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.24.4): resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/core': 7.24.4 + '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.23.9): + /@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.24.4): resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/core': 7.24.4 + '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.23.9): + /@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.24.4): resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/core': 7.24.4 + '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.23.9): + /@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.24.4): resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/core': 7.24.4 + '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.23.9): + /@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.24.4): resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/core': 7.24.4 + '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.23.9): + /@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.24.4): resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/core': 7.24.4 + '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-syntax-typescript@7.23.3(@babel/core@7.23.9): - resolution: {integrity: sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ==} + /@babel/plugin-syntax-typescript@7.24.1(@babel/core@7.24.4): + resolution: {integrity: sha512-Yhnmvy5HZEnHUty6i++gcfH1/l68AHnItFHnaCv6hn9dNh0hQvvQJsxpi4BMBFN5DLeHBuucT/0DgzXif/OyRw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.23.9 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/core': 7.24.4 + '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/template@7.23.9: - resolution: {integrity: sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA==} + /@babel/template@7.24.0: + resolution: {integrity: sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.23.5 - '@babel/parser': 7.23.9 - '@babel/types': 7.23.9 + '@babel/code-frame': 7.24.2 + '@babel/parser': 7.24.4 + '@babel/types': 7.24.0 dev: true - /@babel/traverse@7.23.9: - resolution: {integrity: sha512-I/4UJ9vs90OkBtY6iiiTORVMyIhJ4kAVmsKo9KFc8UOxMeUfi2hvtIBsET5u9GizXE6/GFSuKCTNfgCswuEjRg==} + /@babel/traverse@7.24.1: + resolution: {integrity: sha512-xuU6o9m68KeqZbQuDt2TcKSxUw/mrsvavlEqQ1leZ/B+C9tk6E4sRWy97WaXgvq5E+nU3cXMxv3WKOCanVMCmQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.23.5 - '@babel/generator': 7.23.6 + '@babel/code-frame': 7.24.2 + '@babel/generator': 7.24.4 '@babel/helper-environment-visitor': 7.22.20 '@babel/helper-function-name': 7.23.0 '@babel/helper-hoist-variables': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 - '@babel/parser': 7.23.9 - '@babel/types': 7.23.9 + '@babel/parser': 7.24.4 + '@babel/types': 7.24.0 debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: - supports-color dev: true - /@babel/types@7.23.9: - resolution: {integrity: sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==} + /@babel/types@7.24.0: + resolution: {integrity: sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-string-parser': 7.23.4 + '@babel/helper-string-parser': 7.24.1 '@babel/helper-validator-identifier': 7.22.20 to-fast-properties: 2.0.0 dev: true @@ -656,21 +645,6 @@ packages: dev: true optional: true - /@ethereumjs/rlp@4.0.1: - resolution: {integrity: sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw==} - engines: {node: '>=14'} - hasBin: true - dev: false - - /@ethereumjs/util@8.1.0: - resolution: {integrity: sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==} - engines: {node: '>=14'} - dependencies: - '@ethereumjs/rlp': 4.0.1 - ethereum-cryptography: 2.1.3 - micro-ftch: 0.3.1 - dev: false - /@istanbuljs/load-nyc-config@1.1.0: resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} engines: {node: '>=8'} @@ -807,7 +781,7 @@ packages: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@jridgewell/trace-mapping': 0.3.23 + '@jridgewell/trace-mapping': 0.3.25 '@types/node': 18.15.13 chalk: 4.1.2 collect-v8-coverage: 1.0.2 @@ -841,7 +815,7 @@ packages: resolution: {integrity: sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jridgewell/trace-mapping': 0.3.23 + '@jridgewell/trace-mapping': 0.3.25 callsites: 3.1.0 graceful-fs: 4.2.11 dev: true @@ -870,9 +844,9 @@ packages: resolution: {integrity: sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.4 '@jest/types': 29.6.3 - '@jridgewell/trace-mapping': 0.3.23 + '@jridgewell/trace-mapping': 0.3.25 babel-plugin-istanbul: 6.1.1 chalk: 4.1.2 convert-source-map: 2.0.0 @@ -901,13 +875,13 @@ packages: chalk: 4.1.2 dev: true - /@jridgewell/gen-mapping@0.3.4: - resolution: {integrity: sha512-Oud2QPM5dHviZNn4y/WhhYKSXksv+1xLEIsNrAbGcFzUN3ubqWRFT5gwPchNc5NuzILOU4tPBDTZ4VwhL8Y7cw==} + /@jridgewell/gen-mapping@0.3.5: + resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} engines: {node: '>=6.0.0'} dependencies: - '@jridgewell/set-array': 1.1.2 + '@jridgewell/set-array': 1.2.1 '@jridgewell/sourcemap-codec': 1.4.15 - '@jridgewell/trace-mapping': 0.3.23 + '@jridgewell/trace-mapping': 0.3.25 dev: true /@jridgewell/resolve-uri@3.1.2: @@ -915,8 +889,8 @@ packages: engines: {node: '>=6.0.0'} dev: true - /@jridgewell/set-array@1.1.2: - resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} + /@jridgewell/set-array@1.2.1: + resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} engines: {node: '>=6.0.0'} dev: true @@ -924,8 +898,8 @@ packages: resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} dev: true - /@jridgewell/trace-mapping@0.3.23: - resolution: {integrity: sha512-9/4foRoUKp8s96tSkh8DlAAc5A0Ty8vLXld+l9gjKKY6ckwI8G15f0hskGmuLZu78ZlGa1vtsfOa+lnB4vG6Jg==} + /@jridgewell/trace-mapping@0.3.25: + resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} dependencies: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.4.15 @@ -936,23 +910,12 @@ packages: dependencies: '@noble/hashes': 1.3.2 - /@noble/curves@1.3.0: - resolution: {integrity: sha512-t01iSXPuN+Eqzb4eBX0S5oubSqXbK/xXa1Ne18Hj8f9pStxztHCE2gfboSp/dZRLSqfuLpRK2nDXDK+W9puocA==} - dependencies: - '@noble/hashes': 1.3.3 - dev: false - /@noble/hashes@1.3.2: resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} engines: {node: '>= 16'} - /@noble/hashes@1.3.3: - resolution: {integrity: sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==} - engines: {node: '>= 16'} - dev: false - - /@scure/base@1.1.5: - resolution: {integrity: sha512-Brj9FiG2W1MRQSTB212YVPRrcbjkv48FoZi/u4l/zds/ieRrqsh7aUf6CLwkAq61oKXr/ZlTzlY66gLIj3TFTQ==} + /@scure/base@1.1.6: + resolution: {integrity: sha512-ok9AWwhcgYuGG3Zfhyqg+zwl+Wn5uE+dwC0NV/2qQkx4dABbb/bx96vWu8NSj+BNjjSjno+JRYRjle1jV08k3g==} dev: false /@scure/bip32@1.3.2: @@ -960,29 +923,14 @@ packages: dependencies: '@noble/curves': 1.2.0 '@noble/hashes': 1.3.2 - '@scure/base': 1.1.5 - dev: false - - /@scure/bip32@1.3.3: - resolution: {integrity: sha512-LJaN3HwRbfQK0X1xFSi0Q9amqOgzQnnDngIt+ZlsBC3Bm7/nE7K0kwshZHyaru79yIVRv/e1mQAjZyuZG6jOFQ==} - dependencies: - '@noble/curves': 1.3.0 - '@noble/hashes': 1.3.3 - '@scure/base': 1.1.5 + '@scure/base': 1.1.6 dev: false /@scure/bip39@1.2.1: resolution: {integrity: sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==} dependencies: '@noble/hashes': 1.3.2 - '@scure/base': 1.1.5 - dev: false - - /@scure/bip39@1.2.2: - resolution: {integrity: sha512-HYf9TUXG80beW+hGAt3TRM8wU6pQoYur9iNypTROm42dorCGmLnFe3eWjz3gOq6G62H2WRh0FCzAR1PI+29zIA==} - dependencies: - '@noble/hashes': 1.3.3 - '@scure/base': 1.1.5 + '@scure/base': 1.1.6 dev: false /@sinclair/typebox@0.27.8: @@ -1004,8 +952,8 @@ packages: /@types/babel__core@7.20.5: resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} dependencies: - '@babel/parser': 7.23.9 - '@babel/types': 7.23.9 + '@babel/parser': 7.24.4 + '@babel/types': 7.24.0 '@types/babel__generator': 7.6.8 '@types/babel__template': 7.4.4 '@types/babel__traverse': 7.20.5 @@ -1014,20 +962,20 @@ packages: /@types/babel__generator@7.6.8: resolution: {integrity: sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==} dependencies: - '@babel/types': 7.23.9 + '@babel/types': 7.24.0 dev: true /@types/babel__template@7.4.4: resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} dependencies: - '@babel/parser': 7.23.9 - '@babel/types': 7.23.9 + '@babel/parser': 7.24.4 + '@babel/types': 7.24.0 dev: true /@types/babel__traverse@7.20.5: resolution: {integrity: sha512-WXCyOcRtH37HAUkpXhUduaxdm82b4GSlyTqajXviN4EfiuPgNYR109xMCKvpl6zPIpua0DGlMEDCq+g8EdoheQ==} dependencies: - '@babel/types': 7.23.9 + '@babel/types': 7.24.0 dev: true /@types/graceful-fs@4.1.9: @@ -1061,6 +1009,7 @@ packages: /@types/node@18.15.13: resolution: {integrity: sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==} + dev: true /@types/prompts@2.4.9: resolution: {integrity: sha512-qTxFi6Buiu8+50/+3DGIWLHM6QuWsEKugJnnP6iv2Mc4ncxE4A/OJkjuVOA+5X0X1S/nq5VJRa8Lu+nwcvbrKA==} @@ -1083,7 +1032,7 @@ packages: '@types/yargs-parser': 21.0.3 dev: true - /abitype@1.0.0(typescript@5.3.3): + /abitype@1.0.0(typescript@5.4.5): resolution: {integrity: sha512-NMeMah//6bJ56H5XRj8QCV4AwuW6hB6zqz2LnhhLdcWVQOsXki6/Pn3APeqxCma62nXIcmZWdu1DlHWS74umVQ==} peerDependencies: typescript: '>=5.0.4' @@ -1094,11 +1043,12 @@ packages: zod: optional: true dependencies: - typescript: 5.3.3 + typescript: 5.4.5 dev: false /aes-js@4.0.0-beta.5: resolution: {integrity: sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==} + dev: true /ansi-escapes@4.3.2: resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} @@ -1146,27 +1096,29 @@ packages: /asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + dev: true - /axios@1.6.7: - resolution: {integrity: sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==} + /axios@1.6.8: + resolution: {integrity: sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==} dependencies: follow-redirects: 1.15.6 form-data: 4.0.0 proxy-from-env: 1.1.0 transitivePeerDependencies: - debug + dev: true - /babel-jest@29.7.0(@babel/core@7.23.9): + /babel-jest@29.7.0(@babel/core@7.24.4): resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.8.0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.4 '@jest/transform': 29.7.0 '@types/babel__core': 7.20.5 babel-plugin-istanbul: 6.1.1 - babel-preset-jest: 29.6.3(@babel/core@7.23.9) + babel-preset-jest: 29.6.3(@babel/core@7.24.4) chalk: 4.1.2 graceful-fs: 4.2.11 slash: 3.0.0 @@ -1178,7 +1130,7 @@ packages: resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==} engines: {node: '>=8'} dependencies: - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-plugin-utils': 7.24.0 '@istanbuljs/load-nyc-config': 1.1.0 '@istanbuljs/schema': 0.1.3 istanbul-lib-instrument: 5.2.1 @@ -1191,41 +1143,41 @@ packages: resolution: {integrity: sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@babel/template': 7.23.9 - '@babel/types': 7.23.9 + '@babel/template': 7.24.0 + '@babel/types': 7.24.0 '@types/babel__core': 7.20.5 '@types/babel__traverse': 7.20.5 dev: true - /babel-preset-current-node-syntax@1.0.1(@babel/core@7.23.9): + /babel-preset-current-node-syntax@1.0.1(@babel/core@7.24.4): resolution: {integrity: sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.23.9 - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.23.9) - '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.23.9) - '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.23.9) - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.23.9) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.23.9) - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.23.9) - '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.23.9) - dev: true - - /babel-preset-jest@29.6.3(@babel/core@7.23.9): + '@babel/core': 7.24.4 + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.24.4) + '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.24.4) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.24.4) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.24.4) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.24.4) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.24.4) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.24.4) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.24.4) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.24.4) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.24.4) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.4) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.24.4) + dev: true + + /babel-preset-jest@29.6.3(@babel/core@7.24.4): resolution: {integrity: sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.4 babel-plugin-jest-hoist: 29.6.3 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.23.9) + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.4) dev: true /balanced-match@1.0.2: @@ -1234,18 +1186,7 @@ packages: /base-x@4.0.0: resolution: {integrity: sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==} - - /bignumber.js@9.1.2: - resolution: {integrity: sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==} - dev: false - - /bn.js@4.11.6: - resolution: {integrity: sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA==} - dev: false - - /bn.js@5.2.1: - resolution: {integrity: sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==} - dev: false + dev: true /brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} @@ -1266,8 +1207,8 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001589 - electron-to-chromium: 1.4.681 + caniuse-lite: 1.0.30001610 + electron-to-chromium: 1.4.738 node-releases: 2.0.14 update-browserslist-db: 1.0.13(browserslist@4.23.0) dev: true @@ -1283,6 +1224,7 @@ packages: resolution: {integrity: sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==} dependencies: base-x: 4.0.0 + dev: true /bser@2.1.1: resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} @@ -1294,10 +1236,6 @@ packages: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} dev: true - /buffer-reverse@1.0.1: - resolution: {integrity: sha512-M87YIUBsZ6N924W57vDwT/aOu8hw7ZgdByz6ijksLjmHJELBASmYTTlNHRgjE+pTsT9oJXGaDSgqqwfdHotDUg==} - dev: false - /callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} @@ -1313,8 +1251,8 @@ packages: engines: {node: '>=10'} dev: true - /caniuse-lite@1.0.30001589: - resolution: {integrity: sha512-vNQWS6kI+q6sBlHbh71IIeC+sRwK2N3EDySc/updIGhIee2x5z00J4c1242/5/d6EpEMdOnk/m+6tuk4/tcsqg==} + /caniuse-lite@1.0.30001610: + resolution: {integrity: sha512-QFutAY4NgaelojVMjY63o6XlZyORPaLfyMnsl3HgnWdJUcX6K0oaJymHjH8PT5Gk7sTm8rvC/c5COUQKXqmOMA==} dev: true /chalk@2.4.2: @@ -1389,6 +1327,7 @@ packages: engines: {node: '>= 0.8'} dependencies: delayed-stream: 1.0.0 + dev: true /commander@11.1.0: resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==} @@ -1431,10 +1370,6 @@ packages: which: 2.0.2 dev: true - /crypto-js@4.2.0: - resolution: {integrity: sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==} - dev: false - /debug@4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} @@ -1447,8 +1382,8 @@ packages: ms: 2.1.2 dev: true - /dedent@1.5.1: - resolution: {integrity: sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==} + /dedent@1.5.3: + resolution: {integrity: sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ==} peerDependencies: babel-plugin-macros: ^3.1.0 peerDependenciesMeta: @@ -1464,6 +1399,7 @@ packages: /delayed-stream@1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} + dev: true /detect-newline@3.1.0: resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} @@ -1480,17 +1416,17 @@ packages: engines: {node: '>=12'} dev: true - /dts-bundle-generator@9.3.1: - resolution: {integrity: sha512-1/nMT7LFOkXbrL1ZvLpzrjNbfX090LZ64nLIXVmet557mshFCGP/oTiQiZenafJZ6GsmRQLTYKSlQnkxK8tsTw==} + /dts-bundle-generator@9.4.0: + resolution: {integrity: sha512-XncfIDd3QMZLAQcXqHUd1GrNHFzPSSwJBVmsY7cyrSIgY2K+vr46Nrjw5x9jmvxivR7YNFUWrPMLn8OD0OEwAg==} engines: {node: '>=14.0.0'} hasBin: true dependencies: - typescript: 5.3.3 + typescript: 5.4.5 yargs: 17.7.2 dev: true - /electron-to-chromium@1.4.681: - resolution: {integrity: sha512-1PpuqJUFWoXZ1E54m8bsLPVYwIVCRzvaL+n5cjigGga4z854abDnFRc+cTa2th4S79kyGqya/1xoR7h+Y5G5lg==} + /electron-to-chromium@1.4.738: + resolution: {integrity: sha512-lwKft2CLFztD+vEIpesrOtCrko/TFnEJlHFdRhazU7Y/jx5qc4cqsocfVrBg4So4gGe9lvxnbLIoev47WMpg+A==} dev: true /emittery@0.13.1: @@ -1560,23 +1496,8 @@ packages: hasBin: true dev: true - /ethereum-bloom-filters@1.0.10: - resolution: {integrity: sha512-rxJ5OFN3RwjQxDcFP2Z5+Q9ho4eIdEmSc2ht0fCu8Se9nbXjZ7/031uXoUYJ87KHCOdVeiUuwSnoS7hmYAGVHA==} - dependencies: - js-sha3: 0.8.0 - dev: false - - /ethereum-cryptography@2.1.3: - resolution: {integrity: sha512-BlwbIL7/P45W8FGW2r7LGuvoEZ+7PWsniMvQ4p5s2xCyw9tmaDlpfsN9HjAucbF+t/qpVHwZUisgfK24TCW8aA==} - dependencies: - '@noble/curves': 1.3.0 - '@noble/hashes': 1.3.3 - '@scure/bip32': 1.3.3 - '@scure/bip39': 1.2.2 - dev: false - - /ethers@6.11.1: - resolution: {integrity: sha512-mxTAE6wqJQAbp5QAe/+o+rXOID7Nw91OZXvgpjDa1r4fAbq2Nu314oEZSbjoRLacuCzs7kUC3clEvkCQowffGg==} + /ethers@6.12.0: + resolution: {integrity: sha512-zL5NlOTjML239gIvtVJuaSk0N9GQLi1Hom3ZWUszE5lDTQE/IVB62mrPkQ2W1bGcZwVGSLaetQbWNQSvI4rGDQ==} engines: {node: '>=14.0.0'} dependencies: '@adraffy/ens-normalize': 1.10.1 @@ -1589,14 +1510,7 @@ packages: transitivePeerDependencies: - bufferutil - utf-8-validate - - /ethjs-unit@0.1.6: - resolution: {integrity: sha512-/Sn9Y0oKl0uqQuvgFk/zQgR7aw1g36qX/jzSQ5lSwlO0GigPymk4eGQfeNTD03w1dPOqfz8V77Cy43jH56pagw==} - engines: {node: '>=6.5.0', npm: '>=3'} - dependencies: - bn.js: 4.11.6 - number-to-bn: 1.7.0 - dev: false + dev: true /execa@5.1.1: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} @@ -1662,6 +1576,7 @@ packages: peerDependenciesMeta: debug: optional: true + dev: true /form-data@4.0.0: resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} @@ -1670,6 +1585,7 @@ packages: asynckit: 0.4.0 combined-stream: 1.0.8 mime-types: 2.1.35 + dev: true /fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} @@ -1707,8 +1623,8 @@ packages: engines: {node: '>=10'} dev: true - /get-tsconfig@4.7.2: - resolution: {integrity: sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==} + /get-tsconfig@4.7.3: + resolution: {integrity: sha512-ZvkrzoUA0PQZM6fy6+/Hce561s+faD1rsNwhnO5FelNjyy7EMGJ3Rz1AQ8GYDWjhRs/7dBLOEJvhK8MiEJOAFg==} dependencies: resolve-pkg-maps: 1.0.0 dev: true @@ -1742,8 +1658,8 @@ packages: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} - /hasown@2.0.1: - resolution: {integrity: sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==} + /hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} dependencies: function-bind: 1.1.2 @@ -1790,7 +1706,7 @@ packages: /is-core-module@2.13.1: resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} dependencies: - hasown: 2.0.1 + hasown: 2.0.2 dev: true /is-fullwidth-code-point@3.0.0: @@ -1803,11 +1719,6 @@ packages: engines: {node: '>=6'} dev: true - /is-hex-prefixed@1.0.0: - resolution: {integrity: sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==} - engines: {node: '>=6.5.0', npm: '>=3'} - dev: false - /is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} @@ -1839,8 +1750,8 @@ packages: resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} engines: {node: '>=8'} dependencies: - '@babel/core': 7.23.9 - '@babel/parser': 7.23.9 + '@babel/core': 7.24.4 + '@babel/parser': 7.24.4 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.2 semver: 6.3.1 @@ -1852,8 +1763,8 @@ packages: resolution: {integrity: sha512-1WUsZ9R1lA0HtBSohTkm39WTPlNKSJ5iFk7UwqXkBLoHQT+hfqPsfsTDVuZdKGaBwn7din9bS7SsnoAr943hvw==} engines: {node: '>=10'} dependencies: - '@babel/core': 7.23.9 - '@babel/parser': 7.23.9 + '@babel/core': 7.24.4 + '@babel/parser': 7.24.4 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.2 semver: 7.6.0 @@ -1909,7 +1820,7 @@ packages: '@types/node': 18.15.13 chalk: 4.1.2 co: 4.6.0 - dedent: 1.5.1 + dedent: 1.5.3 is-generator-fn: 2.1.0 jest-each: 29.7.0 jest-matcher-utils: 29.7.0 @@ -1919,7 +1830,7 @@ packages: jest-util: 29.7.0 p-limit: 3.1.0 pretty-format: 29.7.0 - pure-rand: 6.0.4 + pure-rand: 6.1.0 slash: 3.0.0 stack-utils: 2.0.6 transitivePeerDependencies: @@ -1967,11 +1878,11 @@ packages: ts-node: optional: true dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.4 '@jest/test-sequencer': 29.7.0 '@jest/types': 29.6.3 '@types/node': 18.15.13 - babel-jest: 29.7.0(@babel/core@7.23.9) + babel-jest: 29.7.0(@babel/core@7.24.4) chalk: 4.1.2 ci-info: 3.9.0 deepmerge: 4.3.1 @@ -2081,7 +1992,7 @@ packages: resolution: {integrity: sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@babel/code-frame': 7.23.5 + '@babel/code-frame': 7.24.2 '@jest/types': 29.6.3 '@types/stack-utils': 2.0.3 chalk: 4.1.2 @@ -2206,15 +2117,15 @@ packages: resolution: {integrity: sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@babel/core': 7.23.9 - '@babel/generator': 7.23.6 - '@babel/plugin-syntax-jsx': 7.23.3(@babel/core@7.23.9) - '@babel/plugin-syntax-typescript': 7.23.3(@babel/core@7.23.9) - '@babel/types': 7.23.9 + '@babel/core': 7.24.4 + '@babel/generator': 7.24.4 + '@babel/plugin-syntax-jsx': 7.24.1(@babel/core@7.24.4) + '@babel/plugin-syntax-typescript': 7.24.1(@babel/core@7.24.4) + '@babel/types': 7.24.0 '@jest/expect-utils': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.23.9) + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.4) chalk: 4.1.2 expect: 29.7.0 graceful-fs: 4.2.11 @@ -2299,10 +2210,6 @@ packages: - ts-node dev: true - /js-sha3@0.8.0: - resolution: {integrity: sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==} - dev: false - /js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} dev: true @@ -2389,21 +2296,6 @@ packages: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} dev: true - /merkletreejs@0.3.11: - resolution: {integrity: sha512-LJKTl4iVNTndhL+3Uz/tfkjD0klIWsHlUzgtuNnNrsf7bAlXR30m+xYB7lHr5Z/l6e/yAIsr26Dabx6Buo4VGQ==} - engines: {node: '>= 7.6.0'} - dependencies: - bignumber.js: 9.1.2 - buffer-reverse: 1.0.1 - crypto-js: 4.2.0 - treeify: 1.1.0 - web3-utils: 1.10.4 - dev: false - - /micro-ftch@0.3.1: - resolution: {integrity: sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg==} - dev: false - /micromatch@4.0.5: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} engines: {node: '>=8.6'} @@ -2415,12 +2307,14 @@ packages: /mime-db@1.52.0: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} engines: {node: '>= 0.6'} + dev: true /mime-types@2.1.35: resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} engines: {node: '>= 0.6'} dependencies: mime-db: 1.52.0 + dev: true /mimic-fn@2.1.0: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} @@ -2461,14 +2355,6 @@ packages: path-key: 3.1.1 dev: true - /number-to-bn@1.7.0: - resolution: {integrity: sha512-wsJ9gfSz1/s4ZsJN01lyonwuxA1tml6X1yBDnfpMglypcBRFZZkus26EdPSlqS5GJfYddVZa22p3VNb3z5m5Ig==} - engines: {node: '>=6.5.0', npm: '>=3'} - dependencies: - bn.js: 4.11.6 - strip-hex-prefix: 1.0.0 - dev: false - /once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} dependencies: @@ -2512,7 +2398,7 @@ packages: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} dependencies: - '@babel/code-frame': 7.23.5 + '@babel/code-frame': 7.24.2 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -2582,16 +2468,11 @@ packages: /proxy-from-env@1.1.0: resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - /pure-rand@6.0.4: - resolution: {integrity: sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==} dev: true - /randombytes@2.1.0: - resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} - dependencies: - safe-buffer: 5.2.1 - dev: false + /pure-rand@6.1.0: + resolution: {integrity: sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==} + dev: true /react-is@18.2.0: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} @@ -2632,10 +2513,6 @@ packages: supports-preserve-symlinks-flag: 1.0.0 dev: true - /safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - dev: false - /semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true @@ -2730,13 +2607,6 @@ packages: engines: {node: '>=6'} dev: true - /strip-hex-prefix@1.0.0: - resolution: {integrity: sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A==} - engines: {node: '>=6.5.0', npm: '>=3'} - dependencies: - is-hex-prefixed: 1.0.0 - dev: false - /strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} @@ -2792,12 +2662,7 @@ packages: is-number: 7.0.0 dev: true - /treeify@1.1.0: - resolution: {integrity: sha512-1m4RA7xVAJrSGrrXGs0L3YTwyvBs2S8PbRHaLZAkFw7JR8oIFwYtysxlBZhYIa7xSyiYJKZ3iGrrk55cGA3i9A==} - engines: {node: '>=0.6'} - dev: false - - /ts-jest@29.1.2(@babel/core@7.23.9)(jest@29.7.0)(typescript@5.3.3): + /ts-jest@29.1.2(@babel/core@7.24.4)(jest@29.7.0)(typescript@5.4.5): resolution: {integrity: sha512-br6GJoH/WUX4pu7FbZXuWGKGNDuU7b8Uj77g/Sp7puZV6EXzuByl6JrECvm0MzVzSTkSHWTihsXt+5XYER5b+g==} engines: {node: ^16.10.0 || ^18.0.0 || >=20.0.0} hasBin: true @@ -2818,7 +2683,7 @@ packages: esbuild: optional: true dependencies: - '@babel/core': 7.23.9 + '@babel/core': 7.24.4 bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 jest: 29.7.0(@types/node@18.15.13) @@ -2827,24 +2692,25 @@ packages: lodash.memoize: 4.1.2 make-error: 1.3.6 semver: 7.6.0 - typescript: 5.3.3 + typescript: 5.4.5 yargs-parser: 21.1.1 dev: true /tslib@2.4.0: resolution: {integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==} + dev: true /tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} dev: true - /tsx@4.7.1: - resolution: {integrity: sha512-8d6VuibXHtlN5E3zFkgY8u4DX7Y3Z27zvvPKVmLon/D4AjuKzarkUBTLDBgj9iTQ0hg5xM7c/mYiRVM+HETf0g==} + /tsx@4.7.2: + resolution: {integrity: sha512-BCNd4kz6fz12fyrgCTEdZHGJ9fWTGeUzXmQysh0RVocDY3h4frk05ZNCXSy4kIenF7y/QnrdiVpTsyNRn6vlAw==} engines: {node: '>=18.0.0'} hasBin: true dependencies: esbuild: 0.19.12 - get-tsconfig: 4.7.2 + get-tsconfig: 4.7.3 optionalDependencies: fsevents: 2.3.3 dev: true @@ -2859,8 +2725,8 @@ packages: engines: {node: '>=10'} dev: true - /typescript@5.3.3: - resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} + /typescript@5.4.5: + resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} engines: {node: '>=14.17'} hasBin: true @@ -2875,21 +2741,17 @@ packages: picocolors: 1.0.0 dev: true - /utf8@3.0.0: - resolution: {integrity: sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==} - dev: false - /v8-to-istanbul@9.2.0: resolution: {integrity: sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==} engines: {node: '>=10.12.0'} dependencies: - '@jridgewell/trace-mapping': 0.3.23 + '@jridgewell/trace-mapping': 0.3.25 '@types/istanbul-lib-coverage': 2.0.6 convert-source-map: 2.0.0 dev: true - /viem@2.7.14(typescript@5.3.3): - resolution: {integrity: sha512-5b1KB1gXli02GOQHZIUsRluNUwssl2t4hqdFAzyWPwJ744N83jAOBOjOkrGz7K3qMIv9b0GQt3DoZIErSQTPkQ==} + /viem@2.8.18(typescript@5.4.5): + resolution: {integrity: sha512-Kq3kwkKziJ8rQeLkmdbSLheHDnA+tx2EdLKLmQ3N4FVtjKYjBP9tPL1r+fI6KltVUM1TDOhIHOdslDSp57VMMg==} peerDependencies: typescript: '>=5.0.4' peerDependenciesMeta: @@ -2901,9 +2763,9 @@ packages: '@noble/hashes': 1.3.2 '@scure/bip32': 1.3.2 '@scure/bip39': 1.2.1 - abitype: 1.0.0(typescript@5.3.3) + abitype: 1.0.0(typescript@5.4.5) isows: 1.0.3(ws@8.13.0) - typescript: 5.3.3 + typescript: 5.4.5 ws: 8.13.0 transitivePeerDependencies: - bufferutil @@ -2917,20 +2779,6 @@ packages: makeerror: 1.0.12 dev: true - /web3-utils@1.10.4: - resolution: {integrity: sha512-tsu8FiKJLk2PzhDl9fXbGUWTkkVXYhtTA+SmEFkKft+9BgwLxfCRpU96sWv7ICC8zixBNd3JURVoiR3dUXgP8A==} - engines: {node: '>=8.0.0'} - dependencies: - '@ethereumjs/util': 8.1.0 - bn.js: 5.2.1 - ethereum-bloom-filters: 1.0.10 - ethereum-cryptography: 2.1.3 - ethjs-unit: 0.1.6 - number-to-bn: 1.7.0 - randombytes: 2.1.0 - utf8: 3.0.0 - dev: false - /which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -2984,6 +2832,7 @@ packages: optional: true utf-8-validate: optional: true + dev: true /y18n@5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} diff --git a/client/src/axiom/axiom.ts b/client/src/axiom/axiom.ts index 60f99b9d..ad695cf7 100644 --- a/client/src/axiom/axiom.ts +++ b/client/src/axiom/axiom.ts @@ -1,15 +1,27 @@ import { AxiomCircuit } from "../js"; import { + AxiomV2Callback, AxiomV2ClientConfig, - AxiomV2ClientOptions, + AxiomV2QueryOptions, AxiomV2CompiledCircuit, AxiomV2SendQueryArgs, } from "../types"; -import { AxiomV2CircuitCapacity, UserInput, DEFAULT_CAPACITY } from "@axiom-crypto/circuit"; +import { + AxiomV2CircuitCapacity, + UserInput, + DEFAULT_CAPACITY, + DataSubquery, +} from "@axiom-crypto/circuit"; import { validateChainId } from "./utils"; -import { PublicClient, TransactionReceipt, WalletClient, createPublicClient, createWalletClient, http } from "viem"; +import { + PublicClient, + TransactionReceipt, + WalletClient, + createPublicClient, + createWalletClient, + http, +} from "viem"; import { privateKeyToAccount } from 'viem/accounts' -import { AxiomV2Callback } from "@axiom-crypto/core"; import { viemChain } from "../lib"; import { getChainDefaults } from "../lib/chain"; @@ -18,7 +30,7 @@ export class Axiom { protected axiomCircuit: AxiomCircuit; protected compiledCircuit: AxiomV2CompiledCircuit; protected callback: AxiomV2Callback; - protected options?: AxiomV2ClientOptions; + protected options?: AxiomV2QueryOptions; protected capacity?: AxiomV2CircuitCapacity; protected publicClient: PublicClient; protected walletClient?: WalletClient; @@ -27,7 +39,7 @@ export class Axiom { constructor(config: AxiomV2ClientConfig) { this.config = config; this.compiledCircuit = config.compiledCircuit; - this.capacity = config.capacity ?? DEFAULT_CAPACITY; + this.capacity = config.capacity ?? config.compiledCircuit.capacity ?? DEFAULT_CAPACITY; this.callback = { target: config.callback.target, extraData: config.callback.extraData ?? "0x", @@ -43,7 +55,7 @@ export class Axiom { provider: this.config.provider, inputSchema: config.compiledCircuit.inputSchema, chainId: this.config.chainId, - capacity: this.capacity ?? this.compiledCircuit.capacity ?? DEFAULT_CAPACITY, + capacity: this.capacity, }); const publicClient = createPublicClient({ @@ -68,16 +80,24 @@ export class Axiom { async init() { await this.axiomCircuit.loadSaved({ config: this.compiledCircuit.config, - capacity: this.capacity ?? this.compiledCircuit.capacity ?? DEFAULT_CAPACITY, + capacity: this.capacity, vk: this.compiledCircuit.vk, }); } + getOptions(): AxiomV2QueryOptions | undefined { + return this.options; + } + + getDataQuery(): DataSubquery[] { + return this.axiomCircuit.getDataQuery(); + } + getSendQueryArgs(): AxiomV2SendQueryArgs | undefined { return this.sendQueryArgs; } - setOptions(options: AxiomV2ClientOptions) { + setOptions(options: AxiomV2QueryOptions) { this.options = { ...this.options, ...options, @@ -161,10 +181,10 @@ export class Axiom { if (this.walletClient === undefined) { throw new Error("Setting `privateKey` in the `Axiom` constructor is required to get sendQuery args"); } - const clientOptions: AxiomV2ClientOptions = { + const options: AxiomV2QueryOptions = { ...this.options, callbackGasLimit: this.options?.callbackGasLimit ?? Number(getChainDefaults(this.config.chainId).callbackGasLimit), - refundee: this.options?.refundee ?? this.walletClient?.account?.address, + refundee: this.options?.refundee, overrides: this.options?.overrides, }; @@ -172,7 +192,7 @@ export class Axiom { callbackTarget: this.callback.target, callbackExtraData: this.callback.extraData ?? "0x", callerAddress: this.walletClient?.account?.address, - options: clientOptions, + options, }); return this.sendQueryArgs; diff --git a/client/src/axiom/index.ts b/client/src/axiom/index.ts index c0491423..8ce85a8e 100644 --- a/client/src/axiom/index.ts +++ b/client/src/axiom/index.ts @@ -1 +1 @@ -export * from './axiom'; \ No newline at end of file +export * from './axiom'; diff --git a/client/src/axiom/utils.ts b/client/src/axiom/utils.ts index 1c65d0f4..5c96b9d6 100644 --- a/client/src/axiom/utils.ts +++ b/client/src/axiom/utils.ts @@ -1,10 +1,11 @@ import { - AxiomSdkCore, AxiomV2Callback, AxiomV2ComputeQuery, AxiomV2FeeData, +} from "@axiom-crypto/circuit"; +import { getByteLength, -} from "@axiom-crypto/core"; +} from "@axiom-crypto/circuit/pkg/tools"; import { AbiType, AxiomV2ClientOverrides, AxiomV2SendQueryArgsParams, CircuitInputType } from "../types"; import { createPublicClient, http } from 'viem'; import { getAxiomV2Abi, getAxiomV2QueryAddress, viemChain } from "../lib"; @@ -68,16 +69,19 @@ export function argsObjToArr( ] } -export async function getMaxFeePerGas(axiom: AxiomSdkCore, overrides?: AxiomV2ClientOverrides): Promise { - const chainId = axiom.config.chainId.toString(); +export async function getMaxFeePerGas( + chainId: string, + providerUri: string, + overrides?: AxiomV2ClientOverrides +): Promise { const axiomQueryAddress = overrides?.queryAddress ?? getAxiomV2QueryAddress(chainId); - - const providerFeeData = await axiom.config.provider.getFeeData(); - const providerMaxFeePerGas = providerFeeData.maxFeePerGas ?? 0n; + const publicClient = createPublicClient({ - chain: viemChain(axiom.config.chainId.toString(), axiom.config.providerUri), - transport: http(axiom.config.providerUri), + chain: viemChain(chainId, providerUri), + transport: http(providerUri), }); + const providerFeeData = await publicClient.estimateFeesPerGas(); + const providerMaxFeePerGas = providerFeeData.maxFeePerGas ?? 0n; try { let contractMinMaxFeePerGas = await publicClient.readContract({ @@ -110,4 +114,4 @@ export async function getMaxFeePerGas(axiom: AxiomSdkCore, overrides?: AxiomV2Cl console.log(`Unable to read minMaxFeePerGas from contract, returning default value of ${defaultMinMaxFeePerGas}`); return defaultMinMaxFeePerGas; } -} \ No newline at end of file +} diff --git a/client/src/cli/index.ts b/client/src/cli/index.ts index af37b66c..c5cd7d5a 100644 --- a/client/src/cli/index.ts +++ b/client/src/cli/index.ts @@ -31,7 +31,9 @@ circuit .option("-p, --provider [provider]", "JSON-RPC provider (https)") .option("-o, --outputs [outputs]", "outputs json file") .option("-f, --function [function]", "function name in typescript circuit") - .option("--cache [cache]", "cache output file") + .option("-c, --cache [cache]", "cache output file") + .option("-d, --defaultInputs [defaultInputs]", "default inputs json file") + .option("--force", "force compilation even if output file exists") .action(compile); circuit @@ -44,7 +46,7 @@ circuit .option("-st, --stats", "print stats") .option("-p, --provider [provider]", "JSON-RPC provider (https)") .option("-o, --outputs [outputs]", "outputs json file") - .option("--cache [cache]", "cache input file") + .option("-c, --cache [cache]", "cache input file") .action(prove); circuit diff --git a/client/src/cli/queryParams.ts b/client/src/cli/queryParams.ts index 2e90e48b..854b2656 100644 --- a/client/src/cli/queryParams.ts +++ b/client/src/cli/queryParams.ts @@ -1,5 +1,4 @@ import path from 'path'; -import { AxiomSdkCore } from "@axiom-crypto/core"; import { getProvider, readJsonFromFile, saveJsonToFile } from "./utils"; import { buildSendQuery } from "../sendQuery"; import { argsArrToObj } from '../axiom/utils'; @@ -33,28 +32,23 @@ export const queryParams = async ( } console.log(`Reading proven circuit JSON from: ${provenFile}`) const provenJson = readJsonFromFile(provenFile); - const provider = getProvider(options.provider); - const axiom = new AxiomSdkCore({ - providerUri: provider, - chainId: options.sourceChainId, - version: "v2", - mock: options.mock ?? false, - }); + const providerUri = getProvider(options.provider); try { let build = await buildSendQuery({ - axiom, + chainId: options.sourceChainId, + providerUri, dataQuery: provenJson.dataQuery, computeQuery: provenJson.computeQuery, callback: { target: callbackTarget, extraData: options.callbackExtraData ?? "0x", }, + caller: options.caller ?? options.refundAddress, + mock: options.mock ?? false, options: { - refundee: options.refundAddress, maxFeePerGas: options.maxFeePerGas, callbackGasLimit: options.callbackGasLimit, }, - caller: options.caller ?? options.refundAddress, }); build.value = build.value.toString() as any; const res = { diff --git a/client/src/index.ts b/client/src/index.ts index 17db35ba..da48fe9f 100644 --- a/client/src/index.ts +++ b/client/src/index.ts @@ -2,4 +2,5 @@ export * from './axiom'; export * from "./sendQuery"; export * from "./types"; export * from "./lib"; -export * from "@axiom-crypto/circuit"; \ No newline at end of file +export * from "./queryBuilderClient"; +export * from "@axiom-crypto/circuit"; diff --git a/client/src/js/index.ts b/client/src/js/index.ts index 85cb02fe..670be986 100644 --- a/client/src/js/index.ts +++ b/client/src/js/index.ts @@ -1,8 +1,7 @@ +import { AxiomV2Callback, AxiomV2CircuitCapacity } from "@axiom-crypto/circuit"; import { AxiomBaseCircuit } from "@axiom-crypto/circuit/js/"; -import { AxiomV2Callback } from "@axiom-crypto/core"; import { buildSendQuery } from "../sendQuery"; -import { AxiomV2CircuitCapacity } from "@axiom-crypto/circuit/types"; -import { AxiomV2ClientOptions, AxiomV2SendQueryArgs } from "../types"; +import { AxiomV2QueryOptions, AxiomV2SendQueryArgs } from "../types"; export class AxiomCircuit extends AxiomBaseCircuit { constructor(inputs: { @@ -21,19 +20,22 @@ export class AxiomCircuit extends AxiomBaseCircuit { callbackTarget: string; callbackExtraData: string; callerAddress: string; - options: AxiomV2ClientOptions; + options: AxiomV2QueryOptions; }): Promise { + if (!this.chainId) throw new Error("No chain ID provided"); if (!this.computeQuery) throw new Error("No compute query generated"); - const axiomCallback: AxiomV2Callback = { + const callback: AxiomV2Callback = { target: input.callbackTarget, extraData: input.callbackExtraData, }; return await buildSendQuery({ - axiom: this.axiom, + chainId: this.chainId, + providerUri: this.provider, dataQuery: this.dataQuery, computeQuery: this.computeQuery, - callback: axiomCallback, + callback, caller: input.callerAddress, + mock: this.isMock ?? false, options: input.options, }); } diff --git a/client/src/lib/address.ts b/client/src/lib/address.ts index 8f3b987a..dc2ba6d2 100644 --- a/client/src/lib/address.ts +++ b/client/src/lib/address.ts @@ -31,7 +31,7 @@ const axiomV2QueryAddresses = { [mainnet.id.toString()]: "", [arbitrum.id.toString()]: "", [optimism.id.toString()]: "", - [base.id.toString()]: "", + [base.id.toString()]: "0xfe059442B0379D5f22Bec384A588766f98A36812", [scroll.id.toString()]: "", }, [baseSepolia.id.toString()]: { diff --git a/client/src/lib/chain.ts b/client/src/lib/chain.ts index 1a7ee613..1f88ea68 100644 --- a/client/src/lib/chain.ts +++ b/client/src/lib/chain.ts @@ -1,4 +1,4 @@ -import { BaseDefaults, MainnetDefaults } from "../constants"; +import { BaseDefaults, MainnetDefaults } from "./constants"; import { ChainDefaults } from "../types"; export function isMainnetChain(chainId: string) { diff --git a/client/src/constants.ts b/client/src/lib/constants.ts similarity index 94% rename from client/src/constants.ts rename to client/src/lib/constants.ts index f479fdc5..24268bf5 100644 --- a/client/src/constants.ts +++ b/client/src/lib/constants.ts @@ -1,4 +1,4 @@ -import { ChainDefaults } from "./types"; +import { ChainDefaults } from "../types"; export const ClientConstants = Object.freeze({ AXIOM_PROOF_CALLDATA_LEN: 2875, // bytes diff --git a/client/src/lib/paymentCalc.ts b/client/src/lib/paymentCalc.ts index d6f98a3f..0fff09f3 100644 --- a/client/src/lib/paymentCalc.ts +++ b/client/src/lib/paymentCalc.ts @@ -1,5 +1,5 @@ -import { ClientConstants } from "../constants"; -import { AbiType, AxiomV2ClientOverrides, AxiomV2ClientOptions, AxiomV2FeeDataExtended } from "../types"; +import { ClientConstants } from "./constants"; +import { AbiType, AxiomV2ClientOverrides, AxiomV2QueryOptions, AxiomV2FeeDataExtended } from "../types"; import { PublicClient } from "viem"; import { getAxiomV2QueryAddress, getOpStackGasPriceOracleAddress } from "./address"; import { getAxiomV2Abi, getOpStackGasPriceOracleAbi } from "./abi"; @@ -56,7 +56,7 @@ export async function calculatePayment( export async function calculateFeeDataExtended( chainId: string, publicClient: PublicClient, - options: AxiomV2ClientOptions, + options: AxiomV2QueryOptions, ): Promise { const axiomV2QueryAddr = options.overrides?.queryAddress ?? getAxiomV2QueryAddress(chainId); const defaults = getChainDefaults(chainId); diff --git a/client/src/queryBuilderClient/index.ts b/client/src/queryBuilderClient/index.ts new file mode 100644 index 00000000..92aee37d --- /dev/null +++ b/client/src/queryBuilderClient/index.ts @@ -0,0 +1,2 @@ +export * from "./queryBuilderClient"; +export * from "./types"; diff --git a/client/src/queryBuilderClient/queryBuilderClient.ts b/client/src/queryBuilderClient/queryBuilderClient.ts new file mode 100644 index 00000000..69f5e805 --- /dev/null +++ b/client/src/queryBuilderClient/queryBuilderClient.ts @@ -0,0 +1,259 @@ +import { + AxiomV2Callback, + AxiomV2ComputeQuery, + QueryBuilderBase, +} from "@axiom-crypto/circuit"; +import { + parseAddress, +} from "@axiom-crypto/circuit/queryBuilderBase/configure"; +import { AxiomV2FeeData, getCallbackHash, getQueryId, Subquery } from "@axiom-crypto/tools"; +import { AxiomV2QueryOptions } from "../types"; +import { bytesToHex, zeroAddress } from "viem"; +import { + QueryBuilderClientConfig, + QueryBuilderClientInternalConfig, + BuiltQueryV2, +} from "./types"; +import { getChainDefaults } from "../lib/chain"; +import { randomBytes } from "crypto"; + +/** + * QueryBuilderClient builds queries that can be sent to the deployed AxiomV2Query contract on-chain. + */ +export class QueryBuilderClient extends QueryBuilderBase { + // Configuration object + readonly config: QueryBuilderClientInternalConfig; + + // Built query object; undefined until built + protected builtQuery?: BuiltQueryV2; + + // Information about the callback contract for the query + protected callback?: AxiomV2Callback; + + // Query options and overrides + protected options: AxiomV2QueryOptions; + + constructor( + config: QueryBuilderClientConfig, + dataQuery?: Subquery[], + computeQuery?: AxiomV2ComputeQuery, + callback?: AxiomV2Callback, + options?: AxiomV2QueryOptions, + ) { + super(config, dataQuery, computeQuery); + this.config = this.configure(config); + if (callback !== undefined) { + this.callback = this.handleCallback(callback); + } + this.options = this.setOptions(options ?? {}); + } + + protected configure(config: QueryBuilderClientConfig): QueryBuilderClientInternalConfig { + const baseConfig = super.configure(config); + let caller = ""; + if (config.caller !== undefined) { + caller = parseAddress(config.caller); + } + let refundee = caller; + if (config.refundee !== undefined) { + refundee = parseAddress(config.refundee); + } + + return { + providerUri: baseConfig.providerUri, + provider: baseConfig.provider, + sourceChainId: baseConfig.sourceChainId, + targetChainId: baseConfig.targetChainId, + version: baseConfig.version, + mock: baseConfig.mock, + caller, + refundee, + }; + } + + async build(validate?: boolean): Promise { + if (this.config.refundee === "" && this.config.caller === "") { + throw new Error("`caller` or `refundee` in config required to build the Query"); + } + + if (validate === true) { + const valid = await this.validate(); + if (!valid) { + throw new Error("Query validation failed"); + } + } + + const builtQueryBase = await super.buildBase(validate); + + // Handle callback + const callback = { + target: this.callback?.target ?? zeroAddress, + extraData: this.callback?.extraData ?? zeroAddress, + }; + + // FeeData + const feeData: AxiomV2FeeData = { + maxFeePerGas: this.options.maxFeePerGas!, + callbackGasLimit: this.options.callbackGasLimit!, + overrideAxiomQueryFee: this.options.overrideAxiomQueryFee!, + }; + + // Get the refundee address + let refundee = this.config.refundee; + if (!this.config.refundee || this.config.refundee === "") { + refundee = this.config.caller; + } + + // Calculate a salt + const userSalt = this.calculateUserSalt(); + + this.builtQuery = { + sourceChainId: builtQueryBase.sourceChainId.toString(), + targetChainId: builtQueryBase.targetChainId.toString(), + queryHash: builtQueryBase.queryHash, + dataQuery: builtQueryBase.dataQuery, + dataQueryHash: builtQueryBase.dataQueryHash, + dataQueryStruct: builtQueryBase.dataQueryStruct, + computeQuery: builtQueryBase.computeQuery, + querySchema: builtQueryBase.querySchema, + callback, + feeData, + userSalt, + refundee, + }; + + return this.builtQuery!; + } + + + /** + * Gets the callback information + * @returns The current callback information + */ + getCallback(): AxiomV2Callback | undefined { + return this.callback; + } + + /** + * Gets the current Query options + * @returns The current Query options + */ + getOptions(): AxiomV2QueryOptions { + return this.options; + } + + /** + * Gets the built Query if it exists + * @returns The built Query or undefined if it has not yet been built + */ + getBuiltQuery(): BuiltQueryV2 | undefined { + return this.builtQuery; + } + + setCallback(callback: AxiomV2Callback) { + this.unsetBuiltQuery(); + this.callback = this.handleCallback(callback); + } + + setOptions(options: AxiomV2QueryOptions): AxiomV2QueryOptions { + this.unsetBuiltQuery(); + const defaults = getChainDefaults(this.config.sourceChainId.toString()); + this.options = { + ...this.options, + ...options, + maxFeePerGas: options?.maxFeePerGas ?? defaults.maxFeePerGasWei.toString(), + callbackGasLimit: options?.callbackGasLimit ?? Number(defaults.callbackGasLimit), + overrideAxiomQueryFee: options?.overrideAxiomQueryFee ?? "0", + }; + if (options.refundee !== undefined) { + this.config.refundee = parseAddress(options.refundee); + } + return this.options; + } + + clearOptions() { + this.unsetBuiltQuery(); + this.options = {}; + } + + async validate(): Promise { + const baseValid = await super.validate(); + + // Check if callback is valid + const callback = await this.validateCallback(); + + return baseValid && callback; + } + + protected unsetBuiltQuery() { + // Reset built query if any data is changed + this.builtQuery = undefined; + } + + /** + * Gets a queryId for a built Query + * @returns uint256 queryId + */ + async getQueryId(caller?: string): Promise { + if (this.builtQuery === undefined) { + throw new Error("Must query with `build()` first before getting queryId"); + } + + // Get required queryId params + if (caller === undefined) { + caller = this.config.caller; + } + const targetChainId = this.builtQuery.targetChainId; + const refundee = this.config.refundee; + const salt = this.builtQuery.userSalt; + const queryHash = this.builtQuery.queryHash; + const callbackHash = getCallbackHash(this.builtQuery.callback.target, this.builtQuery.callback.extraData); + + // Calculate the queryId + const queryId = getQueryId(targetChainId, caller, salt, queryHash, callbackHash, refundee); + return BigInt(queryId).toString(); + } + + protected calculateUserSalt(): string { + return bytesToHex(randomBytes(32)); + } + + protected handleCallback(callback: AxiomV2Callback): AxiomV2Callback { + callback.target = callback.target.toLowerCase(); + callback.extraData = callback.extraData.toLowerCase(); + return callback; + } + + + protected async validateCallback(): Promise { + if (this.callback === undefined) { + return true; + } + let valid = true; + + let target = this.callback.target; + if (target === undefined || target === "" || target === zeroAddress) { + console.warn("Callback target is empty"); + valid = false; + } + + let extraData = this.callback.extraData; + if (extraData === undefined) { + console.warn("Callback extraData is undefined"); + valid = false; + } else { + // Check if extra data is bytes32-aligned + if (extraData.startsWith("0x")) { + extraData = extraData.slice(2); + } + if (extraData.length % 64 !== 0) { + console.warn( + "Callback extraData is not bytes32-aligned; EVM will automatically right-append zeros to data that is not a multiple of 32 bytes, which is probably not what you want.", + ); + valid = false; + } + } + + return valid; + } +} \ No newline at end of file diff --git a/client/src/queryBuilderClient/types.ts b/client/src/queryBuilderClient/types.ts new file mode 100644 index 00000000..7c36674d --- /dev/null +++ b/client/src/queryBuilderClient/types.ts @@ -0,0 +1,24 @@ +import { AxiomV2Callback, AxiomV2ComputeQuery, AxiomV2DataQuery, AxiomV2FeeData } from "@axiom-crypto/tools"; +import { + QueryBuilderBaseConfig, + BuiltQueryV2Base, + QueryBuilderBaseInternalConfig, +} from "@axiom-crypto/circuit"; + +export interface QueryBuilderClientConfig extends QueryBuilderBaseConfig { + caller?: string; + refundee?: string; +} + +export interface QueryBuilderClientInternalConfig extends QueryBuilderBaseInternalConfig { + caller: string; + refundee: string; +} + +export interface BuiltQueryV2 extends BuiltQueryV2Base { + querySchema: string; + callback: AxiomV2Callback; + userSalt: string; + feeData: AxiomV2FeeData; + refundee: string; +} \ No newline at end of file diff --git a/client/src/sendQuery.ts b/client/src/sendQuery.ts index 61bd917b..edde51bc 100644 --- a/client/src/sendQuery.ts +++ b/client/src/sendQuery.ts @@ -1,67 +1,72 @@ import { - AxiomSdkCore, AxiomV2Callback, AxiomV2ComputeQuery, - AxiomV2QueryOptions, DataSubquery, - QueryBuilderV2, - QueryV2, -} from "@axiom-crypto/core"; +} from "@axiom-crypto/circuit"; import { createPublicClient, encodeFunctionData, http } from "viem"; import { getMaxFeePerGas } from "./axiom/utils"; -import { AbiType, AxiomV2ClientOptions, AxiomV2SendQueryArgs } from "./types"; -import { encodeFullQueryV2 } from "@axiom-crypto/core/packages/tools"; +import { AbiType, AxiomV2QueryOptions, AxiomV2SendQueryArgs } from "./types"; +import { encodeFullQueryV2 } from "@axiom-crypto/circuit/pkg/tools"; import { calculateFeeDataExtended, calculatePayment } from "./lib/paymentCalc"; import { viemChain } from "./lib/viem"; import { getAxiomV2Abi, getAxiomV2QueryAddress } from "./lib"; +import { QueryBuilderClient, QueryBuilderClientConfig } from "./queryBuilderClient"; export const buildSendQuery = async (input: { - axiom: AxiomSdkCore; + chainId: string; + providerUri: string; dataQuery: DataSubquery[]; computeQuery: AxiomV2ComputeQuery; callback: AxiomV2Callback; caller: string; - options: AxiomV2ClientOptions; + mock: boolean; + options: AxiomV2QueryOptions; }): Promise => { const validate = input.options?.overrides?.validateBuild ?? true; - const query = input.axiom.query as QueryV2; - if (input.options.refundee === undefined) { - throw new Error("Refundee is required"); + if (input.caller === "") { + throw new Error("`caller` is required"); } - if (input.options.maxFeePerGas == undefined) { - input.options.maxFeePerGas = await getMaxFeePerGas(input.axiom, input.options?.overrides); + let options = { ...input.options }; + if (options.maxFeePerGas == undefined) { + options.maxFeePerGas = await getMaxFeePerGas(input.chainId, input.providerUri, input.options?.overrides); } - const chainId = input.axiom.config.chainId.toString(); - const axiomQueryAddress = input.options?.overrides?.queryAddress ?? getAxiomV2QueryAddress(chainId); + const chainId = input.chainId; + const axiomQueryAddress = options?.overrides?.queryAddress ?? getAxiomV2QueryAddress(chainId); const abi = getAxiomV2Abi(AbiType.Query); const publicClient = createPublicClient({ - chain: viemChain(chainId, input.axiom.config.providerUri), - transport: http(input.axiom.config.providerUri), + chain: viemChain(chainId, input.providerUri), + transport: http(input.providerUri), }); - const feeDataExtended = await calculateFeeDataExtended(chainId, publicClient, input.options); + const feeDataExtended = await calculateFeeDataExtended(chainId, publicClient, options); const payment = await calculatePayment(chainId, publicClient, feeDataExtended); - const queryOptions: AxiomV2QueryOptions = { - ...feeDataExtended, - refundee: input.options.refundee, + const config: QueryBuilderClientConfig = { + sourceChainId: chainId, + providerUri: input.providerUri, + caller: input.caller, + version: "v2", + mock: input.mock, }; - - const qb: QueryBuilderV2 = query.new( - undefined, + const queryBuilderClient = new QueryBuilderClient( + config, + input.dataQuery.map((dq) => dq.subqueryData), input.computeQuery, input.callback, - queryOptions + options, ); + queryBuilderClient.setOptions(feeDataExtended); + // Feed the data query into the query builder if (input.dataQuery.length > 0) { - qb.setBuiltDataQuery({ - subqueries: input.dataQuery, + queryBuilderClient.setBuiltDataQuery({ sourceChainId: chainId, + subqueries: input.dataQuery, }, true); } + const { queryHash, dataQueryHash, @@ -71,8 +76,8 @@ export const buildSendQuery = async (input: { userSalt, refundee, dataQuery, - } = await qb.build(validate); - const id = await qb.getQueryId(input.caller); + } = await queryBuilderClient.build(validate); + const id = await queryBuilderClient.getQueryId(input.caller); let sendQueryArgs: any; if (!input.options.ipfsClient) { @@ -92,7 +97,7 @@ export const buildSendQuery = async (input: { dataQuery, ], queryId: id, - mock: input.axiom.config.mock, + mock: queryBuilderClient.config.mock, }; } else { const encodedQuery = encodeFullQueryV2( @@ -109,7 +114,7 @@ export const buildSendQuery = async (input: { refundee, ); const pinRes = await input.options.ipfsClient.pin(encodedQuery); - if (pinRes.status - 200 > 99) { + if (pinRes.status > 299) { throw new Error(`Failed to write data to IPFS. Status: ${pinRes.status}`); } const ipfsHash = pinRes.value as string; @@ -127,7 +132,7 @@ export const buildSendQuery = async (input: { refundee, ], queryId: id, - mock: input.axiom.config.mock, + mock: queryBuilderClient.config.mock, }; } diff --git a/client/src/types.ts b/client/src/types.ts index 60a6438c..d256af3a 100644 --- a/client/src/types.ts +++ b/client/src/types.ts @@ -1,12 +1,14 @@ -import { AxiomV2CircuitCapacity, CircuitConfig } from "@axiom-crypto/circuit/types"; import { AxiomV2Callback, + AxiomV2CircuitCapacity, AxiomV2ComputeQuery, AxiomV2FeeData, - AxiomV2QueryOptions, + CircuitConfig, +} from "@axiom-crypto/circuit"; +import { ByteLengths, IpfsClient, -} from "@axiom-crypto/core"; +} from "@axiom-crypto/circuit/pkg/tools"; const solidityTypes = Object.keys(ByteLengths); const solidityInputTypes = [...solidityTypes, ...solidityTypes.map((type: string) => `${type}[]`)] as const; @@ -20,7 +22,7 @@ export interface AxiomV2ClientConfig { callback: AxiomV2CallbackInput; privateKey?: string; capacity?: AxiomV2CircuitCapacity; - options?: AxiomV2ClientOptions; + options?: AxiomV2QueryOptions; } export interface AxiomV2CallbackInput { @@ -37,8 +39,11 @@ export interface AxiomV2CompiledCircuit { capacity?: AxiomV2CircuitCapacity; } -export interface AxiomV2ClientOptions extends AxiomV2QueryOptions { - caller?: string; +export interface AxiomV2QueryOptions { + maxFeePerGas?: string; + callbackGasLimit?: number; + overrideAxiomQueryFee?: string; + refundee?: string; ipfsClient?: IpfsClient; overrides?: AxiomV2ClientOverrides; } @@ -87,9 +92,8 @@ export { AxiomV2Callback, AxiomV2ComputeQuery, AxiomV2DataQuery, - AxiomV2QueryOptions, AxiomV2FeeData, -} from "@axiom-crypto/core"; +} from "@axiom-crypto/circuit"; export enum AbiType { Query, diff --git a/client/src/version.ts b/client/src/version.ts index 69ab6253..9481ef48 100644 --- a/client/src/version.ts +++ b/client/src/version.ts @@ -1,4 +1,4 @@ // This is an autogenerated file. It should match the version number in package.json. // Do not modify this file directly. -export const CLIENT_VERSION = "2.0.8"; \ No newline at end of file +export const CLIENT_VERSION = "2.0.9"; \ No newline at end of file diff --git a/client/src/web/index.ts b/client/src/web/index.ts index 1b64849c..d4b078dd 100644 --- a/client/src/web/index.ts +++ b/client/src/web/index.ts @@ -1,8 +1,7 @@ +import { AxiomV2Callback, AxiomV2CircuitCapacity } from "@axiom-crypto/circuit"; import { AxiomBaseCircuit } from "@axiom-crypto/circuit/web/"; -import { AxiomV2Callback } from "@axiom-crypto/core"; import { buildSendQuery } from "../sendQuery"; -import { AxiomV2ClientOptions, AxiomV2SendQueryArgs } from "../types"; -import { AxiomV2CircuitCapacity } from "@axiom-crypto/circuit/types"; +import { AxiomV2QueryOptions, AxiomV2SendQueryArgs } from "../types"; export class AxiomCircuit extends AxiomBaseCircuit { constructor(inputs: { @@ -21,19 +20,22 @@ export class AxiomCircuit extends AxiomBaseCircuit { callbackTarget: string; callbackExtraData: string; callerAddress: string; - options: AxiomV2ClientOptions; + options: AxiomV2QueryOptions; }): Promise { + if (!this.chainId) throw new Error("No chain ID provided"); if (!this.computeQuery) throw new Error("No compute query generated"); - const axiomCallback: AxiomV2Callback = { + const callback: AxiomV2Callback = { target: input.callbackTarget, extraData: input.callbackExtraData, }; return await buildSendQuery({ - axiom: this.axiom, + chainId: this.chainId, + providerUri: this.provider, dataQuery: this.dataQuery, computeQuery: this.computeQuery, - callback: axiomCallback, + callback, caller: input.callerAddress, + mock: this.isMock ?? false, options: input.options, }); } diff --git a/client/test/chainData/1.json b/client/test/chainData/1.json new file mode 100644 index 00000000..fd0e1a17 --- /dev/null +++ b/client/test/chainData/1.json @@ -0,0 +1,2276 @@ +{ + "chainId": "1", + "blockRange": { + "start": 19630295, + "end": 19633943 + }, + "blockSamples": 0, + "blockInterval": 0, + "account": { + "eoa": [ + { + "blockNumber": 19633943, + "address": "0x634c2a62df7decdb412683f78253cfe6fbcfbcae" + }, + { + "blockNumber": 19633879, + "address": "0x10355af6005ff22ed414c9477b60116fc6a536ed" + }, + { + "blockNumber": 19633815, + "address": "0x75e89d5979e4f6fba9f97c104c2f0afb3f1dcb88" + }, + { + "blockNumber": 19633751, + "address": "0x078b5de2a6e9d5cb6e0ad5abf39bae7c947ceb50" + }, + { + "blockNumber": 19633751, + "address": "0x357c6fd2cee77ba5de49e0bb9d49444781a8f0cc" + }, + { + "blockNumber": 19633687, + "address": "0x75e89d5979e4f6fba9f97c104c2f0afb3f1dcb88" + }, + { + "blockNumber": 19633687, + "address": "0x6e02519b0dd4c677bfa426f5177108ab15e05064" + }, + { + "blockNumber": 19633623, + "address": "0x104da4efb22a7e560e6df9c813e5eb54ca038737" + }, + { + "blockNumber": 19633559, + "address": "0x0c5911d57b24fcf1dc8b2608efbae57c7098e32d" + }, + { + "blockNumber": 19633495, + "address": "0xe76ae91c26a488f604ab455473b65797b0e5a02f" + }, + { + "blockNumber": 19633495, + "address": "0x267be1c1d684f78cb4f6a176c4911b741e4ffdc0" + }, + { + "blockNumber": 19633431, + "address": "0xb25ccf8d293c0a606e0f171159b83c414cdfcf32" + }, + { + "blockNumber": 19633367, + "address": "0x466ad3607f29aa5a91ca97198a907be8143731f8" + }, + { + "blockNumber": 19633303, + "address": "0x27bfcb64685ffff3041ced2f9619ce73ec537d2c" + }, + { + "blockNumber": 19633239, + "address": "0x4ba80ab11176a184ae23ee88d8c4af816862919f" + }, + { + "blockNumber": 19633239, + "address": "0x7ee4d0b91aff407dac392306358fcd9652ec6313" + }, + { + "blockNumber": 19633175, + "address": "0x573a250702fb6f6c276cf2e7fda52e78685fe925" + }, + { + "blockNumber": 19633111, + "address": "0xf991acd672d5b344afcb29931af6401ed32e2691" + }, + { + "blockNumber": 19633047, + "address": "0x28c6c06298d514db089934071355e5743bf21d60" + }, + { + "blockNumber": 19632983, + "address": "0xfa7bd7fa1c2ffc88e23a2c16f581c388b92d2ba0" + }, + { + "blockNumber": 19632983, + "address": "0xfa02440e2ed658bd7eb51bbe1b241cb2ef87c7c1" + }, + { + "blockNumber": 19632919, + "address": "0x60285137e6a5704ecb4fad69fbd97d94aeceeb10" + }, + { + "blockNumber": 19632919, + "address": "0x3371f1899f0e5c6e6e62e8abcf81eec615551228" + }, + { + "blockNumber": 19632855, + "address": "0x6bd86f37fb0a63d949b573670c77d29692c4b1ce" + }, + { + "blockNumber": 19632791, + "address": "0x643e3247da5136b65cd17ca2302b6f9e1f869f3a" + }, + { + "blockNumber": 19632791, + "address": "0xa7efae728d2936e78bda97dc267687568dd593f3" + }, + { + "blockNumber": 19632727, + "address": "0x389505f098a29a994a3ed0e674f07cd451dde42c" + }, + { + "blockNumber": 19632663, + "address": "0xc25746acf1611634df903785cf3f514dc850f179" + }, + { + "blockNumber": 19632663, + "address": "0x265d2da7b2f66ad2edfa2eb8b797ab57d3e89272" + }, + { + "blockNumber": 19632599, + "address": "0x6b19e2f6b9dc7d51a68a9b33490e174b059bed72" + }, + { + "blockNumber": 19632535, + "address": "0xf89d7b9c864f589bbf53a82105107622b35eaa40" + }, + { + "blockNumber": 19632471, + "address": "0x40058843432476e28c8467110cc99817ea0e19ff" + } + ], + "contract": [ + { + "blockNumber": 19633943, + "address": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad" + }, + { + "blockNumber": 19633879, + "address": "0x6774bcbd5cecef1336b5300fb5186a12ddd8b367" + }, + { + "blockNumber": 19633815, + "address": "0xbba39fd2935d5769116ce38d46a71bde9cf03099" + }, + { + "blockNumber": 19633623, + "address": "0x51c72848c68a965f66fa7a88855f9f7784502a7f" + }, + { + "blockNumber": 19633559, + "address": "0x211e1c4c7f1bf5351ac850ed10fd68cffcf6c21b" + }, + { + "blockNumber": 19633431, + "address": "0x80a64c6d7f12c47b7c66c5b4e20e72bc1fcd5d9e" + }, + { + "blockNumber": 19633367, + "address": "0xaaee1a9723aadb7afa2810263653a34ba2c21c7a" + }, + { + "blockNumber": 19633303, + "address": "0x15613ca6f06d618a66cde55a98e6499287d78b12" + }, + { + "blockNumber": 19633175, + "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" + }, + { + "blockNumber": 19633111, + "address": "0x1e3d13932c31d7355fcb3fec680b0cd159dc1a07" + }, + { + "blockNumber": 19633047, + "address": "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984" + }, + { + "blockNumber": 19632855, + "address": "0x5c9321e92ba4eb43f2901c4952358e132163a85a" + }, + { + "blockNumber": 19632727, + "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" + }, + { + "blockNumber": 19632599, + "address": "0x0439e60f02a8900a951603950d8d4527f400c3f1" + }, + { + "blockNumber": 19632535, + "address": "0xdac17f958d2ee523a2206206994597c13d831ec7" + }, + { + "blockNumber": 19632471, + "address": "0x52e66ca968010d064938a8099a172cbaaf08c125" + }, + { + "blockNumber": 19632407, + "address": "0x0000000000a39bb272e79075ade125fd351887ac" + }, + { + "blockNumber": 19632343, + "address": "0x14fee680690900ba0cccfc76ad70fd1b95d10e16" + }, + { + "blockNumber": 19632279, + "address": "0x1edfa7b0f52dfe566e4051847acee1acf2867493" + }, + { + "blockNumber": 19632151, + "address": "0x1a8f43e01b78979eb4ef7febec60f32c9a72f58e" + }, + { + "blockNumber": 19632087, + "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" + }, + { + "blockNumber": 19632023, + "address": "0x4ce569e78cacbee74993c0f088868da400af6012" + }, + { + "blockNumber": 19631959, + "address": "0xf047ab4c75cebf0eb9ed34ae2c186f3611aeafa6" + }, + { + "blockNumber": 19631895, + "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" + }, + { + "blockNumber": 19631767, + "address": "0xdac17f958d2ee523a2206206994597c13d831ec7" + }, + { + "blockNumber": 19631639, + "address": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad" + }, + { + "blockNumber": 19631511, + "address": "0xdac17f958d2ee523a2206206994597c13d831ec7" + }, + { + "blockNumber": 19631319, + "address": "0x00000000003b3cc22af3ae1eac0440bcee416b40" + }, + { + "blockNumber": 19631191, + "address": "0xb4a81261b16b92af0b9f7c4a83f1e885132d81e4" + }, + { + "blockNumber": 19631127, + "address": "0xf2f305d14dcd8aaef887e0428b3c9534795d0d60" + }, + { + "blockNumber": 19630999, + "address": "0xd9a442856c234a39a81a089c06451ebaa4306a72" + }, + { + "blockNumber": 19630935, + "address": "0xab19d5d8590a7f337b7c2ece83e0733f55fe2dbf" + } + ] + }, + "storage": { + "nonzero": [ + { + "blockNumber": 19633943, + "address": "0x1a8f43e01b78979eb4ef7febec60f32c9a72f58e", + "slot": 0 + }, + { + "blockNumber": 19633879, + "address": "0x80a64c6d7f12c47b7c66c5b4e20e72bc1fcd5d9e", + "slot": 4 + }, + { + "blockNumber": 19633815, + "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "slot": 0 + }, + { + "blockNumber": 19633751, + "address": "0x80a64c6d7f12c47b7c66c5b4e20e72bc1fcd5d9e", + "slot": 9 + }, + { + "blockNumber": 19633687, + "address": "0xd13cfd3133239a3c73a9e535a5c4dadee36b395c", + "slot": 6 + }, + { + "blockNumber": 19633623, + "address": "0xb90b2a35c65dbc466b04240097ca756ad2005295", + "slot": 3 + }, + { + "blockNumber": 19633559, + "address": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad", + "slot": 1 + }, + { + "blockNumber": 19633495, + "address": "0x99b1817acb40e76c309e26b2face9da9eff55317", + "slot": 2 + }, + { + "blockNumber": 19633431, + "address": "0x80a64c6d7f12c47b7c66c5b4e20e72bc1fcd5d9e", + "slot": 1 + }, + { + "blockNumber": 19633367, + "address": "0x80a64c6d7f12c47b7c66c5b4e20e72bc1fcd5d9e", + "slot": 5 + }, + { + "blockNumber": 19633303, + "address": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad", + "slot": 0 + }, + { + "blockNumber": 19633239, + "address": "0xa69babef1ca67a37ffaf7a485dfff3382056e78c", + "slot": 1 + }, + { + "blockNumber": 19633175, + "address": "0x5c9321e92ba4eb43f2901c4952358e132163a85a", + "slot": 2 + }, + { + "blockNumber": 19633111, + "address": "0x80a64c6d7f12c47b7c66c5b4e20e72bc1fcd5d9e", + "slot": 0 + }, + { + "blockNumber": 19633047, + "address": "0x80a64c6d7f12c47b7c66c5b4e20e72bc1fcd5d9e", + "slot": 5 + }, + { + "blockNumber": 19632983, + "address": "0x98c3d3183c4b8a650614ad179a1a98be0a8d6b8e", + "slot": 0 + }, + { + "blockNumber": 19632919, + "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "slot": 0 + }, + { + "blockNumber": 19632855, + "address": "0x80a64c6d7f12c47b7c66c5b4e20e72bc1fcd5d9e", + "slot": 10 + }, + { + "blockNumber": 19632791, + "address": "0xa69babef1ca67a37ffaf7a485dfff3382056e78c", + "slot": 1 + }, + { + "blockNumber": 19632727, + "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "slot": 1 + }, + { + "blockNumber": 19632663, + "address": "0x00000047bb99ea4d791bb749d970de71ee0b1a34", + "slot": 1 + }, + { + "blockNumber": 19632599, + "address": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad", + "slot": 1 + }, + { + "blockNumber": 19632535, + "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", + "slot": 1 + }, + { + "blockNumber": 19632471, + "address": "0xf3de3c0d654fda23dad170f0f320a92172509127", + "slot": 0 + }, + { + "blockNumber": 19632407, + "address": "0x0021053b73a20cb418d0458f543ac3e46d24137e", + "slot": 1 + }, + { + "blockNumber": 19632343, + "address": "0x91af0fbb28aba7e31403cb457106ce79397fd4e6", + "slot": 2 + }, + { + "blockNumber": 19632279, + "address": "0xe76014c179f19da26bb30a0f085ff0a466b92829", + "slot": 0 + }, + { + "blockNumber": 19632215, + "address": "0x1a8f43e01b78979eb4ef7febec60f32c9a72f58e", + "slot": 6 + }, + { + "blockNumber": 19632151, + "address": "0x3328f7f4a1d1c57c35df56bbf0c9dcafca309c49", + "slot": 0 + }, + { + "blockNumber": 19632087, + "address": "0xae41b275aaaf484b541a5881a2dded9515184cca", + "slot": 2 + }, + { + "blockNumber": 19632023, + "address": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad", + "slot": 0 + }, + { + "blockNumber": 19631959, + "address": "0x99b1817acb40e76c309e26b2face9da9eff55317", + "slot": 1 + } + ] + }, + "tx": { + "type": { + "0": [ + { + "hash": "0x27a31adf999e66d7696b49a840dab942dd9065ab7aaeb3ca0b70eb3d29c2c7e5", + "blockNumber": 19633943, + "txIdx": 12 + }, + { + "hash": "0xac17f69806d27579fc308e7df47ab39dbf796ffa2d6ef1723c7a129c6b3a8aea", + "blockNumber": 19633943, + "txIdx": 15 + }, + { + "hash": "0xf33d3280c07d0f6f07e62c37729022282159bff68817f02668616fa986b5f089", + "blockNumber": 19633943, + "txIdx": 16 + }, + { + "hash": "0x389410bb717456b97f887106cc2bdc30e055c922eda56d7d6cae145d731aeb0d", + "blockNumber": 19633943, + "txIdx": 17 + }, + { + "hash": "0x3701fae0795994ce811dcb0d074fbbdab475052a55f40de4c57365e368911c8b", + "blockNumber": 19633943, + "txIdx": 18 + }, + { + "hash": "0xfdc17d02067abb2a7577d06214e11799c7dfabb2ff34f88a452531824edba22a", + "blockNumber": 19633943, + "txIdx": 19 + }, + { + "hash": "0x71b12286526580df4210b6a3b55eed352dde7ebccf26992d90303c8578a99d9b", + "blockNumber": 19633943, + "txIdx": 20 + }, + { + "hash": "0x45e6edfd990aa815566b6b1dc5966aa57facc199080cf4b965d180453ae862cd", + "blockNumber": 19633943, + "txIdx": 21 + }, + { + "hash": "0xb7c419bcd3a43c3baba88ff3cbb7539ca8ff4fab31b8e2de9f88cbfbb19863ec", + "blockNumber": 19633943, + "txIdx": 22 + }, + { + "hash": "0xf67e6ca8c9243b4184b1de8808da1982588d80db0685628cc64944b20b220ff4", + "blockNumber": 19633943, + "txIdx": 25 + }, + { + "hash": "0xda50f23bf9c82c2fdb416cf191cf4c0b11e1fde332510fb998ce87f3476e7ca5", + "blockNumber": 19633943, + "txIdx": 26 + }, + { + "hash": "0xb32345b557964e491ef8de0678616fb21889cec7cbe1f24ab716aedea3634717", + "blockNumber": 19633943, + "txIdx": 35 + }, + { + "hash": "0x4000dac3bb7b7596d4e8bd1b91ca9e2ece258875cfdfde72d9242572d7a85c37", + "blockNumber": 19633943, + "txIdx": 36 + }, + { + "hash": "0x17cf0d796d44195d56ea401fda20773012d51c5ffe08f35bb3437f16b183658a", + "blockNumber": 19633943, + "txIdx": 37 + }, + { + "hash": "0x1bf78766cbeeb96c87b793e2dc739dd6fda97ce91459e06b549b55b4ce8be7d6", + "blockNumber": 19633943, + "txIdx": 47 + }, + { + "hash": "0x76a5b7b70e4f609e4edfdcdab7b197f91c9bbdb4a2d5ec47b6507ccdb32e031b", + "blockNumber": 19633943, + "txIdx": 59 + }, + { + "hash": "0x983cd0c50b000313a912ba4f7be92115079ee56d249536e9830f30b6a1e9a8dc", + "blockNumber": 19633943, + "txIdx": 72 + }, + { + "hash": "0x6e451e6e64029c848800a14b56d045a740c4a23f759479efccc4bd1624d08b5c", + "blockNumber": 19633943, + "txIdx": 78 + }, + { + "hash": "0x2022f3178c520e57a1ee749a7001abfaca8fba2a564c3f88960c5ec6f1272ea7", + "blockNumber": 19633943, + "txIdx": 79 + }, + { + "hash": "0x273188426f6b421c75262ae91852ce04b9267da2d43a94ac6cfb896a837ec719", + "blockNumber": 19633943, + "txIdx": 82 + }, + { + "hash": "0xe659abf06838724dc4685686e4443bf0cbd13c4d54462c3f2d5078b424d2c313", + "blockNumber": 19633879, + "txIdx": 10 + }, + { + "hash": "0x4fba14ba1eaf91ffa24c2683ba3ef5f0e241b5c155f1df9e23bf4d2b14c2edb9", + "blockNumber": 19633879, + "txIdx": 11 + }, + { + "hash": "0x3472a4e356d66fa3eec3e1864bbfc38db2b1d1404e2353172de9698474362a6f", + "blockNumber": 19633879, + "txIdx": 16 + }, + { + "hash": "0x009c515347e8c2782af887bf581cb2c8add3c4fd9a45efadd66119de06118a37", + "blockNumber": 19633879, + "txIdx": 17 + }, + { + "hash": "0x3cdc286737df32d04397a967512a7358657873e7954126334613664ec1158ff6", + "blockNumber": 19633879, + "txIdx": 25 + }, + { + "hash": "0xe1221b367c8ad23366d12ca5bc7fa718c3b076ed626d8cefa2ccbc94198b3977", + "blockNumber": 19633879, + "txIdx": 63 + }, + { + "hash": "0x64781ace561fd2fc5c64406e5ff6b7c9922e5287d214ccfa557aab54d83cf40b", + "blockNumber": 19633879, + "txIdx": 83 + }, + { + "hash": "0x98c481b44b6b14077fa73e7d861a4fe35194d12a0b1a41bf3eb66936028791a1", + "blockNumber": 19633879, + "txIdx": 84 + }, + { + "hash": "0xae2b35a2330e461686c31c9acbff749178ec458730d16ef9a83953bc50a4d0e3", + "blockNumber": 19633879, + "txIdx": 85 + }, + { + "hash": "0xe01b205beee60673cfd9ebf5f4229530743fab1baf1ab3c2084c84c62040c0ce", + "blockNumber": 19633879, + "txIdx": 86 + }, + { + "hash": "0x28d2141443e234de9be335f0f868dd68138ce3ddf7d3fe49a0c2dbe2eb34101b", + "blockNumber": 19633815, + "txIdx": 10 + }, + { + "hash": "0x0a76176cba22c9aa9435fa5823659145339805e36c6c5033eaceb2b26ee301db", + "blockNumber": 19633815, + "txIdx": 11 + } + ], + "1": [ + { + "hash": "0xdde7084de4ba4ff25d5f42653b1831964433d9d190894c8b766fb21bbbc73742", + "blockNumber": 19633623, + "txIdx": 27 + }, + { + "hash": "0x132f772759620db7db431152dc3fb3ff951e877323cb4abc75f52e8ea89e3f34", + "blockNumber": 19633623, + "txIdx": 28 + }, + { + "hash": "0xdb350d5778348f27e717db32a78ea94ce31976cc9cb3e9ff0addc821702d12b8", + "blockNumber": 19633623, + "txIdx": 29 + }, + { + "hash": "0x04a7767ac815cc23dcb8f329e73f2b7c1ec294880d1416f1adaae63da8624ab3", + "blockNumber": 19633623, + "txIdx": 30 + }, + { + "hash": "0x54592985b5e3eab900c5e492d736c24809c29d9edb831a00244379b73bdeff2b", + "blockNumber": 19633623, + "txIdx": 31 + }, + { + "hash": "0x7d5e90bfe0c4cfba900b06d8e66ce3def08e38d29da643531b417ef4cce63e57", + "blockNumber": 19633367, + "txIdx": 119 + }, + { + "hash": "0x87690913eb40059134445005bb3618675f6d07e386ba1e4b142abe8d7f7d96ed", + "blockNumber": 19632279, + "txIdx": 76 + }, + { + "hash": "0x3758ff8ab60848cd2926bf93cb00bec46ce39476fdf399310994acd40dd9be4b", + "blockNumber": 19632279, + "txIdx": 118 + }, + { + "hash": "0x409bf19bf1406b52c84044542edeae390c5b39a7025fd26fc278f835828ff278", + "blockNumber": 19631767, + "txIdx": 142 + }, + { + "hash": "0xe608cf1396a76c75ec499a46aabff8c95495aea5c7e82a9a4a6106df853538ce", + "blockNumber": 19631767, + "txIdx": 143 + }, + { + "hash": "0x2dad3090095cea9dba33f69de373cd7bb4dc2bed3adfbde04fc66145afee3c99", + "blockNumber": 19631639, + "txIdx": 98 + }, + { + "hash": "0x715ec6c7f4f5ef72278e0b7702f3e9bd777c5b63200eac190fb9f48d50990bff", + "blockNumber": 19631639, + "txIdx": 156 + }, + { + "hash": "0x97a4d6b989c3ec24a79ab815a39b5b93633929f38ea779a5443ce0d806d295fb", + "blockNumber": 19631639, + "txIdx": 157 + }, + { + "hash": "0x61658796184561c1b265c012041d93be2b05cf52cd6f28bb2023457c84c59097", + "blockNumber": 19631447, + "txIdx": 123 + }, + { + "hash": "0x0bcd40aa2334341b7962a0617790c11e93159bc95336726fa1233f8fb5630945", + "blockNumber": 19631447, + "txIdx": 124 + }, + { + "hash": "0xf3a17dee29b21f465ee9690501e1dd3278d16ace405ed720f5bd42789488ae45", + "blockNumber": 19631447, + "txIdx": 134 + }, + { + "hash": "0xca489eb710bca933ff304272e96114e6f6e32a8f6db8d3b4cc9e3df3b154dcef", + "blockNumber": 19631383, + "txIdx": 83 + }, + { + "hash": "0xbcde1fe8ccfdbc272e3e5877c4cc7bc36327b647dfc7d1532e4659cbc52670cc", + "blockNumber": 19630871, + "txIdx": 23 + }, + { + "hash": "0xd2045e1ebf0afbf5b3375272d2ae3a1a0581dfba7f379cd903aba5debfb6b6a8", + "blockNumber": 19630871, + "txIdx": 24 + }, + { + "hash": "0x0a8afcf0d8405cd98455596fd6082cdaa040168f89c31b42d486cb241599c2e3", + "blockNumber": 19630871, + "txIdx": 25 + } + ], + "2": [ + { + "hash": "0xd264b7d5e5b71d14872bf2cbe004a39d9ad8d9028107025e7b709fd14583bf6d", + "blockNumber": 19633943, + "txIdx": 0 + }, + { + "hash": "0xc2ddcde61aac008d2f6c8be5d3cdb1d9146eb837fd6c7dbd86cb4530e9df2431", + "blockNumber": 19633943, + "txIdx": 1 + }, + { + "hash": "0xff260f8731374392d07d89d0e892aba327dab9f8a2d8a3c9dfc2b11c6cfebc86", + "blockNumber": 19633943, + "txIdx": 2 + }, + { + "hash": "0x562574fc42212280212c02fe108875ddf81dc4bb6e06aaf9e01a17ff5f9f17c1", + "blockNumber": 19633943, + "txIdx": 3 + }, + { + "hash": "0xcd92c4a4a90a44c72b96db4d45401ac2e9a93067882fb4aa58b159c88342c749", + "blockNumber": 19633943, + "txIdx": 4 + }, + { + "hash": "0x7d3c01f046239228d91c61c91e7a9395fa66f05a2c9033e89df72189dfc891da", + "blockNumber": 19633943, + "txIdx": 5 + }, + { + "hash": "0xabe738c0bfa39e36884ecaee329f32212d0eb048c9a23eb2c5ab325dde961060", + "blockNumber": 19633943, + "txIdx": 6 + }, + { + "hash": "0x29798acdfa4aafb6de8d010a767e545b63a23f41ed232e57c6ed8cf2fd7964b3", + "blockNumber": 19633943, + "txIdx": 7 + }, + { + "hash": "0x228d720aa76719a131894d0a63866dd07ecbf6e5da622ca0560b5440104a7752", + "blockNumber": 19633943, + "txIdx": 8 + }, + { + "hash": "0xabe7ff22989f686f013e975dfc5188c47402442b8b229321cf3d2b433e9ab3f3", + "blockNumber": 19633943, + "txIdx": 9 + }, + { + "hash": "0xc18ef5465ff4ab7d82ae48c4e101b9c9abce763d4b632fadac57371cf8290bb3", + "blockNumber": 19633943, + "txIdx": 10 + }, + { + "hash": "0x4b5b1ad387a8b8ffbf7008a1b73df407c9332f3cf66766713629039b24bfc800", + "blockNumber": 19633943, + "txIdx": 11 + }, + { + "hash": "0xab187c6b146559d8e5727084bb4bd4ec6c6a9bff77a799b7e535e820d4f713f5", + "blockNumber": 19633943, + "txIdx": 13 + }, + { + "hash": "0x8a2399c2d9ca923d07d180be21336e7933cad93c7c7b6c8d631ac8584a6c91c2", + "blockNumber": 19633943, + "txIdx": 14 + }, + { + "hash": "0x1ecb98828086ec86a59a24693c436fab7e0aa77beebff854a742b654d89ad7ad", + "blockNumber": 19633943, + "txIdx": 23 + }, + { + "hash": "0xe9dc4b90818678edeb6d178e836d06d9c20fe976be0caca5076e77a2969a1df1", + "blockNumber": 19633943, + "txIdx": 24 + }, + { + "hash": "0x9ee9b0c42899084933357d3ed3c2f326cd4b291a77af747436982473a6eb7e45", + "blockNumber": 19633943, + "txIdx": 27 + }, + { + "hash": "0x5aa7448ef47452016e604a6c87150eafadcfc4433ecd0ae1b2164684cf5ab1e3", + "blockNumber": 19633943, + "txIdx": 28 + }, + { + "hash": "0xe9f231f5389e76c35219e37aa18174994b485dd8b815656f312fb23752ecae70", + "blockNumber": 19633943, + "txIdx": 29 + }, + { + "hash": "0x7f0ea62f68afa0a91badf081271aecbf0d130c315890467465a12006f64c36ac", + "blockNumber": 19633943, + "txIdx": 30 + }, + { + "hash": "0x3312660504d96ea47987d209f46b2787006c7a554737037816ecb83523a8a384", + "blockNumber": 19633943, + "txIdx": 31 + }, + { + "hash": "0x0e3bf3935918eb4e40cf353c0d248b0ee8bba82019a01d21f6f4b89b99deb890", + "blockNumber": 19633943, + "txIdx": 32 + }, + { + "hash": "0x15a99ed82405ce1c8ead2325ca4c262269ac3843dafa7afd5fd2e329286128dc", + "blockNumber": 19633943, + "txIdx": 33 + }, + { + "hash": "0x07e76dc3f8dad42ad4cdc4b258b8843ebf872f2d9a8fd1f54436fca48d507245", + "blockNumber": 19633943, + "txIdx": 34 + }, + { + "hash": "0x3a8957ff1da5352a55cd8c1d938b6f4da2aeff3183f29bfc0e26cba19ec6374f", + "blockNumber": 19633943, + "txIdx": 38 + }, + { + "hash": "0xf9ca12f620db2aec15ba8414e40e001a52a619aeac5e8214390e2f46308fc65c", + "blockNumber": 19633943, + "txIdx": 39 + }, + { + "hash": "0x9da7ac4a0f8249dc1f814bf8efdc29f500560885ea080e0120b1ed3705919d8f", + "blockNumber": 19633943, + "txIdx": 40 + }, + { + "hash": "0x3d86f648bd01d6bf5a63ebaae71fc4bbe3f1a0bcc48f1fcb2110792d214d2f9e", + "blockNumber": 19633943, + "txIdx": 41 + }, + { + "hash": "0x07128cb0ecb1d8754a6ca03010c180a6b54340810d2b3edde8391edaa73d15d8", + "blockNumber": 19633943, + "txIdx": 42 + }, + { + "hash": "0x8eaa5bc1bfb9496ea1fa4c875b068f883cea4fbe643e67464ea2f2d8ade2720d", + "blockNumber": 19633943, + "txIdx": 43 + }, + { + "hash": "0xe583bd3579918fbddd1c2aa8f9792d10dad88d8e9daf8595d2c24f510ace21a8", + "blockNumber": 19633943, + "txIdx": 44 + }, + { + "hash": "0x6a81e658883434e1ad18c6b07fbe60f4c61b70c740f9f189f1789fbb790e0d17", + "blockNumber": 19633943, + "txIdx": 45 + } + ], + "3": [ + { + "hash": "0xabc5cae3f8af5afd8f28611d621b6308aa3c457584a4b8db6e575e809908ae80", + "blockNumber": 19633879, + "txIdx": 14 + }, + { + "hash": "0xb95e96a7933ea2e318f2aaa8aa5dec0d73799fa9c0da77cddc2d4ce6e28b789d", + "blockNumber": 19633879, + "txIdx": 19 + }, + { + "hash": "0x9ea73b0077fad619783970d0066aed67e79be2967ede07dc6bef801bde0bcc83", + "blockNumber": 19633815, + "txIdx": 35 + }, + { + "hash": "0xc3d325d50c50b73568395eac12b12a4ac18a476520aa1af9e416513d7c2fa393", + "blockNumber": 19633687, + "txIdx": 88 + }, + { + "hash": "0x48a8dafac10e920ae33b30491361edff3de4e8f8320156c573e88ad7ba27e7a5", + "blockNumber": 19633687, + "txIdx": 90 + }, + { + "hash": "0xc6802212eb18677188daeec645daa71d8875be34416d69cf21dd391501003731", + "blockNumber": 19633623, + "txIdx": 148 + }, + { + "hash": "0x2b9caf1b5771a4b63259dc5079d4727b998b7f5c842baf5691805b10879efcaf", + "blockNumber": 19633623, + "txIdx": 149 + }, + { + "hash": "0x6922a6d8febc09e05cb24534f59ff638604f2b177a6e2e8c97a0daef4687a9b4", + "blockNumber": 19633623, + "txIdx": 150 + }, + { + "hash": "0xe3cd28f06b307b3688348dca47d35a6bfd82d65919c1f905e0690b6298db6388", + "blockNumber": 19633623, + "txIdx": 151 + }, + { + "hash": "0x3a90794377e416fb7c48de9e8682bb58c4fe4239bd2459bd41edf26ebe1d82ff", + "blockNumber": 19633623, + "txIdx": 152 + }, + { + "hash": "0xb9d025d3e1027c6e168cde57d27d3db21f20fbced702352c9a642a29ebee7abb", + "blockNumber": 19633623, + "txIdx": 153 + }, + { + "hash": "0x2389165933c02e2bc64ccbe20e9c66a5cfe6cf9fee55e24b2b3ba04887b710dc", + "blockNumber": 19633495, + "txIdx": 118 + }, + { + "hash": "0xe0191884a14b0708399bd1be0f1c7918a004a7e8a02865091480a43f31ec3ac9", + "blockNumber": 19633495, + "txIdx": 121 + }, + { + "hash": "0x88195f7e8724b3c2f39df9554e63eeb1eb31abe2d70f15668a4b9e72f5fbe5ee", + "blockNumber": 19633495, + "txIdx": 138 + }, + { + "hash": "0xebed91477f66caa45543fc1ff410e8841c364acb55224480dc04be9bb42ec57f", + "blockNumber": 19633495, + "txIdx": 139 + }, + { + "hash": "0x0856186dde36546fa033e79d62d81283327c0ba2f0870b551d38b1c9762c3acf", + "blockNumber": 19633495, + "txIdx": 140 + }, + { + "hash": "0xd50d7d24def61f3fa2e69a50e16088c79862d36334a882a820891ffef8e8407e", + "blockNumber": 19633495, + "txIdx": 141 + }, + { + "hash": "0xc8bc355aeea04b372ee81b239d18211cdc174698f4f57f5fac36dde9eed6c5e4", + "blockNumber": 19633431, + "txIdx": 79 + }, + { + "hash": "0xb3396e14e375910ec4fd9008b146ba145d0b8b68d422c318b07a2963e915eecf", + "blockNumber": 19633367, + "txIdx": 131 + }, + { + "hash": "0xb3fb45c5de17e2b9c95a84933953addb80a0b2d8ce096b9e7454185cdb68951d", + "blockNumber": 19633303, + "txIdx": 75 + }, + { + "hash": "0x04e3041e2eb41aa305449036a86fc81549c32d73a5166f6d918a1cdbb7b6ae9e", + "blockNumber": 19633175, + "txIdx": 49 + }, + { + "hash": "0x0f73052a3822aa136dfbd0460470fa9c425461ff54732b63eb082a5cd95ef7a6", + "blockNumber": 19633047, + "txIdx": 88 + }, + { + "hash": "0xeb0807afa593ce0dbef3b263fe00b4aac043822e4344580a7f1a781733bdefa3", + "blockNumber": 19633047, + "txIdx": 89 + }, + { + "hash": "0xee7b7f879b4b9ba420f3010b3ce33502e91497991ccb4688581c37436482ec45", + "blockNumber": 19633047, + "txIdx": 122 + }, + { + "hash": "0xe02a2a6e1d94b54511d891d07833264c99f0b1b553549222a116b9252db615ee", + "blockNumber": 19633047, + "txIdx": 123 + }, + { + "hash": "0xa6f638f6ef7791831d393a3fb1999ec311d2ae999378137de05713709ca30b96", + "blockNumber": 19632919, + "txIdx": 107 + }, + { + "hash": "0x36abacfd89ba4f1eb864aee44ecdc8076254530d1e78f01501e96c2a1f056485", + "blockNumber": 19632919, + "txIdx": 109 + }, + { + "hash": "0x4003512ca0e29bee3daeed47da475613634f4dd1fe3c57be4556e1da1fe7bb4e", + "blockNumber": 19632919, + "txIdx": 110 + }, + { + "hash": "0xa5c0d61f0b263f75f26d95876554777c1e75022aba715650e2dec1b213b6b054", + "blockNumber": 19632919, + "txIdx": 111 + }, + { + "hash": "0xf6c254f9ee0433789d395ec8cc6d963ef6afb946b2b24677404f320f89e062f1", + "blockNumber": 19632919, + "txIdx": 112 + }, + { + "hash": "0x36fad02bbca145cbbd01e739958d5364db2e32fdb45d828899700d56a06bc9fd", + "blockNumber": 19632919, + "txIdx": 150 + }, + { + "hash": "0x2ae4dd22bb1afdeeeba72f5adc018aa01562c4637a29bcafb7acb41dbd25f61b", + "blockNumber": 19632855, + "txIdx": 89 + } + ] + }, + "category": { + "default": [ + { + "hash": "0xd264b7d5e5b71d14872bf2cbe004a39d9ad8d9028107025e7b709fd14583bf6d", + "blockNumber": 19633943, + "txIdx": 0 + }, + { + "hash": "0xc2ddcde61aac008d2f6c8be5d3cdb1d9146eb837fd6c7dbd86cb4530e9df2431", + "blockNumber": 19633943, + "txIdx": 1 + }, + { + "hash": "0xff260f8731374392d07d89d0e892aba327dab9f8a2d8a3c9dfc2b11c6cfebc86", + "blockNumber": 19633943, + "txIdx": 2 + }, + { + "hash": "0x562574fc42212280212c02fe108875ddf81dc4bb6e06aaf9e01a17ff5f9f17c1", + "blockNumber": 19633943, + "txIdx": 3 + }, + { + "hash": "0xcd92c4a4a90a44c72b96db4d45401ac2e9a93067882fb4aa58b159c88342c749", + "blockNumber": 19633943, + "txIdx": 4 + }, + { + "hash": "0x7d3c01f046239228d91c61c91e7a9395fa66f05a2c9033e89df72189dfc891da", + "blockNumber": 19633943, + "txIdx": 5 + }, + { + "hash": "0xabe738c0bfa39e36884ecaee329f32212d0eb048c9a23eb2c5ab325dde961060", + "blockNumber": 19633943, + "txIdx": 6 + }, + { + "hash": "0x29798acdfa4aafb6de8d010a767e545b63a23f41ed232e57c6ed8cf2fd7964b3", + "blockNumber": 19633943, + "txIdx": 7 + }, + { + "hash": "0x228d720aa76719a131894d0a63866dd07ecbf6e5da622ca0560b5440104a7752", + "blockNumber": 19633943, + "txIdx": 8 + }, + { + "hash": "0xabe7ff22989f686f013e975dfc5188c47402442b8b229321cf3d2b433e9ab3f3", + "blockNumber": 19633943, + "txIdx": 9 + }, + { + "hash": "0xc18ef5465ff4ab7d82ae48c4e101b9c9abce763d4b632fadac57371cf8290bb3", + "blockNumber": 19633943, + "txIdx": 10 + }, + { + "hash": "0x4b5b1ad387a8b8ffbf7008a1b73df407c9332f3cf66766713629039b24bfc800", + "blockNumber": 19633943, + "txIdx": 11 + }, + { + "hash": "0x27a31adf999e66d7696b49a840dab942dd9065ab7aaeb3ca0b70eb3d29c2c7e5", + "blockNumber": 19633943, + "txIdx": 12 + }, + { + "hash": "0xab187c6b146559d8e5727084bb4bd4ec6c6a9bff77a799b7e535e820d4f713f5", + "blockNumber": 19633943, + "txIdx": 13 + }, + { + "hash": "0x8a2399c2d9ca923d07d180be21336e7933cad93c7c7b6c8d631ac8584a6c91c2", + "blockNumber": 19633943, + "txIdx": 14 + }, + { + "hash": "0xac17f69806d27579fc308e7df47ab39dbf796ffa2d6ef1723c7a129c6b3a8aea", + "blockNumber": 19633943, + "txIdx": 15 + }, + { + "hash": "0xf33d3280c07d0f6f07e62c37729022282159bff68817f02668616fa986b5f089", + "blockNumber": 19633943, + "txIdx": 16 + }, + { + "hash": "0x389410bb717456b97f887106cc2bdc30e055c922eda56d7d6cae145d731aeb0d", + "blockNumber": 19633943, + "txIdx": 17 + }, + { + "hash": "0x3701fae0795994ce811dcb0d074fbbdab475052a55f40de4c57365e368911c8b", + "blockNumber": 19633943, + "txIdx": 18 + }, + { + "hash": "0xfdc17d02067abb2a7577d06214e11799c7dfabb2ff34f88a452531824edba22a", + "blockNumber": 19633943, + "txIdx": 19 + }, + { + "hash": "0x71b12286526580df4210b6a3b55eed352dde7ebccf26992d90303c8578a99d9b", + "blockNumber": 19633943, + "txIdx": 20 + }, + { + "hash": "0x45e6edfd990aa815566b6b1dc5966aa57facc199080cf4b965d180453ae862cd", + "blockNumber": 19633943, + "txIdx": 21 + }, + { + "hash": "0xb7c419bcd3a43c3baba88ff3cbb7539ca8ff4fab31b8e2de9f88cbfbb19863ec", + "blockNumber": 19633943, + "txIdx": 22 + }, + { + "hash": "0x1ecb98828086ec86a59a24693c436fab7e0aa77beebff854a742b654d89ad7ad", + "blockNumber": 19633943, + "txIdx": 23 + }, + { + "hash": "0xe9dc4b90818678edeb6d178e836d06d9c20fe976be0caca5076e77a2969a1df1", + "blockNumber": 19633943, + "txIdx": 24 + }, + { + "hash": "0xf67e6ca8c9243b4184b1de8808da1982588d80db0685628cc64944b20b220ff4", + "blockNumber": 19633943, + "txIdx": 25 + }, + { + "hash": "0xda50f23bf9c82c2fdb416cf191cf4c0b11e1fde332510fb998ce87f3476e7ca5", + "blockNumber": 19633943, + "txIdx": 26 + }, + { + "hash": "0x9ee9b0c42899084933357d3ed3c2f326cd4b291a77af747436982473a6eb7e45", + "blockNumber": 19633943, + "txIdx": 27 + }, + { + "hash": "0x5aa7448ef47452016e604a6c87150eafadcfc4433ecd0ae1b2164684cf5ab1e3", + "blockNumber": 19633943, + "txIdx": 28 + }, + { + "hash": "0xe9f231f5389e76c35219e37aa18174994b485dd8b815656f312fb23752ecae70", + "blockNumber": 19633943, + "txIdx": 29 + }, + { + "hash": "0x7f0ea62f68afa0a91badf081271aecbf0d130c315890467465a12006f64c36ac", + "blockNumber": 19633943, + "txIdx": 30 + }, + { + "hash": "0x3312660504d96ea47987d209f46b2787006c7a554737037816ecb83523a8a384", + "blockNumber": 19633943, + "txIdx": 31 + } + ], + "large": [ + { + "hash": "0x0a575fe45d824d52fbb1f4b5a11943c3ea8427e8a837d3d234a138d39b5cba44", + "blockNumber": 19633751, + "txIdx": 8 + }, + { + "hash": "0x2ba93a80d2d3288490308cea7e015f444337ec066eda5b5b0549e10b1a5fc4c2", + "blockNumber": 19633751, + "txIdx": 88 + }, + { + "hash": "0x09a08f9f33d001ae154e3997d71a2c78f4baff628e2cf2b1080c86aa00e45163", + "blockNumber": 19633623, + "txIdx": 21 + }, + { + "hash": "0xb80d4af148b52b95eb9aa2a62de1c996b7fbcb07f3ce7a6260bbbeaa5dd4f597", + "blockNumber": 19633495, + "txIdx": 4 + }, + { + "hash": "0x48b5fd512bb2ca8669836ca8ebde14e3992b9251f0f16a88a01f3dea7439ac57", + "blockNumber": 19633367, + "txIdx": 0 + }, + { + "hash": "0x85964f7a3a750ef4f6908eef67c2faca506ddf23406c501574dacfbca9a749cb", + "blockNumber": 19633303, + "txIdx": 0 + }, + { + "hash": "0x08be6a50bb5a1edcf30ccdc5cd20bd18f80542c68b17c8c1d255771bb6ea7c23", + "blockNumber": 19633303, + "txIdx": 3 + }, + { + "hash": "0x5e8dbeabca67c15f61262e7df95bc56f133d54b210f076f5425b3a7d5c71834f", + "blockNumber": 19633303, + "txIdx": 4 + }, + { + "hash": "0x7ab184ffae003a7a814fc87a99233ba2df67fdd26c755b39f319da3f953ec47e", + "blockNumber": 19633303, + "txIdx": 139 + }, + { + "hash": "0x7556427e4281eac8f69acc4127dd1834bc6a535e3973661d427513d9741e9fe3", + "blockNumber": 19633239, + "txIdx": 145 + }, + { + "hash": "0x2de0a2f0a04d1646925f3b5653704c54de2063b7f6720c967771e59a51c6d276", + "blockNumber": 19632983, + "txIdx": 2 + }, + { + "hash": "0x357d8080b02f9100d869a3ef93b93cdc62606ffef50e06f94ff86c27ce8f4c46", + "blockNumber": 19632855, + "txIdx": 17 + }, + { + "hash": "0x73040f4eec5f34a9cfbbcde4bfa56c39edaf4a3064cc1cdd6c96d2c728168580", + "blockNumber": 19632791, + "txIdx": 5 + }, + { + "hash": "0x18b54425fcef995fe017d35fadbeef641a53db4c6027e1d06c64e535eef084c3", + "blockNumber": 19632791, + "txIdx": 9 + }, + { + "hash": "0x826dd92a29ca3c41a2ebe2465576aee5a018e67beeda113c54d0aef2d6be1bae", + "blockNumber": 19632791, + "txIdx": 235 + }, + { + "hash": "0x04818a6c8a7de2b83e7330cb8fcf29c88d847f2f983fb44dda1f75a047dbd021", + "blockNumber": 19632599, + "txIdx": 127 + }, + { + "hash": "0x62f17cc519e6f112c29c468bb0c467be6ab98e6380e20536fff3a4bdcaac56cc", + "blockNumber": 19632535, + "txIdx": 0 + }, + { + "hash": "0xdd1b4dc16b36f0a5478007494728ce60d66b4d8f286aa787d69777dfe3cf2be1", + "blockNumber": 19632535, + "txIdx": 2 + }, + { + "hash": "0x01953615529967f0c865979d127a0bb35c15ddad89feafeb6ac3577f37923d98", + "blockNumber": 19632279, + "txIdx": 65 + }, + { + "hash": "0x770ec887f414d40bf4c72d4fcfdf0083905c50c28bd9f92077fd9420c24bbac4", + "blockNumber": 19632215, + "txIdx": 140 + }, + { + "hash": "0x7645fe9f67abb7694d532fdec828e063ef6800a715714a6f523ff532ca325e5b", + "blockNumber": 19632151, + "txIdx": 8 + }, + { + "hash": "0x6fa82113c7bed2ec03264bd8f9ea485d7a76c871943de3ea0d5a103c534d7ca6", + "blockNumber": 19632151, + "txIdx": 19 + }, + { + "hash": "0x1d73bb351f4230837b62c3845100b5b544871021ec19fb07079d73dd525ec32f", + "blockNumber": 19632023, + "txIdx": 2 + }, + { + "hash": "0xc07e84bb8126569ff01a3b5fc3d65c382d1dda186f48758aa6dab76915549509", + "blockNumber": 19632023, + "txIdx": 131 + }, + { + "hash": "0x1e910aefe0376e86318bf9f5d4be2a7d51dc4db70250f275a4767f1834e9c326", + "blockNumber": 19631831, + "txIdx": 10 + }, + { + "hash": "0x414811df2c1f6216766a83916f12b1b86149db0f179c1765622a30a45bad722c", + "blockNumber": 19631767, + "txIdx": 1 + }, + { + "hash": "0x2eba68e81b21f8eb52b55b0f47e50d9bfc0eb8bb94f2d26aaa756b45ab9f6820", + "blockNumber": 19631639, + "txIdx": 117 + }, + { + "hash": "0x20debc5392c8971549a668c4613bb9691870c40e61d0d027575b848dcbe540e4", + "blockNumber": 19631447, + "txIdx": 157 + }, + { + "hash": "0x00e454f9ae012b1b6bc3dbef2ecf8b9be07daf8b38710ba27654d60282fe6ffe", + "blockNumber": 19631383, + "txIdx": 6 + }, + { + "hash": "0xada1ecab4dd372118fbe7083d080ede43ac4510c3bb096d8b4751f6d4e52bc9a", + "blockNumber": 19631255, + "txIdx": 5 + }, + { + "hash": "0xd51b27d5084cf05b89f7068a656236ce90280ebbe467a82b015db51c57b51db6", + "blockNumber": 19631255, + "txIdx": 8 + }, + { + "hash": "0xf23ff67e9572bcb5fbbeedd5520c9b98b9aba25c8e66de7760c79d0653338078", + "blockNumber": 19631255, + "txIdx": 10 + } + ], + "max": [ + { + "hash": "0xe0401c563b0cd49d7a99c623d599e564165b761f1704dc414aceb0574621f23f", + "blockNumber": 19633815, + "txIdx": 151 + }, + { + "hash": "0x1388731fd8256ae4ec1ca0ec81f623c032ac9c32a000435257e7ba6e0772d160", + "blockNumber": 19633687, + "txIdx": 2 + }, + { + "hash": "0x3b0e507a0f174f0ce22d3a578481127004dcc3683839bc15f26c6d5161314d5e", + "blockNumber": 19633687, + "txIdx": 4 + }, + { + "hash": "0x194eba8ce9c72290690f1fb60b79726c42f3c3ac669551023583cb133eea053b", + "blockNumber": 19633559, + "txIdx": 1 + }, + { + "hash": "0x06d55f299e317b47de24e82948a553d0f7d3b998eb66a1fc6585ed5cc41b1967", + "blockNumber": 19633559, + "txIdx": 5 + }, + { + "hash": "0x159773a550ee7c7b66d8dd52833997d84c97bf1fdf463030ca855a33664c8d9e", + "blockNumber": 19633495, + "txIdx": 1 + }, + { + "hash": "0x60ed4bb62690bdc9b9a745a4ad5c97a7189c1297808cbb9564e9b647f372e7c7", + "blockNumber": 19633367, + "txIdx": 271 + }, + { + "hash": "0x56df5c8a662ebac22618e04d962f5da736834d56a586158811026ec89953c1bd", + "blockNumber": 19633239, + "txIdx": 10 + }, + { + "hash": "0x4221fb616cf10382457afc0a9298081dcdea281c77075fbb1b8454938a625a34", + "blockNumber": 19633175, + "txIdx": 47 + }, + { + "hash": "0xc152bd1642b7dc9812164f40b775a667361df416e90683e187646f99515e156f", + "blockNumber": 19633111, + "txIdx": 1 + }, + { + "hash": "0x6e262c3dcc9d4963645e75c8b286bfcee9fbd5405872fdf7817056932c3c3707", + "blockNumber": 19633111, + "txIdx": 4 + }, + { + "hash": "0xd6aa8b7748b3256b70b0556fa5274be5ad432127a38c866dd47e577e829cfe41", + "blockNumber": 19633111, + "txIdx": 152 + }, + { + "hash": "0x57ce041e6795e670f920cf65ad22c2e8faf7807b9b7c1465052b201d1f2ba5bd", + "blockNumber": 19633047, + "txIdx": 34 + }, + { + "hash": "0x5684fb63936bee191ae884135fb5cd7be38b298f66578a740c3498b20b230127", + "blockNumber": 19632983, + "txIdx": 0 + }, + { + "hash": "0x633a3f6acfdd722c14ccccea8c26970f6ead084e05ed061b0700b65e9b1a7ea5", + "blockNumber": 19632983, + "txIdx": 4 + }, + { + "hash": "0x7fc53c666dde699ea13c11bdb23215d8468e00e99fcd409ebbfc0c051ef54daa", + "blockNumber": 19632983, + "txIdx": 11 + }, + { + "hash": "0xfb20dd9f49096ceb3bf1e86f1321f756eba0b153bd2185f6a035ad1374aa98d2", + "blockNumber": 19632983, + "txIdx": 213 + }, + { + "hash": "0xeae9bc50409f059e2e20fc74f128dbfa9d3c5b67b42b36ba363ddfae7a0eec8d", + "blockNumber": 19632791, + "txIdx": 0 + }, + { + "hash": "0x960a87ee453f24dc926acb8fdad01c53413ef6b6998d1c5b600b6751e2b8b9f0", + "blockNumber": 19632791, + "txIdx": 4 + }, + { + "hash": "0xd61cde589e941d400005ba7e8331be371b3bfb9014bebdd2bdce969438e6bd6b", + "blockNumber": 19632791, + "txIdx": 8 + }, + { + "hash": "0xb9cc6faa48661abf3fd131025532b039d8513d897b1308611671cbc8d943cfde", + "blockNumber": 19632663, + "txIdx": 0 + }, + { + "hash": "0xa747239fae262ee03b47e6c18e875399fe6892b269f55ac807d6317a1cc937b7", + "blockNumber": 19632663, + "txIdx": 5 + }, + { + "hash": "0xfb8d0f1e3f17d7a9855a4377b9b493f62c14d7b670387d5dda019fcb779858ff", + "blockNumber": 19632663, + "txIdx": 6 + }, + { + "hash": "0x4f9f49497295ec02da0e48eaafd6e37966c5ade1b33bbbe4feb65f095e60a022", + "blockNumber": 19632663, + "txIdx": 10 + }, + { + "hash": "0x1ba55f53b41a6c2b7dc5013e25947fddc65de6a07c04d533bd47b28d6d67d483", + "blockNumber": 19632663, + "txIdx": 15 + }, + { + "hash": "0x7334ede43c55c23cf12560d4810ad3492ce30f032b1a4739a27b1108dad61b36", + "blockNumber": 19632599, + "txIdx": 0 + }, + { + "hash": "0x52ef75fa2f1fdee9d930672fea77524a56441e957eb6560fe5dd9d045d5b990c", + "blockNumber": 19632599, + "txIdx": 6 + }, + { + "hash": "0xbd314a78692ea9050fccd43974606cbecad20d09b60b728be7a6a22818708524", + "blockNumber": 19632599, + "txIdx": 11 + }, + { + "hash": "0x046d637c93fcc3297b051cecd4b1666f1b741cf6c08cf69785f8c7f819ff4fa5", + "blockNumber": 19632535, + "txIdx": 4 + }, + { + "hash": "0x26d4302f217ba92d9e767f9eba4918e53181df5c9d83c24ddb6675d9db6726eb", + "blockNumber": 19632535, + "txIdx": 6 + }, + { + "hash": "0x04ca444813e7a8b0925e4a2ed9eab0b9021c011e0b2b17d89a8e103b23ca8b55", + "blockNumber": 19632471, + "txIdx": 4 + }, + { + "hash": "0x15ffb15b7b1012d6ffecc953dca408f6b1b50b026ea202f944551e8f43066cdf", + "blockNumber": 19632471, + "txIdx": 11 + } + ], + "oversize": [] + } + }, + "rc": { + "events": [ + { + "hash": "0xd264b7d5e5b71d14872bf2cbe004a39d9ad8d9028107025e7b709fd14583bf6d", + "blockNumber": 19633943, + "txIdx": 0, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0xd264b7d5e5b71d14872bf2cbe004a39d9ad8d9028107025e7b709fd14583bf6d", + "blockNumber": 19633943, + "txIdx": 0, + "logIdx": 1, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0xd264b7d5e5b71d14872bf2cbe004a39d9ad8d9028107025e7b709fd14583bf6d", + "blockNumber": 19633943, + "txIdx": 0, + "logIdx": 2, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0xd264b7d5e5b71d14872bf2cbe004a39d9ad8d9028107025e7b709fd14583bf6d", + "blockNumber": 19633943, + "txIdx": 0, + "logIdx": 3, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0xd264b7d5e5b71d14872bf2cbe004a39d9ad8d9028107025e7b709fd14583bf6d", + "blockNumber": 19633943, + "txIdx": 0, + "logIdx": 4, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0xd264b7d5e5b71d14872bf2cbe004a39d9ad8d9028107025e7b709fd14583bf6d", + "blockNumber": 19633943, + "txIdx": 0, + "logIdx": 5, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0xd264b7d5e5b71d14872bf2cbe004a39d9ad8d9028107025e7b709fd14583bf6d", + "blockNumber": 19633943, + "txIdx": 0, + "logIdx": 6, + "eventSchema": "0x78ad7ec0e9f89e74012afa58738b6b661c024cb0fd185ee2f616c0a28924bd66" + }, + { + "hash": "0xd264b7d5e5b71d14872bf2cbe004a39d9ad8d9028107025e7b709fd14583bf6d", + "blockNumber": 19633943, + "txIdx": 0, + "logIdx": 7, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0xa40457058bc6d245917ddf63f26a4c664caca3da3c40920fbd72615f1d1bb22c", + "blockNumber": 19633879, + "txIdx": 0, + "logIdx": 0, + "eventSchema": "0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c" + }, + { + "hash": "0xa40457058bc6d245917ddf63f26a4c664caca3da3c40920fbd72615f1d1bb22c", + "blockNumber": 19633879, + "txIdx": 0, + "logIdx": 1, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0xa40457058bc6d245917ddf63f26a4c664caca3da3c40920fbd72615f1d1bb22c", + "blockNumber": 19633879, + "txIdx": 0, + "logIdx": 2, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0xa40457058bc6d245917ddf63f26a4c664caca3da3c40920fbd72615f1d1bb22c", + "blockNumber": 19633879, + "txIdx": 0, + "logIdx": 3, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0xa40457058bc6d245917ddf63f26a4c664caca3da3c40920fbd72615f1d1bb22c", + "blockNumber": 19633879, + "txIdx": 0, + "logIdx": 5, + "eventSchema": "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822" + }, + { + "hash": "0x3d3bd647660e5f38082bd2530b44a4184dee34dff63120c505f496d45225e78d", + "blockNumber": 19633815, + "txIdx": 0, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x3d3bd647660e5f38082bd2530b44a4184dee34dff63120c505f496d45225e78d", + "blockNumber": 19633815, + "txIdx": 0, + "logIdx": 1, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x3d3bd647660e5f38082bd2530b44a4184dee34dff63120c505f496d45225e78d", + "blockNumber": 19633815, + "txIdx": 0, + "logIdx": 2, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x3d3bd647660e5f38082bd2530b44a4184dee34dff63120c505f496d45225e78d", + "blockNumber": 19633815, + "txIdx": 0, + "logIdx": 4, + "eventSchema": "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822" + }, + { + "hash": "0x0e6838484655289ad604ebdc09243e3979c7b155120b276f878e84f5c8cfa4b2", + "blockNumber": 19633751, + "txIdx": 0, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x0e6838484655289ad604ebdc09243e3979c7b155120b276f878e84f5c8cfa4b2", + "blockNumber": 19633751, + "txIdx": 0, + "logIdx": 1, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x0e6838484655289ad604ebdc09243e3979c7b155120b276f878e84f5c8cfa4b2", + "blockNumber": 19633751, + "txIdx": 0, + "logIdx": 3, + "eventSchema": "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822" + }, + { + "hash": "0x0e6838484655289ad604ebdc09243e3979c7b155120b276f878e84f5c8cfa4b2", + "blockNumber": 19633751, + "txIdx": 0, + "logIdx": 4, + "eventSchema": "0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65" + }, + { + "hash": "0x0e6838484655289ad604ebdc09243e3979c7b155120b276f878e84f5c8cfa4b2", + "blockNumber": 19633751, + "txIdx": 0, + "logIdx": 5, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x0e6838484655289ad604ebdc09243e3979c7b155120b276f878e84f5c8cfa4b2", + "blockNumber": 19633751, + "txIdx": 0, + "logIdx": 6, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x0e6838484655289ad604ebdc09243e3979c7b155120b276f878e84f5c8cfa4b2", + "blockNumber": 19633751, + "txIdx": 0, + "logIdx": 8, + "eventSchema": "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822" + }, + { + "hash": "0x0e6838484655289ad604ebdc09243e3979c7b155120b276f878e84f5c8cfa4b2", + "blockNumber": 19633751, + "txIdx": 0, + "logIdx": 9, + "eventSchema": "0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65" + }, + { + "hash": "0x1ff6d9a9637d05be09f2f8354bd4ff63489f1e3500ff3d3e47c73591d0543192", + "blockNumber": 19633687, + "txIdx": 0, + "logIdx": 0, + "eventSchema": "0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c" + }, + { + "hash": "0x1ff6d9a9637d05be09f2f8354bd4ff63489f1e3500ff3d3e47c73591d0543192", + "blockNumber": 19633687, + "txIdx": 0, + "logIdx": 1, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x1ff6d9a9637d05be09f2f8354bd4ff63489f1e3500ff3d3e47c73591d0543192", + "blockNumber": 19633687, + "txIdx": 0, + "logIdx": 2, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x1ff6d9a9637d05be09f2f8354bd4ff63489f1e3500ff3d3e47c73591d0543192", + "blockNumber": 19633687, + "txIdx": 0, + "logIdx": 3, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x1ff6d9a9637d05be09f2f8354bd4ff63489f1e3500ff3d3e47c73591d0543192", + "blockNumber": 19633687, + "txIdx": 0, + "logIdx": 5, + "eventSchema": "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822" + }, + { + "hash": "0x0fd9d460313189999c50581473155009e05eca1c7e7f00fdc3c50b74c44c35b5", + "blockNumber": 19633623, + "txIdx": 0, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x0fd9d460313189999c50581473155009e05eca1c7e7f00fdc3c50b74c44c35b5", + "blockNumber": 19633623, + "txIdx": 0, + "logIdx": 1, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + } + ], + "category": { + "default": [ + { + "hash": "0xd264b7d5e5b71d14872bf2cbe004a39d9ad8d9028107025e7b709fd14583bf6d", + "blockNumber": 19633943, + "txIdx": 0 + }, + { + "hash": "0xc2ddcde61aac008d2f6c8be5d3cdb1d9146eb837fd6c7dbd86cb4530e9df2431", + "blockNumber": 19633943, + "txIdx": 1 + }, + { + "hash": "0xff260f8731374392d07d89d0e892aba327dab9f8a2d8a3c9dfc2b11c6cfebc86", + "blockNumber": 19633943, + "txIdx": 2 + }, + { + "hash": "0x562574fc42212280212c02fe108875ddf81dc4bb6e06aaf9e01a17ff5f9f17c1", + "blockNumber": 19633943, + "txIdx": 3 + }, + { + "hash": "0xcd92c4a4a90a44c72b96db4d45401ac2e9a93067882fb4aa58b159c88342c749", + "blockNumber": 19633943, + "txIdx": 4 + }, + { + "hash": "0x7d3c01f046239228d91c61c91e7a9395fa66f05a2c9033e89df72189dfc891da", + "blockNumber": 19633943, + "txIdx": 5 + }, + { + "hash": "0xabe738c0bfa39e36884ecaee329f32212d0eb048c9a23eb2c5ab325dde961060", + "blockNumber": 19633943, + "txIdx": 6 + }, + { + "hash": "0x29798acdfa4aafb6de8d010a767e545b63a23f41ed232e57c6ed8cf2fd7964b3", + "blockNumber": 19633943, + "txIdx": 7 + }, + { + "hash": "0x228d720aa76719a131894d0a63866dd07ecbf6e5da622ca0560b5440104a7752", + "blockNumber": 19633943, + "txIdx": 8 + }, + { + "hash": "0xabe7ff22989f686f013e975dfc5188c47402442b8b229321cf3d2b433e9ab3f3", + "blockNumber": 19633943, + "txIdx": 9 + }, + { + "hash": "0xc18ef5465ff4ab7d82ae48c4e101b9c9abce763d4b632fadac57371cf8290bb3", + "blockNumber": 19633943, + "txIdx": 10 + }, + { + "hash": "0x4b5b1ad387a8b8ffbf7008a1b73df407c9332f3cf66766713629039b24bfc800", + "blockNumber": 19633943, + "txIdx": 11 + }, + { + "hash": "0x27a31adf999e66d7696b49a840dab942dd9065ab7aaeb3ca0b70eb3d29c2c7e5", + "blockNumber": 19633943, + "txIdx": 12 + }, + { + "hash": "0xab187c6b146559d8e5727084bb4bd4ec6c6a9bff77a799b7e535e820d4f713f5", + "blockNumber": 19633943, + "txIdx": 13 + }, + { + "hash": "0x389410bb717456b97f887106cc2bdc30e055c922eda56d7d6cae145d731aeb0d", + "blockNumber": 19633943, + "txIdx": 17 + }, + { + "hash": "0x3701fae0795994ce811dcb0d074fbbdab475052a55f40de4c57365e368911c8b", + "blockNumber": 19633943, + "txIdx": 18 + }, + { + "hash": "0x45e6edfd990aa815566b6b1dc5966aa57facc199080cf4b965d180453ae862cd", + "blockNumber": 19633943, + "txIdx": 21 + }, + { + "hash": "0xb7c419bcd3a43c3baba88ff3cbb7539ca8ff4fab31b8e2de9f88cbfbb19863ec", + "blockNumber": 19633943, + "txIdx": 22 + }, + { + "hash": "0x5aa7448ef47452016e604a6c87150eafadcfc4433ecd0ae1b2164684cf5ab1e3", + "blockNumber": 19633943, + "txIdx": 28 + }, + { + "hash": "0xe9f231f5389e76c35219e37aa18174994b485dd8b815656f312fb23752ecae70", + "blockNumber": 19633943, + "txIdx": 29 + }, + { + "hash": "0x3312660504d96ea47987d209f46b2787006c7a554737037816ecb83523a8a384", + "blockNumber": 19633943, + "txIdx": 31 + }, + { + "hash": "0x0e3bf3935918eb4e40cf353c0d248b0ee8bba82019a01d21f6f4b89b99deb890", + "blockNumber": 19633943, + "txIdx": 32 + }, + { + "hash": "0x15a99ed82405ce1c8ead2325ca4c262269ac3843dafa7afd5fd2e329286128dc", + "blockNumber": 19633943, + "txIdx": 33 + }, + { + "hash": "0x07e76dc3f8dad42ad4cdc4b258b8843ebf872f2d9a8fd1f54436fca48d507245", + "blockNumber": 19633943, + "txIdx": 34 + }, + { + "hash": "0x4000dac3bb7b7596d4e8bd1b91ca9e2ece258875cfdfde72d9242572d7a85c37", + "blockNumber": 19633943, + "txIdx": 36 + }, + { + "hash": "0x17cf0d796d44195d56ea401fda20773012d51c5ffe08f35bb3437f16b183658a", + "blockNumber": 19633943, + "txIdx": 37 + }, + { + "hash": "0x3a8957ff1da5352a55cd8c1d938b6f4da2aeff3183f29bfc0e26cba19ec6374f", + "blockNumber": 19633943, + "txIdx": 38 + }, + { + "hash": "0xf9ca12f620db2aec15ba8414e40e001a52a619aeac5e8214390e2f46308fc65c", + "blockNumber": 19633943, + "txIdx": 39 + }, + { + "hash": "0x9da7ac4a0f8249dc1f814bf8efdc29f500560885ea080e0120b1ed3705919d8f", + "blockNumber": 19633943, + "txIdx": 40 + }, + { + "hash": "0x07128cb0ecb1d8754a6ca03010c180a6b54340810d2b3edde8391edaa73d15d8", + "blockNumber": 19633943, + "txIdx": 42 + }, + { + "hash": "0xe583bd3579918fbddd1c2aa8f9792d10dad88d8e9daf8595d2c24f510ace21a8", + "blockNumber": 19633943, + "txIdx": 44 + }, + { + "hash": "0x6a81e658883434e1ad18c6b07fbe60f4c61b70c740f9f189f1789fbb790e0d17", + "blockNumber": 19633943, + "txIdx": 45 + } + ], + "medium": [ + { + "hash": "0xef11a91cd6231ae08899ae987c006740bd45ca0a4ccd7167163890f1356a7ff9", + "blockNumber": 19633943, + "txIdx": 100 + }, + { + "hash": "0xbf62264e92b21e6d610594a0bc248dc0fa65b62860513c7cb48506f50ae2f4f2", + "blockNumber": 19633879, + "txIdx": 6 + }, + { + "hash": "0xe1221b367c8ad23366d12ca5bc7fa718c3b076ed626d8cefa2ccbc94198b3977", + "blockNumber": 19633879, + "txIdx": 63 + }, + { + "hash": "0x42f1f18c1884bf4bf1a46fb0f20231505a516236912c7a49fc97267e6ceea9ed", + "blockNumber": 19633815, + "txIdx": 67 + }, + { + "hash": "0x210ba5fe6275574ccd6b8cfd7bd0afcc60f4738242164b726566a1d048347179", + "blockNumber": 19633751, + "txIdx": 206 + }, + { + "hash": "0xb0c9b669ad9f82ba54aeaec967912d8f9368f6cd10b82f912153b86dcf050863", + "blockNumber": 19633687, + "txIdx": 111 + }, + { + "hash": "0xc407b852e361757d4d04a330dd1ad1a3d160365ea9d597ed888f81548c78817f", + "blockNumber": 19633623, + "txIdx": 91 + }, + { + "hash": "0x581abfce76ed219db2f2129ee76edb96e80edf7ecf883d65303b59d495c66db9", + "blockNumber": 19633559, + "txIdx": 80 + }, + { + "hash": "0x56df5c8a662ebac22618e04d962f5da736834d56a586158811026ec89953c1bd", + "blockNumber": 19633239, + "txIdx": 10 + }, + { + "hash": "0x7b3250643fc377ef603c9626eed821814a25d036cd9d1a2f17cfeccc29c0c6e0", + "blockNumber": 19633239, + "txIdx": 45 + }, + { + "hash": "0x88cfc11fd0e555005bc91261feaf6047e2aeeff2d38e81576707490acdf66d61", + "blockNumber": 19633175, + "txIdx": 176 + }, + { + "hash": "0x30b8b6a37bd815e8e50f739967a97f536a4f4d7a0e3a2973a8a5b027bd1d8920", + "blockNumber": 19633111, + "txIdx": 40 + }, + { + "hash": "0xa5eca259deeb9b58fd3581b7b3067e5a596defc7ecc1ee86902d622330dbf512", + "blockNumber": 19633047, + "txIdx": 87 + }, + { + "hash": "0xf7b18e67df15a2ef5712b9cf53c5920fa1324462f30bffb93f4500f4b573100e", + "blockNumber": 19632983, + "txIdx": 51 + }, + { + "hash": "0xa00cfb48b710dd581c54c743181360a5e215ca4f557ea38af22390b22e252b14", + "blockNumber": 19632983, + "txIdx": 159 + }, + { + "hash": "0x1b08e786134b110e7ca062d62e5e8701e552c6a755016806132b020cb47b567a", + "blockNumber": 19632791, + "txIdx": 6 + }, + { + "hash": "0xd61cde589e941d400005ba7e8331be371b3bfb9014bebdd2bdce969438e6bd6b", + "blockNumber": 19632791, + "txIdx": 8 + }, + { + "hash": "0xacb19d460c11cdd4ac83fe7dc7c0a1074b38e5cd3039076f8b7429a6afd9ed6c", + "blockNumber": 19632791, + "txIdx": 178 + }, + { + "hash": "0x40eeb6d7ad69ba60a3a0b371d0638adce544069c80415531570c33bdce31dd10", + "blockNumber": 19632791, + "txIdx": 328 + }, + { + "hash": "0x6b07878cb790cafcdc616857c33fb071236c207490c120b58ea9ce98fe5d38bf", + "blockNumber": 19632791, + "txIdx": 338 + }, + { + "hash": "0x36828dc0ddcf70db2cc921352fcef8425acb94f74f97a8a9686ec93501f8f17f", + "blockNumber": 19632727, + "txIdx": 37 + }, + { + "hash": "0xc1f86c2d033c6a36675b17bf3f2355063688c46c5dcb8159f4b58593c8e46a14", + "blockNumber": 19632727, + "txIdx": 39 + }, + { + "hash": "0xfd9808ab041d3fc14832e3eb5143029edbb67cef50eed9c5c7d15f73ee06c046", + "blockNumber": 19632727, + "txIdx": 108 + }, + { + "hash": "0x80e78b5d5cfb6ca8a1860d4cfbc76e9d22f85642c37ea92845326ba5fb8948a7", + "blockNumber": 19632663, + "txIdx": 47 + }, + { + "hash": "0x1dfe7e4a5ebfcf9c2b3d557cee040204b1ae1ebd33f03ad44e6966f372537b65", + "blockNumber": 19632599, + "txIdx": 9 + }, + { + "hash": "0x81ab5c85515eb0625bbfbd2747ca844c55e824d706db3b7c3a3c0767a7b41dab", + "blockNumber": 19632599, + "txIdx": 12 + }, + { + "hash": "0x57fb9211af3d34158597a1c4b4e037dd66b81a06b3949bd259530a40aa969848", + "blockNumber": 19632535, + "txIdx": 109 + }, + { + "hash": "0x04ca444813e7a8b0925e4a2ed9eab0b9021c011e0b2b17d89a8e103b23ca8b55", + "blockNumber": 19632471, + "txIdx": 4 + }, + { + "hash": "0x15ffb15b7b1012d6ffecc953dca408f6b1b50b026ea202f944551e8f43066cdf", + "blockNumber": 19632471, + "txIdx": 11 + }, + { + "hash": "0xb1cd578a16950358a712eab1576f80d450bdc087203de9318cd3782d7ce61e43", + "blockNumber": 19632471, + "txIdx": 12 + }, + { + "hash": "0xc02aac4f11f32b40fdf0534d7fbb9b4816de7b468cb2b5b54c927d63349a3e36", + "blockNumber": 19632471, + "txIdx": 34 + }, + { + "hash": "0x0112fefa39cde5e7858bed0eafe9896316c3bcbdc2483e2da9567c96acff9ff7", + "blockNumber": 19632343, + "txIdx": 36 + } + ], + "large": [ + { + "hash": "0xb9d9e981947149cc68c932e091e01ff9f4ae951adff4b2e49c52f4f1f220879c", + "blockNumber": 19633943, + "txIdx": 89 + }, + { + "hash": "0xd740d9c5ece3d596db3c338be9bdcde957b03275e636e1ad0827b01038d4440a", + "blockNumber": 19633943, + "txIdx": 99 + }, + { + "hash": "0x1e7054dbac2d9ced7f18e88288060ec4a651e2d7fb170081d9e539e49b4f0543", + "blockNumber": 19633879, + "txIdx": 64 + }, + { + "hash": "0x8aff1f6731ab20b8349c5587dc54478316baecde7f0f3756da13c775f905a571", + "blockNumber": 19633879, + "txIdx": 136 + }, + { + "hash": "0x551a54b0816297e19260377e0d24e206cdd545211c7a46ae8795c5a2442a78a0", + "blockNumber": 19633815, + "txIdx": 59 + }, + { + "hash": "0x332935cd0e02628950d9eb6b3739b0d4498d6e79d31f4f25b3bf9ec65abaa621", + "blockNumber": 19633687, + "txIdx": 143 + }, + { + "hash": "0xf63804df0ac8bdf1b7067c4d869ad685b6bd81142da4919599b4d96b2c968d1c", + "blockNumber": 19633559, + "txIdx": 112 + }, + { + "hash": "0x2ca12bc18c22d596880140237319304c374a76170697fb7dc088ba554cefb1f5", + "blockNumber": 19633495, + "txIdx": 175 + }, + { + "hash": "0xac3ff2399679cd4f94bdfeaaa9343b8db8dd003e57f1ac685dcafa6a253106bf", + "blockNumber": 19633367, + "txIdx": 27 + }, + { + "hash": "0x0bb97fb1303312f5d9939cec4f3ead689150a952be2ba1560147159f2a2eb647", + "blockNumber": 19633303, + "txIdx": 8 + }, + { + "hash": "0x563ae9bc0f1018038f46cdaf15cf44dfaa26c056d9c69cced46c6471e959e452", + "blockNumber": 19633111, + "txIdx": 9 + }, + { + "hash": "0x3f21b0cd00180ed73fda1d616aef05481d405fb5cb1d1e44af3bee17f0e10e99", + "blockNumber": 19633047, + "txIdx": 13 + }, + { + "hash": "0xbea35b062f78f6e83ae6dd8754d889a4675818c61ebf1e513abeb9cf59329608", + "blockNumber": 19632919, + "txIdx": 81 + }, + { + "hash": "0xe4948e0e749e215f3ae779d00f2636ed1977743c1462a520183c9be8f0271ec3", + "blockNumber": 19632855, + "txIdx": 18 + }, + { + "hash": "0x86dbfe8a8b08ef0d786ba20f9b86c16aded255405dbe88af375155e2423fe4c4", + "blockNumber": 19632791, + "txIdx": 14 + }, + { + "hash": "0x78a8a4c9a44645f7bfe7dea7def7f114553ceaa6471b5644f0c9707766a4a94b", + "blockNumber": 19632791, + "txIdx": 16 + }, + { + "hash": "0x20a2dcbbd110f2383a15e84e2ad8fcb6b3ac9417b403f05eeebecc33b03b00c4", + "blockNumber": 19632791, + "txIdx": 193 + }, + { + "hash": "0x30ba905ff8d4ed49d49f7840b7a1f98b56325527dfbb76edcef4144a99cd7bf4", + "blockNumber": 19632791, + "txIdx": 248 + }, + { + "hash": "0x30ea6f9324e363742c804a3affe818788bae32c868f52011cb9306e91199c36d", + "blockNumber": 19632791, + "txIdx": 266 + }, + { + "hash": "0xd95b539d9c1bc77a9558145dddf0edce5fe81a7d92a4c0b7dbcde8e252034f86", + "blockNumber": 19632727, + "txIdx": 69 + }, + { + "hash": "0x267aa8bd0bf99af90b085fc3d0266a496dcabe6481fe22ff08f167e77bea29d5", + "blockNumber": 19632663, + "txIdx": 46 + }, + { + "hash": "0x3dea0ebc57d4e855c026ccbf8f8747c4404b102fe7a07bab357702f8ecffbdcf", + "blockNumber": 19632599, + "txIdx": 27 + }, + { + "hash": "0x4ea431b9aa060da5bd1ffe4ccdc79593047e3c64bed1873a963d9430b65535ee", + "blockNumber": 19632471, + "txIdx": 17 + }, + { + "hash": "0x3a59e3696246e7feeb4b8c6fb7bcd62e73c8db2395c89e76dadc305ef8e32707", + "blockNumber": 19632471, + "txIdx": 31 + }, + { + "hash": "0x62f6e9da0d271184456cd91149e32f33f5328e5f15f172a6ac5925ffa69f0417", + "blockNumber": 19632407, + "txIdx": 5 + }, + { + "hash": "0x37c475fff00abec78284aea597526b1aa92723e84e3a7d798d0877ac1c8fa9c7", + "blockNumber": 19632215, + "txIdx": 9 + }, + { + "hash": "0xf5820bf16e7f5ed99c7f2b98c70c658804288f7e4710142894c0d222479527f1", + "blockNumber": 19631959, + "txIdx": 6 + }, + { + "hash": "0xf91fb9ff86e6f6bd4af5fab1aa282fb8ef7b7123583445d812d8cca224dbe638", + "blockNumber": 19631959, + "txIdx": 70 + }, + { + "hash": "0xfb21b5d30bf48a0622b1af5daab83d6a56202a9c6ec803bea13dda632615be45", + "blockNumber": 19631895, + "txIdx": 160 + }, + { + "hash": "0xb09fb3f09d72856aebae52d0403c27b2c33f906bb333b7bcca10e8577b1d4400", + "blockNumber": 19631831, + "txIdx": 83 + }, + { + "hash": "0x9675fa5e1419532aada8441a13fe697d69d39f31ab522f44647fba4d2da617f1", + "blockNumber": 19631767, + "txIdx": 19 + }, + { + "hash": "0xf3eb0c469a9544cf79e0695ed72779b485c3f755ae2567eb65760480821dd667", + "blockNumber": 19631703, + "txIdx": 143 + } + ], + "max": [ + { + "hash": "0x2ba93a80d2d3288490308cea7e015f444337ec066eda5b5b0549e10b1a5fc4c2", + "blockNumber": 19633751, + "txIdx": 88 + }, + { + "hash": "0x61d85f83c8affe31903617ebf376d7f97ac28bfd5a77dae47744f2a0cefaa119", + "blockNumber": 19631639, + "txIdx": 0 + }, + { + "hash": "0x9fdcb4db3e110229de21d2f4e88e309266c6984e96099580471f01c167a6ee28", + "blockNumber": 19631447, + "txIdx": 205 + }, + { + "hash": "0xfd3f4d994548557b60d0767836d658be069abba604df25e824cb522c07998f17", + "blockNumber": 19631255, + "txIdx": 46 + } + ], + "oversize": [ + { + "hash": "0xfb8d0f1e3f17d7a9855a4377b9b493f62c14d7b670387d5dda019fcb779858ff", + "blockNumber": 19632663, + "txIdx": 6 + }, + { + "hash": "0x770ec887f414d40bf4c72d4fcfdf0083905c50c28bd9f92077fd9420c24bbac4", + "blockNumber": 19632215, + "txIdx": 140 + }, + { + "hash": "0x73335b0f844e2f3952d1c33b98e17ae6b9bacdb87fe434219ab48235ee63e04e", + "blockNumber": 19631895, + "txIdx": 162 + }, + { + "hash": "0xc16a5fdeb70c55afd6ed92d2aae1a414f6edf64f4e2933b13c9f767d0c81437b", + "blockNumber": 19630807, + "txIdx": 4 + } + ] + } + } +} \ No newline at end of file diff --git a/client/test/chainData/11155111.json b/client/test/chainData/11155111.json new file mode 100644 index 00000000..28b16a90 --- /dev/null +++ b/client/test/chainData/11155111.json @@ -0,0 +1,1744 @@ +{ + "chainId": "11155111", + "blockRange": { + "start": 0, + "end": 5636745 + }, + "blockSamples": 32, + "blockInterval": 64, + "account": { + "eoa": [ + { + "blockNumber": 5636745, + "address": "0xb4d68d677a5f765117d374569d5ecd5739ad5df6" + }, + { + "blockNumber": 5636745, + "address": "0x02454f501b9b11c598f9983c7f11dcbb3c5dbbbb" + }, + { + "blockNumber": 5636745, + "address": "0x2b8c6fd6a3f128f8b276ed70fd37550e096e5da0" + }, + { + "blockNumber": 5636745, + "address": "0xac626c5a97a6e150af368ff5abfbac39b1ce69af" + }, + { + "blockNumber": 5636745, + "address": "0xd6e1f227335d926a7c0fa0476d3e8c27fbf73da0" + }, + { + "blockNumber": 5636745, + "address": "0x5b555821f2e0d73347c0bf6b9c0a12c18d7b5562" + }, + { + "blockNumber": 5636745, + "address": "0xa5fdfcbceeceb5741ef73f86cf3ed6e80e5e920d" + }, + { + "blockNumber": 5636745, + "address": "0xd778a3dbe33396abed72f04676742e1e1e11e2fa" + }, + { + "blockNumber": 5636745, + "address": "0xbaa66cff2430e34a7d2a5796d84c81c4d722115c" + }, + { + "blockNumber": 5636745, + "address": "0x75c0c372da875a4fc78e8a37f58618a6d18904e8" + }, + { + "blockNumber": 5636745, + "address": "0x75c0c372da875a4fc78e8a37f58618a6d18904e8" + }, + { + "blockNumber": 5636745, + "address": "0xe5d943dd1e8e20cacd5de3f64c61387977b11835" + }, + { + "blockNumber": 5636745, + "address": "0x1870287d6caecc25a766792a1a55664e3e754b6b" + }, + { + "blockNumber": 5636745, + "address": "0xd1a131c6a105c19982a20f644ff3847f9973fab0" + }, + { + "blockNumber": 5636745, + "address": "0x2d70f9a866de34c0f738f8cb2af1361b5af18caa" + }, + { + "blockNumber": 5636745, + "address": "0x3b2d569974054a30ddc388052926ff956a223937" + }, + { + "blockNumber": 5636745, + "address": "0xc5125722937c0fea053c602261238bf9f3b2450f" + }, + { + "blockNumber": 5636745, + "address": "0x266b44b7aa0099b775429dba5e758906241c7520" + }, + { + "blockNumber": 5636745, + "address": "0x7ddee65c3a578d5bb4523dd20ac0d1f17ab65135" + }, + { + "blockNumber": 5636745, + "address": "0x5ce8089cdb16dfba625f4aaf473dd093eeff3fbe" + }, + { + "blockNumber": 5636745, + "address": "0x5949e55560fdbae0ad57478235d4423248b154c2" + }, + { + "blockNumber": 5636745, + "address": "0xe27017dd9ef7e3d0a8321c2041fc4402e89945b6" + }, + { + "blockNumber": 5636745, + "address": "0xff00000000000000000000000000000000689388" + }, + { + "blockNumber": 5636745, + "address": "0xa27e24471660598db0bbdfbbf553db9de82b2d94" + }, + { + "blockNumber": 5636745, + "address": "0xff00000000000000000000000000000000299792" + }, + { + "blockNumber": 5636745, + "address": "0x56e843c2e77cae625689d25eb098be40187add34" + }, + { + "blockNumber": 5636745, + "address": "0xff00000000000000000000000000000000008054" + }, + { + "blockNumber": 5636745, + "address": "0x0632215e32658508fc985bb80f22ee71377f7aae" + }, + { + "blockNumber": 5636745, + "address": "0xff00000000000000000000000000000000743111" + }, + { + "blockNumber": 5636745, + "address": "0xab40228a9d8659103de421fd77dbe192cf0e948f" + }, + { + "blockNumber": 5636745, + "address": "0xff00000000000000000000000000000000001432" + }, + { + "blockNumber": 5636745, + "address": "0x927c9ea873e461c164290f085933dbd15f28069f" + } + ], + "contract": [ + { + "blockNumber": 5636745, + "address": "0x53844f9577c2334e541aec7df7174ece5df1fcf0" + }, + { + "blockNumber": 5636745, + "address": "0x5699f1bc92b8e61aad266f658de9c96863110523" + }, + { + "blockNumber": 5636745, + "address": "0x1abddd7d12ad2076fd91f179a1a2b573e6a9ba29" + }, + { + "blockNumber": 5636745, + "address": "0xef2afa792412ae5edf7e54dc6830f5117e2bd22c" + }, + { + "blockNumber": 5636745, + "address": "0x8e637b55b2999083a231563f1885061000fe8c96" + }, + { + "blockNumber": 5636745, + "address": "0x29fa47b306bf975a0013a819d49d577bc5015aa9" + }, + { + "blockNumber": 5636745, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 5636745, + "address": "0x4f34c922fb0d80c7d79ac25e497d90d7efa513c2" + }, + { + "blockNumber": 5636745, + "address": "0x11e405e4432c615315c624159a42584a03dccadf" + }, + { + "blockNumber": 5636745, + "address": "0x08210f9170f89ab7658f0b5e3ff39b0e03c594d4" + }, + { + "blockNumber": 5636745, + "address": "0x1c7d4b196cb0c7b01d743fbc6116a902379c7238" + }, + { + "blockNumber": 5636745, + "address": "0xf0c5e6e9d63a6e57c2c0faedd2fa98eec26b2860" + }, + { + "blockNumber": 5636745, + "address": "0x75a6b961c8da942ee03ca641b09c322549f6fa98" + }, + { + "blockNumber": 5636745, + "address": "0xd450a7bc25f198222beae4304e4a5d138ee8763a" + }, + { + "blockNumber": 5636745, + "address": "0xdbdb238185f9bb40f742ae249f9a083381ec39ec" + }, + { + "blockNumber": 5636745, + "address": "0xb2f59462370489d168def2df9cef03e4c330988e" + }, + { + "blockNumber": 5636745, + "address": "0x2e2abd4660745ea812994de0388ee8333da0dddf" + }, + { + "blockNumber": 5636745, + "address": "0xb78162040a38c05acbb23377fce73a5e8f807d7d" + }, + { + "blockNumber": 5636745, + "address": "0xb76863c593d59eb08ae3f84a40039e84eeca2d95" + }, + { + "blockNumber": 5636745, + "address": "0xddb6885becb419615b7608e06ff86b1a9e6ed2f2" + }, + { + "blockNumber": 5636745, + "address": "0x99b37703e750a39c1ebe4e607137352bad7d8fe9" + }, + { + "blockNumber": 5636745, + "address": "0x9cb2615b2dbd534db0aca922287d25114bb04ce9" + }, + { + "blockNumber": 5636745, + "address": "0xf875fecff122927e53c3b07f4258c690b026004b" + }, + { + "blockNumber": 5636745, + "address": "0xd1ccb15e30a9fd5d96a731064205bc12d3183869" + }, + { + "blockNumber": 5636745, + "address": "0xd1ccb15e30a9fd5d96a731064205bc12d3183869" + }, + { + "blockNumber": 5636745, + "address": "0xd1ccb15e30a9fd5d96a731064205bc12d3183869" + }, + { + "blockNumber": 5636681, + "address": "0x53844f9577c2334e541aec7df7174ece5df1fcf0" + }, + { + "blockNumber": 5636681, + "address": "0xbde2aed54521000dc033b67fb522034e0f93a7e5" + }, + { + "blockNumber": 5636681, + "address": "0xbb5ed4265de177516699f59bddab841ddde97e5e" + }, + { + "blockNumber": 5636681, + "address": "0x33cafa2e5d5167806b236f5be9734ddce8706bfc" + }, + { + "blockNumber": 5636681, + "address": "0xab260022803e6735a81256604d73115d663c6b82" + }, + { + "blockNumber": 5636681, + "address": "0x7100caf71d5d943f093e50073b173ff51c2cdb79" + } + ] + }, + "storage": { + "nonzero": [ + { + "blockNumber": 5636745, + "address": "0x53844f9577c2334e541aec7df7174ece5df1fcf0", + "slot": 4 + }, + { + "blockNumber": 5636745, + "address": "0x5699f1bc92b8e61aad266f658de9c96863110523", + "slot": 0 + }, + { + "blockNumber": 5636745, + "address": "0x1abddd7d12ad2076fd91f179a1a2b573e6a9ba29", + "slot": 9 + }, + { + "blockNumber": 5636745, + "address": "0xef2afa792412ae5edf7e54dc6830f5117e2bd22c", + "slot": 0 + }, + { + "blockNumber": 5636745, + "address": "0x4f34c922fb0d80c7d79ac25e497d90d7efa513c2", + "slot": 2 + }, + { + "blockNumber": 5636745, + "address": "0x08210f9170f89ab7658f0b5e3ff39b0e03c594d4", + "slot": 5 + }, + { + "blockNumber": 5636745, + "address": "0x1c7d4b196cb0c7b01d743fbc6116a902379c7238", + "slot": 2 + }, + { + "blockNumber": 5636745, + "address": "0x75a6b961c8da942ee03ca641b09c322549f6fa98", + "slot": 3 + }, + { + "blockNumber": 5636745, + "address": "0xd450a7bc25f198222beae4304e4a5d138ee8763a", + "slot": 4 + }, + { + "blockNumber": 5636745, + "address": "0xdbdb238185f9bb40f742ae249f9a083381ec39ec", + "slot": 2 + }, + { + "blockNumber": 5636745, + "address": "0xb2f59462370489d168def2df9cef03e4c330988e", + "slot": 2 + }, + { + "blockNumber": 5636745, + "address": "0xb76863c593d59eb08ae3f84a40039e84eeca2d95", + "slot": 0 + }, + { + "blockNumber": 5636745, + "address": "0xddb6885becb419615b7608e06ff86b1a9e6ed2f2", + "slot": 2 + }, + { + "blockNumber": 5636681, + "address": "0x53844f9577c2334e541aec7df7174ece5df1fcf0", + "slot": 5 + }, + { + "blockNumber": 5636681, + "address": "0xbde2aed54521000dc033b67fb522034e0f93a7e5", + "slot": 0 + }, + { + "blockNumber": 5636681, + "address": "0xab260022803e6735a81256604d73115d663c6b82", + "slot": 8 + }, + { + "blockNumber": 5636681, + "address": "0x8e637b55b2999083a231563f1885061000fe8c96", + "slot": 2 + }, + { + "blockNumber": 5636681, + "address": "0x1abddd7d12ad2076fd91f179a1a2b573e6a9ba29", + "slot": 1 + }, + { + "blockNumber": 5636681, + "address": "0xdfcde9d698a2b32db2537dc9b752cadd1d846a52", + "slot": 7 + }, + { + "blockNumber": 5636681, + "address": "0x8e637b55b2999083a231563f1885061000fe8c96", + "slot": 3 + }, + { + "blockNumber": 5636681, + "address": "0x84457ca9d0163fbc4bbfe4dfbb20ba46e48df254", + "slot": 0 + }, + { + "blockNumber": 5636617, + "address": "0x53844f9577c2334e541aec7df7174ece5df1fcf0", + "slot": 3 + }, + { + "blockNumber": 5636617, + "address": "0xfd57b4ddbf88a4e07ff4e34c487b99af2fe82a05", + "slot": 9 + }, + { + "blockNumber": 5636617, + "address": "0x5699f1bc92b8e61aad266f658de9c96863110523", + "slot": 4 + }, + { + "blockNumber": 5636617, + "address": "0x7195a0a16d2665fa2d30454386a1eeb090215492", + "slot": 3 + }, + { + "blockNumber": 5636617, + "address": "0x5ad31b262855c1de6788e5497ec0591d25c9a8c2", + "slot": 0 + }, + { + "blockNumber": 5636617, + "address": "0xab260022803e6735a81256604d73115d663c6b82", + "slot": 6 + }, + { + "blockNumber": 5636617, + "address": "0xc0a3d29f6a90a3f41a26322c5b95ace7dc34465a", + "slot": 1 + }, + { + "blockNumber": 5636617, + "address": "0x491d755a33f6eb77a890925414dd5daea42e3d7c", + "slot": 9 + }, + { + "blockNumber": 5636617, + "address": "0x8e637b55b2999083a231563f1885061000fe8c96", + "slot": 9 + }, + { + "blockNumber": 5636617, + "address": "0x3025298de286313fc34fd1426dd83732501db1e9", + "slot": 4 + }, + { + "blockNumber": 5636617, + "address": "0xb5901509329307e3f910f333fa9c4b4a8ee7ce1a", + "slot": 2 + } + ] + }, + "tx": { + "type": { + "0": [ + { + "hash": "0x8f07ef02c2d0b4ca3e6785f646d613cafc9c48d0a5ebec44f946e913002c5606", + "blockNumber": 5636745, + "txIdx": 7 + }, + { + "hash": "0x260751b63ab5ddfdc21c558665d7e724c859e5f5efb22ccb4bc2a7abacd178c4", + "blockNumber": 5636745, + "txIdx": 33 + }, + { + "hash": "0xf7ff0d01752b9d984fa5f9ad8895f8ab67c030b187700883a6598a1ac0c63241", + "blockNumber": 5636745, + "txIdx": 34 + }, + { + "hash": "0x6cb9659f5b90120497226355a6edf5a1b9aeb4e634593fbc269d3dfbe137d7f7", + "blockNumber": 5636681, + "txIdx": 0 + }, + { + "hash": "0x2076abe6eafbf8f12c1231bbe2e8ed9154a452f8de9cf24102479cc253028612", + "blockNumber": 5636681, + "txIdx": 1 + }, + { + "hash": "0x0d781719113bda9991e18dd302e6239ebbc6a1c68e2822c88843a10732198cec", + "blockNumber": 5636681, + "txIdx": 5 + }, + { + "hash": "0x4f10fb7c01be0f69e8288eebd0efa08703def043b402eabb789b86cf06a18a28", + "blockNumber": 5636617, + "txIdx": 1 + }, + { + "hash": "0x38e67f575f58809c83e4e20afce3e68f034d905046d578e3133fefcd860e5875", + "blockNumber": 5636617, + "txIdx": 5 + }, + { + "hash": "0x812eaeb927bceb82ee97d93bdd3a584af339c1398ac107723b3b531e74d8181c", + "blockNumber": 5636553, + "txIdx": 0 + }, + { + "hash": "0x1847ffa695c78d4ee1f3cf187e06f34be8ac131c05a98ccb2c4c4230fa4d92a4", + "blockNumber": 5636553, + "txIdx": 46 + }, + { + "hash": "0x2785c3085a507e4b40072d054e1793bb9625d531f3337d80c8e3e4a092b3b605", + "blockNumber": 5636553, + "txIdx": 47 + }, + { + "hash": "0xaacae17dc108c7a03c6a523b70dbc3ee67348b4c2b73b17fcbfb47c72d2fc10d", + "blockNumber": 5636553, + "txIdx": 48 + }, + { + "hash": "0xcfc553da239f60ada58c29b9a3a606b7fd7b45bc158fdd6df09f3f8253ea94f3", + "blockNumber": 5636553, + "txIdx": 49 + }, + { + "hash": "0xc4949a919c38015dd2400ba2c75530831703d58b8651ee7dc4c5b13c65f4affb", + "blockNumber": 5636553, + "txIdx": 51 + }, + { + "hash": "0xd8c643ae4aca41bf574fc95e72128bd1b700e9725c43247af352366427decfe7", + "blockNumber": 5636553, + "txIdx": 54 + }, + { + "hash": "0x02e6debbbda5039abeac25cd5c8187e14eb5f89083daaf5800079c9796926ca4", + "blockNumber": 5636553, + "txIdx": 57 + }, + { + "hash": "0xb312fe9931c86fd38f8912b000a53d46f45083a6a4379db374ebf85d51f9401e", + "blockNumber": 5636553, + "txIdx": 58 + }, + { + "hash": "0x84add9a2738b4469d18a10060e3ba00842e6cae11943d20905ef00e273419c3b", + "blockNumber": 5636553, + "txIdx": 59 + }, + { + "hash": "0xfee4be6f6371f2ebdb47fa7e2d6215e8067303a4545683c686f2ef1455e7c97b", + "blockNumber": 5636553, + "txIdx": 60 + }, + { + "hash": "0xb5016c20887a76718302719ab548a0e1406f9f31b2391a9edb3055f87572f127", + "blockNumber": 5636553, + "txIdx": 64 + }, + { + "hash": "0x44509a61d60e2dfb6caa17842828afd1d81bfd465d01ee1ccbd8c10edeebfa58", + "blockNumber": 5636553, + "txIdx": 65 + }, + { + "hash": "0x700a6290eff477f43647eafd4e2007e7b02f89c26528ca8d21c61b29526820c6", + "blockNumber": 5636489, + "txIdx": 0 + }, + { + "hash": "0xf5a7267f9230b96fccd95f90129359f97ed750a82842965a9aa7cbd4c302d584", + "blockNumber": 5636489, + "txIdx": 3 + }, + { + "hash": "0xc3c1d6960e2d86de22bcbbcb5da58a42f54047eaecebd0bb8f46f0c02c0c390c", + "blockNumber": 5636489, + "txIdx": 4 + }, + { + "hash": "0x3296e26ca3388c164b0fff23fedce1af0b644e5b1520e218185e7c75eb0c8f43", + "blockNumber": 5636489, + "txIdx": 5 + }, + { + "hash": "0x288ba4a268c9c8c16241ecce0b5320914a77951b36c109386da6333fc10b579c", + "blockNumber": 5636489, + "txIdx": 8 + }, + { + "hash": "0xae52bfd5c93154d990db13b9ed886706636188274c8bb4ed5327f928d678f433", + "blockNumber": 5636489, + "txIdx": 31 + }, + { + "hash": "0xe0cd5542752f4e1e3ea439605ca9be7d7d1172784b4b987f5a8c9a28ba5de96d", + "blockNumber": 5636489, + "txIdx": 32 + }, + { + "hash": "0x33d9e8ff10f47542e3178a15f8fb265eef7cd983f8d4662c30a402965b02749f", + "blockNumber": 5636489, + "txIdx": 33 + }, + { + "hash": "0x82ce15202b9651f28ca21769742008386b95c174a4349ef4ab0324e0f85d0a9c", + "blockNumber": 5636489, + "txIdx": 34 + }, + { + "hash": "0xc0e73c9778623da0e4acb694cdc7d92ffb282093537ee583a64e81b54f40aa3c", + "blockNumber": 5636489, + "txIdx": 59 + }, + { + "hash": "0x65f79d4ce673bbe3e4027116ba00341188add131b1d85afcc901cf50314fa0a3", + "blockNumber": 5636489, + "txIdx": 60 + } + ], + "1": [ + { + "hash": "0x0ba5534170d828202c599ffbd0e25503372b6e570543145675323618634a617a", + "blockNumber": 5636425, + "txIdx": 27 + }, + { + "hash": "0x733f3fbeac560be06fefcbd911b0492b66a59ed6a4a5d1b1bf6ea49ba7967a1c", + "blockNumber": 5636425, + "txIdx": 28 + }, + { + "hash": "0xa1ec17c630bec8bef7ba676af876dbd4c06174201a62158af47133015525f3e5", + "blockNumber": 5636425, + "txIdx": 29 + }, + { + "hash": "0x9dde084e1a5c74a1d23305ed245c7f62772143dea0438f5eaf92ac718c619b5d", + "blockNumber": 5636425, + "txIdx": 30 + }, + { + "hash": "0x7c40b7454e19318f9bc2ca9aafef59b5bb1c91faa4b4d3318b0958cdcb9b1dfe", + "blockNumber": 5636425, + "txIdx": 31 + }, + { + "hash": "0xfb8424584cb17f01f789ce2ff92b21e5c0510242845630964742cb1945b4dcf6", + "blockNumber": 5636425, + "txIdx": 32 + }, + { + "hash": "0xd7c5b2e111e26c158f1f09e33c5d1b7c368a738cda9c58c6985b5c9fc8e2dde8", + "blockNumber": 5636425, + "txIdx": 33 + }, + { + "hash": "0x850214e0782d49aa9c8adb0e09be2536f7b0cba154a121565997d6fed7b2f296", + "blockNumber": 5636425, + "txIdx": 34 + }, + { + "hash": "0x216a565368488d9ee0a6d2b0e8657cfb7e1205992ee396faebab1224b5f38878", + "blockNumber": 5635721, + "txIdx": 65 + } + ], + "2": [ + { + "hash": "0xf04e9268b97341fe5e7fcb57e7d61af087a32a361dc910643ca539eecaf7c488", + "blockNumber": 5636745, + "txIdx": 0 + }, + { + "hash": "0x2cbeac8010754cc681218ded5b41678945e85423bdafcedfab06c6f6530de5d8", + "blockNumber": 5636745, + "txIdx": 1 + }, + { + "hash": "0xd7c01a4fc02f20d71f4350177a31054e30eb975001ad697985ea547ed2378039", + "blockNumber": 5636745, + "txIdx": 2 + }, + { + "hash": "0x077b2066efb5a13b93522911c17c80b181832f2880d9e56d82d3327c3f487115", + "blockNumber": 5636745, + "txIdx": 3 + }, + { + "hash": "0x40432c0404a3f2a9f32d784504435c9de8a52129f87e184a650456cea0e16df7", + "blockNumber": 5636745, + "txIdx": 4 + }, + { + "hash": "0xac975cc9cdcd45b5cd1986809287da7dbe8f5c7469c898edb707b4c3a9cf459b", + "blockNumber": 5636745, + "txIdx": 5 + }, + { + "hash": "0xb0a214d1d5cbf4a0553cd17f05af17af49373af756fd6e94ccad19da65b000fd", + "blockNumber": 5636745, + "txIdx": 6 + }, + { + "hash": "0x5992e4021c8342ba1dffdf08c910f5a8c0e7cffe122d19d82325ba637c8b9274", + "blockNumber": 5636745, + "txIdx": 8 + }, + { + "hash": "0x18c1dc637f519b441f643e8530361b7fb14f7cfb3bd400f1813492b06ee430c8", + "blockNumber": 5636745, + "txIdx": 9 + }, + { + "hash": "0x7200df3c31017e3297cbb5924db3aa3bacdcbbdfa4ff9724d13a8bd4e2b6d113", + "blockNumber": 5636745, + "txIdx": 10 + }, + { + "hash": "0x0c1748854e6a72a9f01e6d013cc7992dc0e88a6c2b9f75e5d0c21b31bb0cc41c", + "blockNumber": 5636745, + "txIdx": 11 + }, + { + "hash": "0x6888ce1cee65c54696df35b2cd73c8e7cc3b689dbb675153f1711c17dd3f0db6", + "blockNumber": 5636745, + "txIdx": 12 + }, + { + "hash": "0x4d41e462859fcae87a06c8bf54ebbb43e4caee2352788edc42c6f1035135809d", + "blockNumber": 5636745, + "txIdx": 13 + }, + { + "hash": "0x797b5772e5043d4f89893bf35e092f2a7bc40ba088a082f3fe1cc828c1f25727", + "blockNumber": 5636745, + "txIdx": 14 + }, + { + "hash": "0x5dcf0c0b23f3e1d749655d2b5d17c582c957a39541024debc5b16885f0ee4cdb", + "blockNumber": 5636745, + "txIdx": 15 + }, + { + "hash": "0xe74befd38363ad5a24a512dfdeee3c1fa8b362c777bcc3f5827d0b65580a8d58", + "blockNumber": 5636745, + "txIdx": 16 + }, + { + "hash": "0x0c3d6b98c6f26a5e44e76bcaa0df9dcd27bef00a4a8197fb5678341bdb8828de", + "blockNumber": 5636745, + "txIdx": 17 + }, + { + "hash": "0x1be01e282a51d81616e613119d6137a914ab8d2a06e594e7b263ca034842c125", + "blockNumber": 5636745, + "txIdx": 18 + }, + { + "hash": "0x42eeb12571e79a567b16c2978ad8bec93cbdd0d6ff0f043968a85a165458cd52", + "blockNumber": 5636745, + "txIdx": 19 + }, + { + "hash": "0x98ecfb9e4b9f745da16b6dd8f2817397c394679a08f95cdb73b6546bb7a612d0", + "blockNumber": 5636745, + "txIdx": 20 + }, + { + "hash": "0xef0c28ff323d6e81673f618147c83a6bc1aa8f5bbfb99ea72c403c4c24996901", + "blockNumber": 5636745, + "txIdx": 21 + }, + { + "hash": "0xa499966207b9fe384a02932957e3ee0e0230c510a29a97b9fed30ae9b225465a", + "blockNumber": 5636745, + "txIdx": 22 + }, + { + "hash": "0xeb3616acce2f15d0708684c8092b39b4bbb4b1a446f59db579c712eddc2a0ef9", + "blockNumber": 5636745, + "txIdx": 23 + }, + { + "hash": "0x732dc6fbdb5c4347bc5c44186d5f7315937c07237f56b25cbed55f02e1f4c306", + "blockNumber": 5636745, + "txIdx": 24 + }, + { + "hash": "0xc37371def4d3fc898fbe30af5e5fae7b4003f337bf065d94049e02f05d7acbde", + "blockNumber": 5636745, + "txIdx": 25 + }, + { + "hash": "0x294227bce6c4c4cfa188ac03e49d8c9627626935dcd4a6567ef7f04713e24eac", + "blockNumber": 5636745, + "txIdx": 26 + }, + { + "hash": "0x2a746902e9e661b53ea2a2ec8bdf90aca3e23f7e118edfaa5b18b6bed83a7f1e", + "blockNumber": 5636745, + "txIdx": 27 + }, + { + "hash": "0xac9058603d999c7c428bbb735367ff01ea5c9888a304de8ee44256dcd7356b91", + "blockNumber": 5636745, + "txIdx": 28 + }, + { + "hash": "0x802246cf0011ffbab4de641b0c2f566cff8e52a9d65cc53ca693d2712bc4789b", + "blockNumber": 5636745, + "txIdx": 29 + }, + { + "hash": "0x78b9f5785291ba5de171a35788204974339d3e1fe8f7267f3fe3f1aece2a7d39", + "blockNumber": 5636745, + "txIdx": 30 + }, + { + "hash": "0xbcb235b0f7f22734e45ac941fb584cc643fdec79c076b41e25aa4f465969bbc6", + "blockNumber": 5636745, + "txIdx": 31 + }, + { + "hash": "0xad835b7e60a4593e8fe6a901ae6285ea7e1cc808851e8fc9cab3e15f4176ad90", + "blockNumber": 5636745, + "txIdx": 32 + } + ], + "3": [ + { + "hash": "0xba3410bbbc647124e4e4c3ac490310594500157c2b0aae902450598465a8ec73", + "blockNumber": 5636681, + "txIdx": 33 + }, + { + "hash": "0xc2d4d302d43e66dff82c1d58d1bcf33685a746b4fbf3d760776f8b282d77066d", + "blockNumber": 5636617, + "txIdx": 56 + }, + { + "hash": "0x025070d111a5725de56959679eb5e4262f4bb054424537acbafb3477d47b9f59", + "blockNumber": 5636617, + "txIdx": 57 + }, + { + "hash": "0x7297b64fe42d8fa293365294c0e6f5800a7fe5959045d755798c228eb91584fa", + "blockNumber": 5636617, + "txIdx": 58 + }, + { + "hash": "0x093d21d4bb5f62eba8ceb81fc23ed82cae533a3120742cb2e818dcf0a026d80d", + "blockNumber": 5636617, + "txIdx": 59 + }, + { + "hash": "0x0ad48e4bf743dbfc9e668514c347caa5e1637281bbb49de943f67acb005afbc0", + "blockNumber": 5636553, + "txIdx": 6 + }, + { + "hash": "0x46995d99214a0c42e5590413b8ba8cc82ba8ee18cf3e211a0ed16002ed13f558", + "blockNumber": 5636553, + "txIdx": 43 + }, + { + "hash": "0x33f0b4013c7b03f2fef05890cec8fbb01fa39e3621f2d506a4e09fc758d94e35", + "blockNumber": 5636553, + "txIdx": 44 + }, + { + "hash": "0xda92f2b1b4b076ff45f0260e216702a8bd4a2eeb176d54cfa5e0b2d336109b48", + "blockNumber": 5636489, + "txIdx": 10 + }, + { + "hash": "0x9a4417f6f3cd4b258e567a40fe36126f649f1737fe918a80a67a1113edb10a35", + "blockNumber": 5636425, + "txIdx": 80 + }, + { + "hash": "0x50aa044dbe07811dc1777c6df8725e441f9360ed8fe1fb90494949ee03cc27e5", + "blockNumber": 5636361, + "txIdx": 24 + }, + { + "hash": "0x82e4f6ed62d83b715b0a51d58b866e887cc056f9b0d1dc87a4e52f9c39d8d976", + "blockNumber": 5636361, + "txIdx": 25 + }, + { + "hash": "0xbcb9086da055276989fc196acb40ef6c1274ce9b4ea342475696cd39651f3a90", + "blockNumber": 5636297, + "txIdx": 34 + }, + { + "hash": "0xcc826825a6d7350cb82526e7b601d8c7875c768088adfb15357f8f41b9a36aa3", + "blockNumber": 5636297, + "txIdx": 35 + }, + { + "hash": "0x2d3bf2ba5a91286f8b12f73ab1ff2c2bbbaf9517f2a8690eeb8c025e3625a3cf", + "blockNumber": 5636297, + "txIdx": 36 + }, + { + "hash": "0x8606e90e614511824e300c4030ed30a7ddf6c51e724d50cd366eb7096f868aba", + "blockNumber": 5636297, + "txIdx": 37 + }, + { + "hash": "0x652c977069fab82ea0ab28e7d0b9a5b22e37b3ea09b3ddd1b8fd2f39e361c7ca", + "blockNumber": 5636297, + "txIdx": 38 + }, + { + "hash": "0x31677d4304ed294ecac8ad0c72f426fd9c8e60f2cb86da723cae8db961788d75", + "blockNumber": 5636297, + "txIdx": 39 + }, + { + "hash": "0x974ea073921dec03a04efe9897cf9ade62749f5061a2c3479a5d3cc0e57123ba", + "blockNumber": 5636169, + "txIdx": 2 + }, + { + "hash": "0x070d9f3b540512c557758d5acc027d63ebe9ed93d26e53757906d97c98228c45", + "blockNumber": 5636169, + "txIdx": 3 + }, + { + "hash": "0x1a6e9cd002528dbd87754dee21c23016c5ab7e9e7732a274ac385c137c821066", + "blockNumber": 5636169, + "txIdx": 47 + }, + { + "hash": "0x93894af63ea5678cefc4a032c6be5b835a212dc338a2801712c432b4f37c178b", + "blockNumber": 5636169, + "txIdx": 48 + }, + { + "hash": "0x59ccca2c173e807bdd662dab70cf58e0614e777a40f319bc7d54c131d51ac441", + "blockNumber": 5636169, + "txIdx": 85 + }, + { + "hash": "0xf925b32b8d9069b5a0cc597d5d1783883c8018f07c86470517302f9cf6a8daf0", + "blockNumber": 5636105, + "txIdx": 72 + }, + { + "hash": "0x9cb8fa351de90f4a6f81f0a57641be6b860d20e7d6d1ea84b34dce5a314cb8e0", + "blockNumber": 5636041, + "txIdx": 3 + }, + { + "hash": "0xe678ca4c42af0a17afc6c70611532c1e8944cdd945161b50f2891b15284cdf85", + "blockNumber": 5636041, + "txIdx": 4 + }, + { + "hash": "0x79f5ee2f580676aadf3f0378e82a6b6bf256a5618d5b53dd72b62706e7e1e03c", + "blockNumber": 5636041, + "txIdx": 5 + }, + { + "hash": "0xa8dceb8234160b771a1239bc80ccca7ca342d494e9e9abde9f5370311b1d9d26", + "blockNumber": 5636041, + "txIdx": 117 + }, + { + "hash": "0x8ef96a9a9702fa6851c4f5b0a4611527a1c3ac91f1df6dde8081fe321b6bfd82", + "blockNumber": 5636041, + "txIdx": 118 + }, + { + "hash": "0x61c783b1e72c06d76e0b71a3d44fa724cf73930252235362266f3e5c28492f95", + "blockNumber": 5636041, + "txIdx": 167 + }, + { + "hash": "0x9fe3ec0b7bf8ebde544cbb2205ae298ad4e15bf75873b157ba9395d28e54322f", + "blockNumber": 5635977, + "txIdx": 64 + }, + { + "hash": "0xaee8c958696f2c409979587981f5aad6dd4e76a607856f4ffe50241c6ce6fe25", + "blockNumber": 5635977, + "txIdx": 65 + } + ] + }, + "category": { + "default": [ + { + "hash": "0xf04e9268b97341fe5e7fcb57e7d61af087a32a361dc910643ca539eecaf7c488", + "blockNumber": 5636745, + "txIdx": 0 + }, + { + "hash": "0x2cbeac8010754cc681218ded5b41678945e85423bdafcedfab06c6f6530de5d8", + "blockNumber": 5636745, + "txIdx": 1 + }, + { + "hash": "0xd7c01a4fc02f20d71f4350177a31054e30eb975001ad697985ea547ed2378039", + "blockNumber": 5636745, + "txIdx": 2 + }, + { + "hash": "0x077b2066efb5a13b93522911c17c80b181832f2880d9e56d82d3327c3f487115", + "blockNumber": 5636745, + "txIdx": 3 + }, + { + "hash": "0x40432c0404a3f2a9f32d784504435c9de8a52129f87e184a650456cea0e16df7", + "blockNumber": 5636745, + "txIdx": 4 + }, + { + "hash": "0xac975cc9cdcd45b5cd1986809287da7dbe8f5c7469c898edb707b4c3a9cf459b", + "blockNumber": 5636745, + "txIdx": 5 + }, + { + "hash": "0xb0a214d1d5cbf4a0553cd17f05af17af49373af756fd6e94ccad19da65b000fd", + "blockNumber": 5636745, + "txIdx": 6 + }, + { + "hash": "0x8f07ef02c2d0b4ca3e6785f646d613cafc9c48d0a5ebec44f946e913002c5606", + "blockNumber": 5636745, + "txIdx": 7 + }, + { + "hash": "0x5992e4021c8342ba1dffdf08c910f5a8c0e7cffe122d19d82325ba637c8b9274", + "blockNumber": 5636745, + "txIdx": 8 + }, + { + "hash": "0x18c1dc637f519b441f643e8530361b7fb14f7cfb3bd400f1813492b06ee430c8", + "blockNumber": 5636745, + "txIdx": 9 + }, + { + "hash": "0x7200df3c31017e3297cbb5924db3aa3bacdcbbdfa4ff9724d13a8bd4e2b6d113", + "blockNumber": 5636745, + "txIdx": 10 + }, + { + "hash": "0x0c1748854e6a72a9f01e6d013cc7992dc0e88a6c2b9f75e5d0c21b31bb0cc41c", + "blockNumber": 5636745, + "txIdx": 11 + }, + { + "hash": "0x6888ce1cee65c54696df35b2cd73c8e7cc3b689dbb675153f1711c17dd3f0db6", + "blockNumber": 5636745, + "txIdx": 12 + }, + { + "hash": "0x4d41e462859fcae87a06c8bf54ebbb43e4caee2352788edc42c6f1035135809d", + "blockNumber": 5636745, + "txIdx": 13 + }, + { + "hash": "0x797b5772e5043d4f89893bf35e092f2a7bc40ba088a082f3fe1cc828c1f25727", + "blockNumber": 5636745, + "txIdx": 14 + }, + { + "hash": "0x5dcf0c0b23f3e1d749655d2b5d17c582c957a39541024debc5b16885f0ee4cdb", + "blockNumber": 5636745, + "txIdx": 15 + }, + { + "hash": "0xe74befd38363ad5a24a512dfdeee3c1fa8b362c777bcc3f5827d0b65580a8d58", + "blockNumber": 5636745, + "txIdx": 16 + }, + { + "hash": "0x0c3d6b98c6f26a5e44e76bcaa0df9dcd27bef00a4a8197fb5678341bdb8828de", + "blockNumber": 5636745, + "txIdx": 17 + }, + { + "hash": "0x1be01e282a51d81616e613119d6137a914ab8d2a06e594e7b263ca034842c125", + "blockNumber": 5636745, + "txIdx": 18 + }, + { + "hash": "0x42eeb12571e79a567b16c2978ad8bec93cbdd0d6ff0f043968a85a165458cd52", + "blockNumber": 5636745, + "txIdx": 19 + }, + { + "hash": "0x98ecfb9e4b9f745da16b6dd8f2817397c394679a08f95cdb73b6546bb7a612d0", + "blockNumber": 5636745, + "txIdx": 20 + }, + { + "hash": "0xef0c28ff323d6e81673f618147c83a6bc1aa8f5bbfb99ea72c403c4c24996901", + "blockNumber": 5636745, + "txIdx": 21 + }, + { + "hash": "0xa499966207b9fe384a02932957e3ee0e0230c510a29a97b9fed30ae9b225465a", + "blockNumber": 5636745, + "txIdx": 22 + }, + { + "hash": "0xeb3616acce2f15d0708684c8092b39b4bbb4b1a446f59db579c712eddc2a0ef9", + "blockNumber": 5636745, + "txIdx": 23 + }, + { + "hash": "0x732dc6fbdb5c4347bc5c44186d5f7315937c07237f56b25cbed55f02e1f4c306", + "blockNumber": 5636745, + "txIdx": 24 + }, + { + "hash": "0xc37371def4d3fc898fbe30af5e5fae7b4003f337bf065d94049e02f05d7acbde", + "blockNumber": 5636745, + "txIdx": 25 + }, + { + "hash": "0x294227bce6c4c4cfa188ac03e49d8c9627626935dcd4a6567ef7f04713e24eac", + "blockNumber": 5636745, + "txIdx": 26 + }, + { + "hash": "0x2a746902e9e661b53ea2a2ec8bdf90aca3e23f7e118edfaa5b18b6bed83a7f1e", + "blockNumber": 5636745, + "txIdx": 27 + }, + { + "hash": "0xac9058603d999c7c428bbb735367ff01ea5c9888a304de8ee44256dcd7356b91", + "blockNumber": 5636745, + "txIdx": 28 + }, + { + "hash": "0x802246cf0011ffbab4de641b0c2f566cff8e52a9d65cc53ca693d2712bc4789b", + "blockNumber": 5636745, + "txIdx": 29 + }, + { + "hash": "0x78b9f5785291ba5de171a35788204974339d3e1fe8f7267f3fe3f1aece2a7d39", + "blockNumber": 5636745, + "txIdx": 30 + }, + { + "hash": "0xbcb235b0f7f22734e45ac941fb584cc643fdec79c076b41e25aa4f465969bbc6", + "blockNumber": 5636745, + "txIdx": 31 + } + ], + "large": [ + { + "hash": "0x69f33dff7a241d5e55b03ee22eb28649aa556c94fff89fbcd9ed19c01d6c1f04", + "blockNumber": 5636617, + "txIdx": 45 + }, + { + "hash": "0xa9ac66128a97eb99fdf419db30f967e9822675277990587119d5bb173a69dceb", + "blockNumber": 5636489, + "txIdx": 50 + }, + { + "hash": "0x9da3bba479085c0399f703fa1acefe0b87e1081ff0a920c95ad5c9c7902797b7", + "blockNumber": 5636425, + "txIdx": 16 + }, + { + "hash": "0x55cb9b5113454d98250153c22cb65b4d7a18f75d065d80459be39614829b6950", + "blockNumber": 5636233, + "txIdx": 64 + }, + { + "hash": "0x9b4cc26f5ed318ce7425631968a6b3c89429be32e86502de40e3a89f9a968a06", + "blockNumber": 5636169, + "txIdx": 123 + }, + { + "hash": "0x9adbefd04c7508c6b45a9b919e7705c4bf19f5a33a2dc52fdefac6a7058650c8", + "blockNumber": 5636169, + "txIdx": 124 + }, + { + "hash": "0x29ec4caaf6775f30c2097ff9d34ad3c440b208c9a0e5f74f06f3180ddadbf183", + "blockNumber": 5636105, + "txIdx": 132 + }, + { + "hash": "0x293d96e29203e42057772730f091c5bd9d6153018c3117aedff3fb910be21d5a", + "blockNumber": 5635913, + "txIdx": 20 + }, + { + "hash": "0x79c83588a695d05d0d94fd7d591c178bd00ff21fe486754d01315b0f74e739c0", + "blockNumber": 5635785, + "txIdx": 37 + }, + { + "hash": "0x86bbeaaf4a7467a00f04f0ab9eff0079a9cbf570c6bc5a673df2646633c33dee", + "blockNumber": 5635785, + "txIdx": 55 + }, + { + "hash": "0x64668f82e9f84ff0a2f9ae6af5850a5e019b69e7e7421fd80eeaff35918afc11", + "blockNumber": 5635721, + "txIdx": 79 + } + ], + "max": [ + { + "hash": "0x0d781719113bda9991e18dd302e6239ebbc6a1c68e2822c88843a10732198cec", + "blockNumber": 5636681, + "txIdx": 5 + }, + { + "hash": "0xe59af677955bad29b8b9ccc1e1fdcad89742974ed4aa598dcf77687388f15bbf", + "blockNumber": 5636617, + "txIdx": 23 + }, + { + "hash": "0xa15be67290e0fb4c80ec5c02a2c490a24b05b514ea185991c09a5c8999bfc58d", + "blockNumber": 5636617, + "txIdx": 31 + }, + { + "hash": "0xcae5fa7b01361ab1168fb4cf9d7f6eeb6d3dd5e9b81ac1ea43823bd9e22baa8c", + "blockNumber": 5636553, + "txIdx": 74 + } + ], + "oversize": [] + } + }, + "rc": { + "category": { + "default": [ + { + "hash": "0xf04e9268b97341fe5e7fcb57e7d61af087a32a361dc910643ca539eecaf7c488", + "blockNumber": 5636745, + "txIdx": 0 + }, + { + "hash": "0x2cbeac8010754cc681218ded5b41678945e85423bdafcedfab06c6f6530de5d8", + "blockNumber": 5636745, + "txIdx": 1 + }, + { + "hash": "0xd7c01a4fc02f20d71f4350177a31054e30eb975001ad697985ea547ed2378039", + "blockNumber": 5636745, + "txIdx": 2 + }, + { + "hash": "0x077b2066efb5a13b93522911c17c80b181832f2880d9e56d82d3327c3f487115", + "blockNumber": 5636745, + "txIdx": 3 + }, + { + "hash": "0x40432c0404a3f2a9f32d784504435c9de8a52129f87e184a650456cea0e16df7", + "blockNumber": 5636745, + "txIdx": 4 + }, + { + "hash": "0xac975cc9cdcd45b5cd1986809287da7dbe8f5c7469c898edb707b4c3a9cf459b", + "blockNumber": 5636745, + "txIdx": 5 + }, + { + "hash": "0xb0a214d1d5cbf4a0553cd17f05af17af49373af756fd6e94ccad19da65b000fd", + "blockNumber": 5636745, + "txIdx": 6 + }, + { + "hash": "0x8f07ef02c2d0b4ca3e6785f646d613cafc9c48d0a5ebec44f946e913002c5606", + "blockNumber": 5636745, + "txIdx": 7 + }, + { + "hash": "0x5992e4021c8342ba1dffdf08c910f5a8c0e7cffe122d19d82325ba637c8b9274", + "blockNumber": 5636745, + "txIdx": 8 + }, + { + "hash": "0x18c1dc637f519b441f643e8530361b7fb14f7cfb3bd400f1813492b06ee430c8", + "blockNumber": 5636745, + "txIdx": 9 + }, + { + "hash": "0x7200df3c31017e3297cbb5924db3aa3bacdcbbdfa4ff9724d13a8bd4e2b6d113", + "blockNumber": 5636745, + "txIdx": 10 + }, + { + "hash": "0x0c1748854e6a72a9f01e6d013cc7992dc0e88a6c2b9f75e5d0c21b31bb0cc41c", + "blockNumber": 5636745, + "txIdx": 11 + }, + { + "hash": "0x4d41e462859fcae87a06c8bf54ebbb43e4caee2352788edc42c6f1035135809d", + "blockNumber": 5636745, + "txIdx": 13 + }, + { + "hash": "0x797b5772e5043d4f89893bf35e092f2a7bc40ba088a082f3fe1cc828c1f25727", + "blockNumber": 5636745, + "txIdx": 14 + }, + { + "hash": "0x5dcf0c0b23f3e1d749655d2b5d17c582c957a39541024debc5b16885f0ee4cdb", + "blockNumber": 5636745, + "txIdx": 15 + }, + { + "hash": "0xe74befd38363ad5a24a512dfdeee3c1fa8b362c777bcc3f5827d0b65580a8d58", + "blockNumber": 5636745, + "txIdx": 16 + }, + { + "hash": "0x0c3d6b98c6f26a5e44e76bcaa0df9dcd27bef00a4a8197fb5678341bdb8828de", + "blockNumber": 5636745, + "txIdx": 17 + }, + { + "hash": "0x294227bce6c4c4cfa188ac03e49d8c9627626935dcd4a6567ef7f04713e24eac", + "blockNumber": 5636745, + "txIdx": 26 + }, + { + "hash": "0x2a746902e9e661b53ea2a2ec8bdf90aca3e23f7e118edfaa5b18b6bed83a7f1e", + "blockNumber": 5636745, + "txIdx": 27 + }, + { + "hash": "0x78b9f5785291ba5de171a35788204974339d3e1fe8f7267f3fe3f1aece2a7d39", + "blockNumber": 5636745, + "txIdx": 30 + }, + { + "hash": "0xad835b7e60a4593e8fe6a901ae6285ea7e1cc808851e8fc9cab3e15f4176ad90", + "blockNumber": 5636745, + "txIdx": 32 + }, + { + "hash": "0x260751b63ab5ddfdc21c558665d7e724c859e5f5efb22ccb4bc2a7abacd178c4", + "blockNumber": 5636745, + "txIdx": 33 + }, + { + "hash": "0xf7ff0d01752b9d984fa5f9ad8895f8ab67c030b187700883a6598a1ac0c63241", + "blockNumber": 5636745, + "txIdx": 34 + }, + { + "hash": "0xdddf96e0db3e918ddbc3837bcf348ee92ee3b19b41d92e5f447b15d2aad26e79", + "blockNumber": 5636681, + "txIdx": 2 + }, + { + "hash": "0xdcfbabcc4659e6d99e3046c7df7fab15a816b285b181a53cc33daee157e8cf5c", + "blockNumber": 5636681, + "txIdx": 3 + }, + { + "hash": "0x5eaed829c57e3d8fe183f8a3cfcac022c156eeab6cdf1147a0781684f5b3a364", + "blockNumber": 5636681, + "txIdx": 4 + }, + { + "hash": "0x0d781719113bda9991e18dd302e6239ebbc6a1c68e2822c88843a10732198cec", + "blockNumber": 5636681, + "txIdx": 5 + }, + { + "hash": "0x9a4f2b88b7e0bc05e7d6fe849eb9fd4cbcccb2cf922743ffe5d0ae0d9b493fac", + "blockNumber": 5636681, + "txIdx": 6 + }, + { + "hash": "0x065b3057238f2d346057de9a09c0357640a406b752ea5e4b6ab6099db81f4fff", + "blockNumber": 5636681, + "txIdx": 7 + }, + { + "hash": "0xd85706328ee2186dceb2d4838691d22ec80eb1e8601f8eaa842b88b985a3702f", + "blockNumber": 5636681, + "txIdx": 8 + }, + { + "hash": "0xe686e51c9d372baf307d92fe7d35f0280f8ec0fedcfe6df5316e84fe4c701e2a", + "blockNumber": 5636681, + "txIdx": 9 + }, + { + "hash": "0x240778f536855f596a996601bb9a8d832fd662158f40f2955cf123c1d807189c", + "blockNumber": 5636681, + "txIdx": 10 + } + ], + "medium": [], + "large": [ + { + "hash": "0xbf92d068ab5bf16ab64fb19cc2c686513f78f86234e36f7fc9ea6c08ac732c86", + "blockNumber": 5636617, + "txIdx": 0 + }, + { + "hash": "0x964d2330e0bf0c6f59a468a67b41a46f98cecd963fcf8df7704d24b89d652944", + "blockNumber": 5636617, + "txIdx": 10 + }, + { + "hash": "0xff049d47ba9674474aefcf5122a30a8712b259fea936356342f9a110ddf5b443", + "blockNumber": 5636297, + "txIdx": 15 + }, + { + "hash": "0x6232f560ed87f4dec9215e78e1f22c28d1656474d74ecdcf8f20a8b32641400f", + "blockNumber": 5636233, + "txIdx": 4 + }, + { + "hash": "0xee78c61b081d0f6f1dbc76533a54a903a8c99ee426e8aabebf03c23b003bb5fc", + "blockNumber": 5636105, + "txIdx": 96 + }, + { + "hash": "0x2aa7de3d07cb28b44aaeecc0b0d4945d25d7ce371c6dc3ae49a0ab1ddb8b7c5e", + "blockNumber": 5635977, + "txIdx": 14 + }, + { + "hash": "0xa79d74aa66f8a35b0fe5daa4cb6ff4275e1852019642c64ee500f5383c3b927c", + "blockNumber": 5635913, + "txIdx": 42 + }, + { + "hash": "0x169245b0d6e5156fde1899ffdac3226318867e77041e2422665321aa8572ebc9", + "blockNumber": 5635785, + "txIdx": 15 + }, + { + "hash": "0xa9c4e8581c56ffbcddc75dc8a269e43b9fd05a39d09b89494cd0cde030369da5", + "blockNumber": 5635721, + "txIdx": 41 + } + ], + "max": [], + "oversize": [ + { + "hash": "0xa16f7999eb8fbf822065bf1a0f14896aae42dba18a30280ed160718eaf86c312", + "blockNumber": 5636745, + "txIdx": 35 + }, + { + "hash": "0x9deb6332477f81ec9e35e35bbe57006197f2e4aef26dbd3f47d9284145ed7c6d", + "blockNumber": 5636745, + "txIdx": 36 + }, + { + "hash": "0x07098e16f56b0cda9aeb6b5803702b1299c72d3adfa513853e6fdbf2cc565e9f", + "blockNumber": 5636745, + "txIdx": 37 + }, + { + "hash": "0xe59af677955bad29b8b9ccc1e1fdcad89742974ed4aa598dcf77687388f15bbf", + "blockNumber": 5636617, + "txIdx": 23 + }, + { + "hash": "0xa15be67290e0fb4c80ec5c02a2c490a24b05b514ea185991c09a5c8999bfc58d", + "blockNumber": 5636617, + "txIdx": 31 + }, + { + "hash": "0x095c978d93b992f5b25e8fe9afabc6db3d3e3aed23947ed9eec36afe33cac366", + "blockNumber": 5636553, + "txIdx": 103 + }, + { + "hash": "0xfbe76473ace1dce41633251d4c6c6ffc6dacb968d48bab1dd16de3b1a16c71d5", + "blockNumber": 5636553, + "txIdx": 104 + }, + { + "hash": "0x3e9f51032febbdffdff69a197e486def8d15855ec4851d4d8de10d8836bda417", + "blockNumber": 5636489, + "txIdx": 65 + }, + { + "hash": "0x5717e8958a0d4d93868fcd5bb71aecfe3ab6896b57c12eac47b22ab5caebe39b", + "blockNumber": 5636489, + "txIdx": 66 + }, + { + "hash": "0xe59fcc06cda79da68a4e0df3b9f48dce5336e479b155fcc82a0094d1db0e307e", + "blockNumber": 5636425, + "txIdx": 78 + }, + { + "hash": "0xaa436c84aadfeddb324c725b2f7ab183c4393cf33979c0dc302cf402a3aac59a", + "blockNumber": 5636425, + "txIdx": 79 + }, + { + "hash": "0xf0a09bc0529eddbc3eb95f39f22797bf03b06ac6d82dcea17b05716b2e9aa7b2", + "blockNumber": 5636361, + "txIdx": 71 + }, + { + "hash": "0xc88798377539a5040beab2b2aa873aa00df1558b6ca632582cb570e4a17d159b", + "blockNumber": 5636361, + "txIdx": 72 + }, + { + "hash": "0x014f03472ec5e75b8581495065b065c0c8ec6bb1a3bb313aa2ed93884610d866", + "blockNumber": 5636233, + "txIdx": 82 + }, + { + "hash": "0x66a55c5359367e0816fb6c1d460c6759def4ddfd9310eba247fd2efb9b417075", + "blockNumber": 5636233, + "txIdx": 83 + }, + { + "hash": "0x885c587c93054289c752b2f8fecbd33c4cdfa1815337c84f69a46434e7e0bf10", + "blockNumber": 5636041, + "txIdx": 217 + }, + { + "hash": "0x8a6caeef62d9600ba962b9c017867882eb5d22d96eadb643e3fe11632720f82a", + "blockNumber": 5636041, + "txIdx": 218 + } + ] + }, + "events": [ + { + "hash": "0xf04e9268b97341fe5e7fcb57e7d61af087a32a361dc910643ca539eecaf7c488", + "blockNumber": 5636745, + "txIdx": 0, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x2cbeac8010754cc681218ded5b41678945e85423bdafcedfab06c6f6530de5d8", + "blockNumber": 5636745, + "txIdx": 1, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x2cbeac8010754cc681218ded5b41678945e85423bdafcedfab06c6f6530de5d8", + "blockNumber": 5636745, + "txIdx": 1, + "logIdx": 5, + "eventSchema": "0xaae74fdfb502b568e3ca6f5aa448a255c90a2f24c4a6104d65ae45f097b37388" + }, + { + "hash": "0x2cbeac8010754cc681218ded5b41678945e85423bdafcedfab06c6f6530de5d8", + "blockNumber": 5636745, + "txIdx": 1, + "logIdx": 6, + "eventSchema": "0xa74ffa9933a24c93c1d35e504f5c9aab320f63fc816ddf1dd2f98fca9724e0c0" + }, + { + "hash": "0xd7c01a4fc02f20d71f4350177a31054e30eb975001ad697985ea547ed2378039", + "blockNumber": 5636745, + "txIdx": 2, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x077b2066efb5a13b93522911c17c80b181832f2880d9e56d82d3327c3f487115", + "blockNumber": 5636745, + "txIdx": 3, + "logIdx": 0, + "eventSchema": "0x2ac69ee804d9a7a0984249f508dfab7cb2534b465b6ce1580f99a38ba9c5e631" + }, + { + "hash": "0x077b2066efb5a13b93522911c17c80b181832f2880d9e56d82d3327c3f487115", + "blockNumber": 5636745, + "txIdx": 3, + "logIdx": 1, + "eventSchema": "0x31b2166ff604fc5672ea5df08a78081d2bc6d746cadce880747f3643d819e83d" + }, + { + "hash": "0x077b2066efb5a13b93522911c17c80b181832f2880d9e56d82d3327c3f487115", + "blockNumber": 5636745, + "txIdx": 3, + "logIdx": 3, + "eventSchema": "0xdb5c7652857aa163daadd670e116628fb42e869d8ac4251ef8971d9e5727df1b" + }, + { + "hash": "0x40432c0404a3f2a9f32d784504435c9de8a52129f87e184a650456cea0e16df7", + "blockNumber": 5636745, + "txIdx": 4, + "logIdx": 0, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0xac975cc9cdcd45b5cd1986809287da7dbe8f5c7469c898edb707b4c3a9cf459b", + "blockNumber": 5636745, + "txIdx": 5, + "logIdx": 0, + "eventSchema": "0xcb208517ce6623369603eefdd3d201e39b39fb29ec84a590b911b118e4582ec1" + }, + { + "hash": "0xb0a214d1d5cbf4a0553cd17f05af17af49373af756fd6e94ccad19da65b000fd", + "blockNumber": 5636745, + "txIdx": 6, + "logIdx": 1, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0xb0a214d1d5cbf4a0553cd17f05af17af49373af756fd6e94ccad19da65b000fd", + "blockNumber": 5636745, + "txIdx": 6, + "logIdx": 2, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0xb0a214d1d5cbf4a0553cd17f05af17af49373af756fd6e94ccad19da65b000fd", + "blockNumber": 5636745, + "txIdx": 6, + "logIdx": 3, + "eventSchema": "0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f" + }, + { + "hash": "0x8f07ef02c2d0b4ca3e6785f646d613cafc9c48d0a5ebec44f946e913002c5606", + "blockNumber": 5636745, + "txIdx": 7, + "logIdx": 0, + "eventSchema": "0x1e88b107f16455e0599576d3f09ea10212fea6adff673dd5c13bdfb470c843b6" + }, + { + "hash": "0x8f07ef02c2d0b4ca3e6785f646d613cafc9c48d0a5ebec44f946e913002c5606", + "blockNumber": 5636745, + "txIdx": 7, + "logIdx": 1, + "eventSchema": "0x0b671089787b6d29f730bc690214e6a7e28064fef5a3cdbb9b930a22fac01dc5" + }, + { + "hash": "0x18c1dc637f519b441f643e8530361b7fb14f7cfb3bd400f1813492b06ee430c8", + "blockNumber": 5636745, + "txIdx": 9, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x7200df3c31017e3297cbb5924db3aa3bacdcbbdfa4ff9724d13a8bd4e2b6d113", + "blockNumber": 5636745, + "txIdx": 10, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x0c1748854e6a72a9f01e6d013cc7992dc0e88a6c2b9f75e5d0c21b31bb0cc41c", + "blockNumber": 5636745, + "txIdx": 11, + "logIdx": 0, + "eventSchema": "0xa7aaf2512769da4e444e3de247be2564225c2e7a8f74cfe528e46e17d24868e2" + }, + { + "hash": "0x4d41e462859fcae87a06c8bf54ebbb43e4caee2352788edc42c6f1035135809d", + "blockNumber": 5636745, + "txIdx": 13, + "logIdx": 0, + "eventSchema": "0xa7aaf2512769da4e444e3de247be2564225c2e7a8f74cfe528e46e17d24868e2" + }, + { + "hash": "0x797b5772e5043d4f89893bf35e092f2a7bc40ba088a082f3fe1cc828c1f25727", + "blockNumber": 5636745, + "txIdx": 14, + "logIdx": 0, + "eventSchema": "0xa7aaf2512769da4e444e3de247be2564225c2e7a8f74cfe528e46e17d24868e2" + }, + { + "hash": "0x5dcf0c0b23f3e1d749655d2b5d17c582c957a39541024debc5b16885f0ee4cdb", + "blockNumber": 5636745, + "txIdx": 15, + "logIdx": 0, + "eventSchema": "0xa7aaf2512769da4e444e3de247be2564225c2e7a8f74cfe528e46e17d24868e2" + }, + { + "hash": "0xe74befd38363ad5a24a512dfdeee3c1fa8b362c777bcc3f5827d0b65580a8d58", + "blockNumber": 5636745, + "txIdx": 16, + "logIdx": 0, + "eventSchema": "0xa7aaf2512769da4e444e3de247be2564225c2e7a8f74cfe528e46e17d24868e2" + }, + { + "hash": "0x0c3d6b98c6f26a5e44e76bcaa0df9dcd27bef00a4a8197fb5678341bdb8828de", + "blockNumber": 5636745, + "txIdx": 17, + "logIdx": 0, + "eventSchema": "0xa7aaf2512769da4e444e3de247be2564225c2e7a8f74cfe528e46e17d24868e2" + }, + { + "hash": "0x294227bce6c4c4cfa188ac03e49d8c9627626935dcd4a6567ef7f04713e24eac", + "blockNumber": 5636745, + "txIdx": 26, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x2a746902e9e661b53ea2a2ec8bdf90aca3e23f7e118edfaa5b18b6bed83a7f1e", + "blockNumber": 5636745, + "txIdx": 27, + "logIdx": 0, + "eventSchema": "0xa7aaf2512769da4e444e3de247be2564225c2e7a8f74cfe528e46e17d24868e2" + }, + { + "hash": "0x78b9f5785291ba5de171a35788204974339d3e1fe8f7267f3fe3f1aece2a7d39", + "blockNumber": 5636745, + "txIdx": 30, + "logIdx": 0, + "eventSchema": "0xa7aaf2512769da4e444e3de247be2564225c2e7a8f74cfe528e46e17d24868e2" + }, + { + "hash": "0xad835b7e60a4593e8fe6a901ae6285ea7e1cc808851e8fc9cab3e15f4176ad90", + "blockNumber": 5636745, + "txIdx": 32, + "logIdx": 0, + "eventSchema": "0xa7aaf2512769da4e444e3de247be2564225c2e7a8f74cfe528e46e17d24868e2" + }, + { + "hash": "0x260751b63ab5ddfdc21c558665d7e724c859e5f5efb22ccb4bc2a7abacd178c4", + "blockNumber": 5636745, + "txIdx": 33, + "logIdx": 0, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x260751b63ab5ddfdc21c558665d7e724c859e5f5efb22ccb4bc2a7abacd178c4", + "blockNumber": 5636745, + "txIdx": 33, + "logIdx": 1, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0xf7ff0d01752b9d984fa5f9ad8895f8ab67c030b187700883a6598a1ac0c63241", + "blockNumber": 5636745, + "txIdx": 34, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0xa16f7999eb8fbf822065bf1a0f14896aae42dba18a30280ed160718eaf86c312", + "blockNumber": 5636745, + "txIdx": 35, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0xa16f7999eb8fbf822065bf1a0f14896aae42dba18a30280ed160718eaf86c312", + "blockNumber": 5636745, + "txIdx": 35, + "logIdx": 1, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + } + ] + } + } \ No newline at end of file diff --git a/client/test/chainData/8453.json b/client/test/chainData/8453.json new file mode 100644 index 00000000..b0950a55 --- /dev/null +++ b/client/test/chainData/8453.json @@ -0,0 +1,1910 @@ +{ + "chainId": "8453", + "blockRange": { + "start": 12998594, + "end": 13006722 + }, + "blockSamples": 0, + "blockInterval": 0, + "account": { + "eoa": [ + { + "blockNumber": 13006428, + "address": "0x032755a65e6270af77a77c3efa9714b283e6e2e7" + }, + { + "blockNumber": 13006722, + "address": "0xf77eb030e5fd9419aa5b5bc1d4f16bf706a28b76" + }, + { + "blockNumber": 13006658, + "address": "0x50c2eb6a8d2132a6506c7360486283febdf4b9af" + }, + { + "blockNumber": 13006594, + "address": "0x63d55707de72db25a3817c07c56932d74331c37c" + }, + { + "blockNumber": 13006530, + "address": "0x751b77c43643a63362ab024d466fcc1d75354295" + }, + { + "blockNumber": 13006466, + "address": "0xa7c55ed504046dae4364f1a7dec5ab2e77f83128" + }, + { + "blockNumber": 13006402, + "address": "0x6bfccb86ea229ff8f690cad4780d2e39937b4d6f" + }, + { + "blockNumber": 13006338, + "address": "0x3e5e8b141f8e6d96ffc8259c2ce4b26d20d73ed4" + }, + { + "blockNumber": 13006274, + "address": "0xd2b8d5cb5cec982f8e1e88047542175dfac50f1f" + }, + { + "blockNumber": 13006210, + "address": "0x66aee3eecb2bbcccb527cb80096398f8e7f7b257" + }, + { + "blockNumber": 13006146, + "address": "0xe91663bbdc6b71540cc6b484392ebc18db8e4d48" + }, + { + "blockNumber": 13006082, + "address": "0x69b862a6225ca0ef67d30841e70a707518800698" + }, + { + "blockNumber": 13006018, + "address": "0x22b46c1f7a85fca009dd7e993cc43e4b4d23a87b" + }, + { + "blockNumber": 13005954, + "address": "0x3304e22ddaa22bcdc5fca2269b418046ae7b566a" + }, + { + "blockNumber": 13005954, + "address": "0xa9f360246d32dab016eaa41d7aa0f6000c73eb8c" + }, + { + "blockNumber": 13005890, + "address": "0x0ad0b0471dfed8953d5dcd79af9c1db9243742fe" + }, + { + "blockNumber": 13005890, + "address": "0xfd92f4e91d54b9ef91cc3f97c011a6af0c2a7eda" + }, + { + "blockNumber": 13005826, + "address": "0x737119578eb2a897afb9be0ee29ab7aaefa06e94" + }, + { + "blockNumber": 13005762, + "address": "0x6b9d97f292f8347a7ed6cc04cd34ea51150d6554" + }, + { + "blockNumber": 13005762, + "address": "0x6dcbce46a8b494c885d0e7b6817d2b519df64467" + }, + { + "blockNumber": 13005698, + "address": "0x15ca4615b7f40dd6e3288c6d6e01269efc107a57" + }, + { + "blockNumber": 13005634, + "address": "0x3ebd14954522bc975d16999ebc9b1f5ac7602989" + }, + { + "blockNumber": 13005570, + "address": "0x1179318af482ee66bdfedb23049c32931b287a28" + }, + { + "blockNumber": 13005506, + "address": "0xafec862a2830801b20c74e4f8d75d8c8a6a653b2" + }, + { + "blockNumber": 13005442, + "address": "0xbbfc6bb3ed3c988488e6f835fbfa60f4381338e9" + }, + { + "blockNumber": 13005378, + "address": "0x13fe7cbcf1fc807ea6cf540b283ce8e34300f2da" + }, + { + "blockNumber": 13005314, + "address": "0xe2e920c039ff150a657f66e890667e5e3c4e9714" + }, + { + "blockNumber": 13005250, + "address": "0xdd1533354d57a4e00c3453a280916e4edccc6097" + }, + { + "blockNumber": 13005250, + "address": "0x20fe51a9229eef2cf8ad9e89d91cab9312cf3b7a" + }, + { + "blockNumber": 13005186, + "address": "0xe93685f3bba03016f02bd1828badd6195988d950" + }, + { + "blockNumber": 13005122, + "address": "0x0cf5072065a85de03340d645ef47ef9298db7f99" + }, + { + "blockNumber": 13005058, + "address": "0xa051c3b9aa27b9158029947f0f82d4d3b44a845c" + } + ], + "contract": [ + { + "blockNumber": 13006428, + "address": "0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24" + }, + { + "blockNumber": 13006658, + "address": "0x2e86a5583a6fdfb921632876875e1053e29b2d03" + }, + { + "blockNumber": 13006594, + "address": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad" + }, + { + "blockNumber": 13006530, + "address": "0xfb5ff9cf1fc844812c4ee7c2926b562d9d842e0e" + }, + { + "blockNumber": 13006466, + "address": "0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24" + }, + { + "blockNumber": 13006402, + "address": "0x198ef79f1f515f02dfe9e3115ed9fc07183f02fc" + }, + { + "blockNumber": 13006338, + "address": "0xe1c14b9f065dead2e89ee35382f8bd42bdb87a04" + }, + { + "blockNumber": 13006274, + "address": "0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24" + }, + { + "blockNumber": 13006210, + "address": "0xba3dc701b93d875e340c562bf05f8199daf0f506" + }, + { + "blockNumber": 13006146, + "address": "0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24" + }, + { + "blockNumber": 13006082, + "address": "0x6b2c0c7be2048daa9b5527982c29f48062b34d58" + }, + { + "blockNumber": 13006018, + "address": "0x524254eedcd8221f8993ba234cb53771e68dcf4c" + }, + { + "blockNumber": 13005826, + "address": "0x802b65b5d9016621e66003aed0b16615093f328b" + }, + { + "blockNumber": 13005698, + "address": "0x0e22b5f3e11944578b37ed04f5312dfc246f443c" + }, + { + "blockNumber": 13005634, + "address": "0x2d5dfe0e4582c905233df527242616017f36e192" + }, + { + "blockNumber": 13005570, + "address": "0x1111111254eeb25477b68fb85ed929f73a960582" + }, + { + "blockNumber": 13005506, + "address": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad" + }, + { + "blockNumber": 13005442, + "address": "0xecb03b9a0e7f7b5e261d3ef752865af6621a54fe" + }, + { + "blockNumber": 13005378, + "address": "0xa82d848e06f93767fa68639026b798e5daa3462a" + }, + { + "blockNumber": 13005314, + "address": "0x6131b5fae19ea4f9d964eac0408e4408b66337b5" + }, + { + "blockNumber": 13005186, + "address": "0xcb566e3b6934fa77258d68ea18e931fa75e1aaaa" + }, + { + "blockNumber": 13005122, + "address": "0xb3da098a7251a647892203e0c256b4398d131a54" + }, + { + "blockNumber": 13005058, + "address": "0x1a8f43e01b78979eb4ef7febec60f32c9a72f58e" + }, + { + "blockNumber": 13004994, + "address": "0x1195cf65f83b3a5768f3c496d3a05ad6412c64b7" + }, + { + "blockNumber": 13004930, + "address": "0x0000000000000068f116a894984e2db1123eb395" + }, + { + "blockNumber": 13004866, + "address": "0x47fbe95e981c0df9737b6971b451fb15fdc989d9" + }, + { + "blockNumber": 13004802, + "address": "0x198ef79f1f515f02dfe9e3115ed9fc07183f02fc" + }, + { + "blockNumber": 13004738, + "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913" + }, + { + "blockNumber": 13004674, + "address": "0xe7351fd770a37282b91d153ee690b63579d6dd7f" + }, + { + "blockNumber": 13004610, + "address": "0x47fbe95e981c0df9737b6971b451fb15fdc989d9" + }, + { + "blockNumber": 13004546, + "address": "0xff404f58aea7ca290dabb6f62b8287fce28a6863" + }, + { + "blockNumber": 13004482, + "address": "0x866edeaa416f0f253db14392eb0d15a08318d87a" + } + ] + }, + "storage": { + "nonzero": [ + { + "blockNumber": 13006428, + "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", + "slot": 7 + }, + { + "blockNumber": 13006722, + "address": "0x198ef79f1f515f02dfe9e3115ed9fc07183f02fc", + "slot": 1 + }, + { + "blockNumber": 13006658, + "address": "0x3b1228c3ede7e0898d57054cd9b8f812d24315c1", + "slot": 6 + }, + { + "blockNumber": 13006594, + "address": "0x1a8f43e01b78979eb4ef7febec60f32c9a72f58e", + "slot": 5 + }, + { + "blockNumber": 13006530, + "address": "0x2eb1380bf83282ecc1135249f3f2256ea69464b2", + "slot": 2 + }, + { + "blockNumber": 13006466, + "address": "0xcf205808ed36593aa40a44f10c7f7c2f67d4a4d4", + "slot": 0 + }, + { + "blockNumber": 13006402, + "address": "0xd18917b31118fe249722e770eed12a4d6e6542cc", + "slot": 9 + }, + { + "blockNumber": 13006338, + "address": "0x1a8f43e01b78979eb4ef7febec60f32c9a72f58e", + "slot": 5 + }, + { + "blockNumber": 13006274, + "address": "0x198ef79f1f515f02dfe9e3115ed9fc07183f02fc", + "slot": 1 + }, + { + "blockNumber": 13006210, + "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", + "slot": 5 + }, + { + "blockNumber": 13006146, + "address": "0xf4ad189f436e736ca6ba5aa2972e524e9beff570", + "slot": 1 + }, + { + "blockNumber": 13006082, + "address": "0x1b6b717d9ed5006b892083fc70359a19e8d2ad0e", + "slot": 0 + }, + { + "blockNumber": 13006018, + "address": "0x50a04c0b29d2ea8c2bfde3507425d59dd788d475", + "slot": 7 + }, + { + "blockNumber": 13005954, + "address": "0x28823dbba80ec9a69ff817093cae260f2b16e5f4", + "slot": 3 + }, + { + "blockNumber": 13005890, + "address": "0xcf205808ed36593aa40a44f10c7f7c2f67d4a4d4", + "slot": 1 + }, + { + "blockNumber": 13005826, + "address": "0xe3086852a4b125803c815a158249ae468a3254ca", + "slot": 2 + }, + { + "blockNumber": 13005762, + "address": "0x198ef79f1f515f02dfe9e3115ed9fc07183f02fc", + "slot": 1 + }, + { + "blockNumber": 13005698, + "address": "0x2e86a5583a6fdfb921632876875e1053e29b2d03", + "slot": 0 + }, + { + "blockNumber": 13005634, + "address": "0x198ef79f1f515f02dfe9e3115ed9fc07183f02fc", + "slot": 1 + }, + { + "blockNumber": 13005570, + "address": "0x2e86a5583a6fdfb921632876875e1053e29b2d03", + "slot": 2 + }, + { + "blockNumber": 13005506, + "address": "0x2626664c2603336e57b271c5c0b26f421741e481", + "slot": 0 + }, + { + "blockNumber": 13005442, + "address": "0x198ef79f1f515f02dfe9e3115ed9fc07183f02fc", + "slot": 0 + }, + { + "blockNumber": 13005378, + "address": "0x198ef79f1f515f02dfe9e3115ed9fc07183f02fc", + "slot": 1 + }, + { + "blockNumber": 13005314, + "address": "0x1a8f43e01b78979eb4ef7febec60f32c9a72f58e", + "slot": 6 + }, + { + "blockNumber": 13005250, + "address": "0xecb03b9a0e7f7b5e261d3ef752865af6621a54fe", + "slot": 0 + }, + { + "blockNumber": 13005186, + "address": "0xd18917b31118fe249722e770eed12a4d6e6542cc", + "slot": 9 + }, + { + "blockNumber": 13005122, + "address": "0x42069de48741db40aef864f8764432bbccbd0b69", + "slot": 4 + }, + { + "blockNumber": 13005058, + "address": "0x198ef79f1f515f02dfe9e3115ed9fc07183f02fc", + "slot": 0 + }, + { + "blockNumber": 13004994, + "address": "0xe3086852a4b125803c815a158249ae468a3254ca", + "slot": 4 + }, + { + "blockNumber": 13004930, + "address": "0xac1bd2486aaf3b5c0fc3fd868558b082a531b2b4", + "slot": 2 + }, + { + "blockNumber": 13004866, + "address": "0xecb03b9a0e7f7b5e261d3ef752865af6621a54fe", + "slot": 4 + }, + { + "blockNumber": 13004802, + "address": "0xc64e1d954086610b05ce9d7432749f594f9ff151", + "slot": 1 + } + ] + }, + "tx": { + "type": { + "0": [ + { + "hash": "0xafa32ec0e37cfb790fa8322671f3bb703712a6ca030685ae8b26af35a11ffa24", + "blockNumber": 13006428, + "txIdx": 9 + }, + { + "hash": "0xdb890c937e1debe856f400ed8210add3d720c3ba256a815d645e50520469f925", + "blockNumber": 13006428, + "txIdx": 10 + }, + { + "hash": "0xa0b90dd050ae78597707e819b1b52a571cc3b3ca3fa75f2bf0325df98fe987b4", + "blockNumber": 13006428, + "txIdx": 11 + }, + { + "hash": "0xc7fa33de18cb00184e9e7e874fc3a37106d3266f80a265d7e0d1d0f54d977f4b", + "blockNumber": 13006428, + "txIdx": 16 + }, + { + "hash": "0x1d35e868651ef6ae13698e54b1053e950cf919fde79e3f6df0194aabf3f881af", + "blockNumber": 13006428, + "txIdx": 17 + }, + { + "hash": "0x0477c3a8a05ed04e5986d15943507a3a167657e3541ec004d31d7e027e4e6804", + "blockNumber": 13006428, + "txIdx": 18 + }, + { + "hash": "0xaf5073fae75c5daa6f7ab7b2679254737ac4c538eba02e4ac22d3b48458175c4", + "blockNumber": 13006428, + "txIdx": 19 + }, + { + "hash": "0x1709b486be108d13e16bd2f86bed37b77e4683bce8a5dcda77d691d22ad35aa4", + "blockNumber": 13006428, + "txIdx": 20 + }, + { + "hash": "0x671292af7fc605d87e3e8020252952c545fa95d85ac4a50218c94e6861e4212a", + "blockNumber": 13006428, + "txIdx": 21 + }, + { + "hash": "0x0682251d517b9f8fe1863c4c11caac3f51bbf40114c8501bdf9960cd558995bd", + "blockNumber": 13006428, + "txIdx": 22 + }, + { + "hash": "0x9bfcb9a2a17282518c4940f08a265d2efe8119a07381cbc14e70978bff58844c", + "blockNumber": 13006428, + "txIdx": 23 + }, + { + "hash": "0x3cddd7280cafb9d7acb4904e527424966f38c135587bb59337b430bd1210b9f8", + "blockNumber": 13006428, + "txIdx": 24 + }, + { + "hash": "0xb8afcf53ea99a06f3e1646759d08408d107df438b80ba343335b64104039bebf", + "blockNumber": 13006428, + "txIdx": 25 + }, + { + "hash": "0x98d955332f5041566baa7b2b49fbf30c229e67bea52bee9ff9f10e65d5385be8", + "blockNumber": 13006428, + "txIdx": 26 + }, + { + "hash": "0x4354be9fdaa4fcfd76c17e4086b30f0432e5f089c9b9dd3ffda6aea8b3d65163", + "blockNumber": 13006428, + "txIdx": 27 + }, + { + "hash": "0x2dd3fc35ea56188a53947345e931d81602b0c1bdfbf00cbcc63e0e2522f63d01", + "blockNumber": 13006428, + "txIdx": 28 + }, + { + "hash": "0x0c3dd65b0db8b3ba8cc9d4b7ca50190a32ac5f7b56e273223add44e75b2b61c3", + "blockNumber": 13006428, + "txIdx": 29 + }, + { + "hash": "0x103492db3dee9372220a665857827ce20b0a559e5bd398d12f05d98cd5b24b46", + "blockNumber": 13006428, + "txIdx": 30 + }, + { + "hash": "0x11267c24560a2c6fb78aab5a486f09dc7e96aab107e2be2ed8ed6b7d5790808d", + "blockNumber": 13006428, + "txIdx": 31 + }, + { + "hash": "0x0c7288797fae5845742a56fe1a43617f0931f174409b9d57bd7c82f89ab4cc08", + "blockNumber": 13006428, + "txIdx": 32 + }, + { + "hash": "0x2871067cb70ce7a6c5bc6a0dae0ccf3ba9117cdc1ba11acdcfb61dbd2c14ee6f", + "blockNumber": 13006428, + "txIdx": 46 + }, + { + "hash": "0x677217e8122c1f3094aec664c8d9aebefe4bce7e4b5313264c5e4b4427f1af19", + "blockNumber": 13006722, + "txIdx": 3 + }, + { + "hash": "0x0f343d75a960a6168260b3acf5358a0c9b5fd01cc06dda029779ac0cf21f4317", + "blockNumber": 13006722, + "txIdx": 4 + }, + { + "hash": "0x26cde48b593c22bc36b936c1e436824c1a508d85b3cfa8870e43da730c7ab99c", + "blockNumber": 13006722, + "txIdx": 5 + }, + { + "hash": "0xd75004cce116ce46f70a4c89778bdc68a0dd759b526e2ca0212b635e14c4588b", + "blockNumber": 13006722, + "txIdx": 6 + }, + { + "hash": "0x8695f2a3af6bec45160b74c6b4b9d8033db183625e83dec0018ac92ab6a085d2", + "blockNumber": 13006722, + "txIdx": 7 + }, + { + "hash": "0x9f65e23a1ad7c2d5d16d8b5758e16d341983ae902cebff76c9831c07919b91f2", + "blockNumber": 13006722, + "txIdx": 8 + }, + { + "hash": "0x2275d734f2e1e2db16b27164e70abd8e3ed3d58c8d15e7bd28f7ac34b9b51bd2", + "blockNumber": 13006722, + "txIdx": 11 + }, + { + "hash": "0x2e06df100285380ea2139a7cc4d70a4be84f7f543555553fd1fcdd9d1d37796f", + "blockNumber": 13006722, + "txIdx": 12 + }, + { + "hash": "0xc785d1455bf7e532aa03d2adaf6c81e1df8ea92a7597193dafed0ff07147f750", + "blockNumber": 13006722, + "txIdx": 13 + }, + { + "hash": "0x458a27278afe019c44b1ce28eb390ad4da66670b0879591e9b8d9f51ec342d1b", + "blockNumber": 13006722, + "txIdx": 14 + }, + { + "hash": "0x5246674d68618ae086f17b44e8c3fa6a6981f84a368303a701a47bc08d20ad3e", + "blockNumber": 13006722, + "txIdx": 15 + } + ], + "1": [ + { + "hash": "0xcd5f20ef325811daaacb063cf1fe10d12db510d9a6175f9bd0da6ac802b84acd", + "blockNumber": 13006146, + "txIdx": 8 + }, + { + "hash": "0x3b24edebbfab5980ee2e6eb7fdada5d18fac8694ab3ec9cb920e35579df4dd6c", + "blockNumber": 13006082, + "txIdx": 1 + }, + { + "hash": "0x5ec9c15e0bade4becef50a4546c8726afaaa957b3bc1bb95e0f48caa8ac09701", + "blockNumber": 13003522, + "txIdx": 8 + }, + { + "hash": "0x607aea205a491e4e2866f75b8cdb0f7893ff26e50457ef34b56bc3c7f1ba90bb", + "blockNumber": 13003330, + "txIdx": 3 + }, + { + "hash": "0xd1b05d57993138a3baa057223da34bf6aa2dd296938541dd572d16caf116f24b", + "blockNumber": 13003330, + "txIdx": 7 + }, + { + "hash": "0x58da8a04ed6a5de6bdde808469849b47ed840294cba4ea3871d513dec27c61e5", + "blockNumber": 13003202, + "txIdx": 42 + }, + { + "hash": "0x236d066c3b20cdbcd766441d2d339e8295ea67de68d3f7be18e054200d9ec37e", + "blockNumber": 13002242, + "txIdx": 2 + }, + { + "hash": "0x641d370ed77110f51bfd662dbb89a7d3433d33b27acd34049cfd8d42aba5b41e", + "blockNumber": 13001922, + "txIdx": 1 + }, + { + "hash": "0x3ebc89c038496e7277fcca31dc0c33a63e6ed02e8e43a49a4c56ee9ba0b047a6", + "blockNumber": 13001858, + "txIdx": 3 + }, + { + "hash": "0x4b98c7ea1e5bad91ae2cc34dbf5d89c4e0e3e56b2dc4da4fbc601062710fc470", + "blockNumber": 13001218, + "txIdx": 5 + }, + { + "hash": "0x33ec0f87ab8bd6930a56809b68101a08e3e4e14300750747fac735307cc33860", + "blockNumber": 13001218, + "txIdx": 8 + }, + { + "hash": "0xeb0fff5a292bf976a9c6bd9335cde3513e6b794b4386f579c5e7149057bfb882", + "blockNumber": 13001154, + "txIdx": 2 + }, + { + "hash": "0x13e60fb60b6cb3c5829cdfa173d4df47a16adc01b9e1c6746ef3c725af5d3b95", + "blockNumber": 12999298, + "txIdx": 4 + }, + { + "hash": "0xbe740ed03d616096f83349abb57c9f1e609102e7255ea4f71aeb5a42ff19106a", + "blockNumber": 12999234, + "txIdx": 5 + }, + { + "hash": "0x779ffeea0907d4e1b99dd57394950edf111ba17f3b405961be2613e7a4cb6f4d", + "blockNumber": 12999042, + "txIdx": 2 + }, + { + "hash": "0xa52e13cc7a5be155199f5ca94575ea9d61894b9c0a27b8d1982e207070716f04", + "blockNumber": 12998914, + "txIdx": 1 + } + ], + "2": [ + { + "hash": "0x65412cab5538c26798078ae8c6661a5e1be6f0d773fe0c8c8064144d9023fa2c", + "blockNumber": 13006428, + "txIdx": 2 + }, + { + "hash": "0x115c9780a26c66062c485ea9dc14e0ed0297785a6cd26003a467d51e84264acc", + "blockNumber": 13006428, + "txIdx": 3 + }, + { + "hash": "0xe6c3994aeb103d365f75e44c2774cb0f4d721e1ba8c5db909912bab0f77835c5", + "blockNumber": 13006428, + "txIdx": 4 + }, + { + "hash": "0x1454f2c6684f662c8396fa38869ba4c20cb8d2f59a6ac442176f614b2995ba7f", + "blockNumber": 13006428, + "txIdx": 5 + }, + { + "hash": "0x1797176df6750301eb98f4054e5a8e32ccce763bba953df0ee63abb7e06f0e59", + "blockNumber": 13006428, + "txIdx": 6 + }, + { + "hash": "0xa4c95fb7a7042f94a0bc688def6a72bcb5f3b2be9ac0594850030b6843d01458", + "blockNumber": 13006428, + "txIdx": 7 + }, + { + "hash": "0xebfbf452195b228de771e45c9d55b6a2e71bf00a5a6b2071d742ea741c9d055c", + "blockNumber": 13006428, + "txIdx": 8 + }, + { + "hash": "0x244fc029bd010183c717ba7d6c493b08ca04216033f51afd1c0f1eb3fabfdffe", + "blockNumber": 13006428, + "txIdx": 12 + }, + { + "hash": "0xf5a40db42bf3ef501fe9090c0f10881e663d9505fbcc57b634ee1225326c10f9", + "blockNumber": 13006428, + "txIdx": 13 + }, + { + "hash": "0xde8e1d81a54a0a1162046f0802927d7103d6a0d926e7305ae2f1524861c320f9", + "blockNumber": 13006428, + "txIdx": 14 + }, + { + "hash": "0x1fd58a866d6d8dce0cb9ea71db56d24d2940e6b6bfd841fa88e46a1b29cfdbae", + "blockNumber": 13006428, + "txIdx": 15 + }, + { + "hash": "0xb02a8ab2272c3c6d42d893f9db7ac5abb4d9c24852ff8c707883c62e48487885", + "blockNumber": 13006428, + "txIdx": 33 + }, + { + "hash": "0x98e54272bfade3419534b0f8f658bd53355c7b04844f09eb88d7f608dd066720", + "blockNumber": 13006428, + "txIdx": 34 + }, + { + "hash": "0xdf882259e6c4f08746cbbecb81d5e345a9cb2aba12cfea833bb8cde695969c12", + "blockNumber": 13006428, + "txIdx": 35 + }, + { + "hash": "0x4e2ef84fa80847160f97525e890697338fd3b9abcdda9f155151ffbeb9bf9ccb", + "blockNumber": 13006428, + "txIdx": 36 + }, + { + "hash": "0xef073d812bc2e061704751be7f2e71a7d570b5ace7c9211512e946384ef34eae", + "blockNumber": 13006428, + "txIdx": 37 + }, + { + "hash": "0xd2963c2fdbec4da681ea41ea36e77cd33418e402d30e9588951d2656fa20f59e", + "blockNumber": 13006428, + "txIdx": 38 + }, + { + "hash": "0x2532f5c1f0cf061823b9a817355fccc906fa354dbc52a116de4d5a2bcacf5486", + "blockNumber": 13006428, + "txIdx": 39 + }, + { + "hash": "0x84345513ffc67824d26cdd8b4fa5f2833749a4736673b48bc9073f79eda4a84a", + "blockNumber": 13006428, + "txIdx": 40 + }, + { + "hash": "0x0a5a7d12d14e7d5717b049f3f94ebc2496d3c9ddc9fbb56512f9107676b16b26", + "blockNumber": 13006428, + "txIdx": 41 + }, + { + "hash": "0x07da533b5cebb9c4ce8be5f609699004229b8bc469b8d12669d31cf96b4685d7", + "blockNumber": 13006428, + "txIdx": 42 + }, + { + "hash": "0xd937a734497c369def5ab9e54b6a9dd5a0a247369f2849f6d03441e62e0875b4", + "blockNumber": 13006428, + "txIdx": 43 + }, + { + "hash": "0x220cf2f5bc1df116422135e2013fbc337635200819c6aaec1b588a6f81d2bb73", + "blockNumber": 13006428, + "txIdx": 44 + }, + { + "hash": "0x3ecdb20da74a8ad7a6403d8167bd35ebaef1f35271eb57f0a0f6de3c59f1d1ca", + "blockNumber": 13006428, + "txIdx": 45 + }, + { + "hash": "0x7d35824f51b4e7190d9146c22cf1ed00fbb97ebcb5e75bb48a81381108b502a5", + "blockNumber": 13006428, + "txIdx": 47 + }, + { + "hash": "0x80a02010a4730c4081dd9f977eaa132892a763da14ca76ff79a25ea48974e408", + "blockNumber": 13006428, + "txIdx": 48 + }, + { + "hash": "0xe0236c2fefdf2b54651c4f34c9c1609c140901bf85a3f2f6934229dcc8548464", + "blockNumber": 13006428, + "txIdx": 49 + }, + { + "hash": "0x91bffff612fabb3429d02bf56e2e19224e4cbbf598f710adabec0cadf5b31759", + "blockNumber": 13006428, + "txIdx": 50 + }, + { + "hash": "0xd11643688fecd8c3a68c380a651e720ee2bf559a55951f733e7ed552a000058f", + "blockNumber": 13006428, + "txIdx": 51 + }, + { + "hash": "0x787404367bc5aa4cc50a9816703634cf0f563d6b8b45b1a63b433b340a22d82a", + "blockNumber": 13006428, + "txIdx": 52 + }, + { + "hash": "0xe6435a2f1fc84ed47f4d37bc9615cdebb5a49a4b2b445b57d548b2505d62e748", + "blockNumber": 13006428, + "txIdx": 53 + }, + { + "hash": "0xcc9480f6dbda95886cc9080ae15ec7874e8330ed37c7017bf882524b12d8f8f5", + "blockNumber": 13006428, + "txIdx": 54 + } + ], + "3": [] + }, + "category": { + "default": [ + { + "hash": "0xe6c3994aeb103d365f75e44c2774cb0f4d721e1ba8c5db909912bab0f77835c5", + "blockNumber": 13006428, + "txIdx": 4 + }, + { + "hash": "0x1454f2c6684f662c8396fa38869ba4c20cb8d2f59a6ac442176f614b2995ba7f", + "blockNumber": 13006428, + "txIdx": 5 + }, + { + "hash": "0x1797176df6750301eb98f4054e5a8e32ccce763bba953df0ee63abb7e06f0e59", + "blockNumber": 13006428, + "txIdx": 6 + }, + { + "hash": "0xa4c95fb7a7042f94a0bc688def6a72bcb5f3b2be9ac0594850030b6843d01458", + "blockNumber": 13006428, + "txIdx": 7 + }, + { + "hash": "0xebfbf452195b228de771e45c9d55b6a2e71bf00a5a6b2071d742ea741c9d055c", + "blockNumber": 13006428, + "txIdx": 8 + }, + { + "hash": "0xafa32ec0e37cfb790fa8322671f3bb703712a6ca030685ae8b26af35a11ffa24", + "blockNumber": 13006428, + "txIdx": 9 + }, + { + "hash": "0xdb890c937e1debe856f400ed8210add3d720c3ba256a815d645e50520469f925", + "blockNumber": 13006428, + "txIdx": 10 + }, + { + "hash": "0xa0b90dd050ae78597707e819b1b52a571cc3b3ca3fa75f2bf0325df98fe987b4", + "blockNumber": 13006428, + "txIdx": 11 + }, + { + "hash": "0x244fc029bd010183c717ba7d6c493b08ca04216033f51afd1c0f1eb3fabfdffe", + "blockNumber": 13006428, + "txIdx": 12 + }, + { + "hash": "0xf5a40db42bf3ef501fe9090c0f10881e663d9505fbcc57b634ee1225326c10f9", + "blockNumber": 13006428, + "txIdx": 13 + }, + { + "hash": "0xde8e1d81a54a0a1162046f0802927d7103d6a0d926e7305ae2f1524861c320f9", + "blockNumber": 13006428, + "txIdx": 14 + }, + { + "hash": "0x1fd58a866d6d8dce0cb9ea71db56d24d2940e6b6bfd841fa88e46a1b29cfdbae", + "blockNumber": 13006428, + "txIdx": 15 + }, + { + "hash": "0xc7fa33de18cb00184e9e7e874fc3a37106d3266f80a265d7e0d1d0f54d977f4b", + "blockNumber": 13006428, + "txIdx": 16 + }, + { + "hash": "0x1d35e868651ef6ae13698e54b1053e950cf919fde79e3f6df0194aabf3f881af", + "blockNumber": 13006428, + "txIdx": 17 + }, + { + "hash": "0x0477c3a8a05ed04e5986d15943507a3a167657e3541ec004d31d7e027e4e6804", + "blockNumber": 13006428, + "txIdx": 18 + }, + { + "hash": "0xaf5073fae75c5daa6f7ab7b2679254737ac4c538eba02e4ac22d3b48458175c4", + "blockNumber": 13006428, + "txIdx": 19 + }, + { + "hash": "0x1709b486be108d13e16bd2f86bed37b77e4683bce8a5dcda77d691d22ad35aa4", + "blockNumber": 13006428, + "txIdx": 20 + }, + { + "hash": "0x671292af7fc605d87e3e8020252952c545fa95d85ac4a50218c94e6861e4212a", + "blockNumber": 13006428, + "txIdx": 21 + }, + { + "hash": "0x0682251d517b9f8fe1863c4c11caac3f51bbf40114c8501bdf9960cd558995bd", + "blockNumber": 13006428, + "txIdx": 22 + }, + { + "hash": "0x9bfcb9a2a17282518c4940f08a265d2efe8119a07381cbc14e70978bff58844c", + "blockNumber": 13006428, + "txIdx": 23 + }, + { + "hash": "0x3cddd7280cafb9d7acb4904e527424966f38c135587bb59337b430bd1210b9f8", + "blockNumber": 13006428, + "txIdx": 24 + }, + { + "hash": "0xb8afcf53ea99a06f3e1646759d08408d107df438b80ba343335b64104039bebf", + "blockNumber": 13006428, + "txIdx": 25 + }, + { + "hash": "0x98d955332f5041566baa7b2b49fbf30c229e67bea52bee9ff9f10e65d5385be8", + "blockNumber": 13006428, + "txIdx": 26 + }, + { + "hash": "0x4354be9fdaa4fcfd76c17e4086b30f0432e5f089c9b9dd3ffda6aea8b3d65163", + "blockNumber": 13006428, + "txIdx": 27 + }, + { + "hash": "0x2dd3fc35ea56188a53947345e931d81602b0c1bdfbf00cbcc63e0e2522f63d01", + "blockNumber": 13006428, + "txIdx": 28 + }, + { + "hash": "0x0c3dd65b0db8b3ba8cc9d4b7ca50190a32ac5f7b56e273223add44e75b2b61c3", + "blockNumber": 13006428, + "txIdx": 29 + }, + { + "hash": "0x103492db3dee9372220a665857827ce20b0a559e5bd398d12f05d98cd5b24b46", + "blockNumber": 13006428, + "txIdx": 30 + }, + { + "hash": "0x11267c24560a2c6fb78aab5a486f09dc7e96aab107e2be2ed8ed6b7d5790808d", + "blockNumber": 13006428, + "txIdx": 31 + }, + { + "hash": "0x0c7288797fae5845742a56fe1a43617f0931f174409b9d57bd7c82f89ab4cc08", + "blockNumber": 13006428, + "txIdx": 32 + }, + { + "hash": "0xb02a8ab2272c3c6d42d893f9db7ac5abb4d9c24852ff8c707883c62e48487885", + "blockNumber": 13006428, + "txIdx": 33 + }, + { + "hash": "0x98e54272bfade3419534b0f8f658bd53355c7b04844f09eb88d7f608dd066720", + "blockNumber": 13006428, + "txIdx": 34 + }, + { + "hash": "0xdf882259e6c4f08746cbbecb81d5e345a9cb2aba12cfea833bb8cde695969c12", + "blockNumber": 13006428, + "txIdx": 35 + } + ], + "large": [ + { + "hash": "0xda944064eb5d668b4dcd170f5a875b43338412e9f1e6b104aa2c4a2665b7effa", + "blockNumber": 13004162, + "txIdx": 53 + }, + { + "hash": "0x6bd61460fb8f06a39a7889da6940d0ae10cf61ee3d69d084ba933bd5cd1d0ef8", + "blockNumber": 13003266, + "txIdx": 26 + }, + { + "hash": "0x9857d2d0f76dd5aebd339639e89874ce8b21914cf1cd736937b4df1a9c627b6e", + "blockNumber": 13002626, + "txIdx": 20 + }, + { + "hash": "0x58af597e7752cd844a4688dcdb74236f5e8c4c47bdb39dbc3cd5e84bba70be0d", + "blockNumber": 13002434, + "txIdx": 31 + }, + { + "hash": "0x5218ff3a5733260c7012ff50f4611cda45d82ffba8d981c8f6a96d298f976e78", + "blockNumber": 13002434, + "txIdx": 33 + }, + { + "hash": "0x3f05b37260bdce8dedfbb5dd4eaa763b03a543aa35a2b118cd7d0c0e43ff62c2", + "blockNumber": 13002434, + "txIdx": 48 + }, + { + "hash": "0x8b41c3baf2f9700ecfc8625c1b262487be8a30b1dfba21777f1a4e8fe1ab6577", + "blockNumber": 13002370, + "txIdx": 75 + }, + { + "hash": "0x1f53aa0175f104b65459f764f230aed38e420d81afb85a0b548af0175a9b4c59", + "blockNumber": 13002050, + "txIdx": 37 + }, + { + "hash": "0x4729cd50f2049ed03dbae7be3f3aba62e8e77502280f3b94e77a1c583449263f", + "blockNumber": 12999746, + "txIdx": 54 + }, + { + "hash": "0xf93e272b832e1a1b244e30668b4c556e8e9728c5ea15a4f3293f193053b51fe7", + "blockNumber": 12999298, + "txIdx": 20 + }, + { + "hash": "0x46f54f4498dceb41704454f1f21c0937337fb810e3c44e63edbd6418c93b8cda", + "blockNumber": 12998594, + "txIdx": 37 + } + ], + "max": [ + { + "hash": "0x65412cab5538c26798078ae8c6661a5e1be6f0d773fe0c8c8064144d9023fa2c", + "blockNumber": 13006428, + "txIdx": 2 + }, + { + "hash": "0x115c9780a26c66062c485ea9dc14e0ed0297785a6cd26003a467d51e84264acc", + "blockNumber": 13006428, + "txIdx": 3 + }, + { + "hash": "0xb1967c2792d3bd8cc6dfa23b26416e0910e3595072c1d01a2966f3702b5e2c07", + "blockNumber": 13003842, + "txIdx": 41 + }, + { + "hash": "0x780264196b32ab1c65fb45212bcd9f4b3bccb8a0c187cfc8d84fa9a27c63754f", + "blockNumber": 13002754, + "txIdx": 65 + }, + { + "hash": "0x685bdd82cfc15364507b7af7dcf59d4aeb22241dd26f86e91d664b2432249a41", + "blockNumber": 13001538, + "txIdx": 26 + } + ], + "oversize": [] + } + }, + "rc": { + "events": [ + { + "hash": "0x1797176df6750301eb98f4054e5a8e32ccce763bba953df0ee63abb7e06f0e59", + "blockNumber": 13006428, + "txIdx": 6, + "logIdx": 0, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0xd40e0113326135f3972a0a7cc14af05162275ef5a61c5c7fe72e9917de039d8a", + "blockNumber": 13006722, + "txIdx": 1, + "logIdx": 0, + "eventSchema": "0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c" + }, + { + "hash": "0xd40e0113326135f3972a0a7cc14af05162275ef5a61c5c7fe72e9917de039d8a", + "blockNumber": 13006722, + "txIdx": 1, + "logIdx": 1, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0xd40e0113326135f3972a0a7cc14af05162275ef5a61c5c7fe72e9917de039d8a", + "blockNumber": 13006722, + "txIdx": 1, + "logIdx": 2, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0xd40e0113326135f3972a0a7cc14af05162275ef5a61c5c7fe72e9917de039d8a", + "blockNumber": 13006722, + "txIdx": 1, + "logIdx": 3, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0xd40e0113326135f3972a0a7cc14af05162275ef5a61c5c7fe72e9917de039d8a", + "blockNumber": 13006722, + "txIdx": 1, + "logIdx": 5, + "eventSchema": "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822" + }, + { + "hash": "0x62999994c9a306e820146e11e65b6d34091f61f078370264dee6c2879871ab90", + "blockNumber": 13006658, + "txIdx": 1, + "logIdx": 0, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x2442c1e2bdb4ebed95599f97a63658580fd027acfa19ff8cd66c14988e0cea9e", + "blockNumber": 13006594, + "txIdx": 2, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x2442c1e2bdb4ebed95599f97a63658580fd027acfa19ff8cd66c14988e0cea9e", + "blockNumber": 13006594, + "txIdx": 2, + "logIdx": 1, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x2442c1e2bdb4ebed95599f97a63658580fd027acfa19ff8cd66c14988e0cea9e", + "blockNumber": 13006594, + "txIdx": 2, + "logIdx": 2, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x2442c1e2bdb4ebed95599f97a63658580fd027acfa19ff8cd66c14988e0cea9e", + "blockNumber": 13006594, + "txIdx": 2, + "logIdx": 4, + "eventSchema": "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822" + }, + { + "hash": "0x2442c1e2bdb4ebed95599f97a63658580fd027acfa19ff8cd66c14988e0cea9e", + "blockNumber": 13006594, + "txIdx": 2, + "logIdx": 5, + "eventSchema": "0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65" + }, + { + "hash": "0x1f3eae61c3217865d6c13ba5f17674e6a91d1090adbb51191dcd1b15e2159d30", + "blockNumber": 13006530, + "txIdx": 1, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x1f3eae61c3217865d6c13ba5f17674e6a91d1090adbb51191dcd1b15e2159d30", + "blockNumber": 13006530, + "txIdx": 1, + "logIdx": 1, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x1f3eae61c3217865d6c13ba5f17674e6a91d1090adbb51191dcd1b15e2159d30", + "blockNumber": 13006530, + "txIdx": 1, + "logIdx": 2, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x1f3eae61c3217865d6c13ba5f17674e6a91d1090adbb51191dcd1b15e2159d30", + "blockNumber": 13006530, + "txIdx": 1, + "logIdx": 3, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x1f3eae61c3217865d6c13ba5f17674e6a91d1090adbb51191dcd1b15e2159d30", + "blockNumber": 13006530, + "txIdx": 1, + "logIdx": 4, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x1f3eae61c3217865d6c13ba5f17674e6a91d1090adbb51191dcd1b15e2159d30", + "blockNumber": 13006530, + "txIdx": 1, + "logIdx": 5, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x1f3eae61c3217865d6c13ba5f17674e6a91d1090adbb51191dcd1b15e2159d30", + "blockNumber": 13006530, + "txIdx": 1, + "logIdx": 6, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x1f3eae61c3217865d6c13ba5f17674e6a91d1090adbb51191dcd1b15e2159d30", + "blockNumber": 13006530, + "txIdx": 1, + "logIdx": 7, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x1f3eae61c3217865d6c13ba5f17674e6a91d1090adbb51191dcd1b15e2159d30", + "blockNumber": 13006530, + "txIdx": 1, + "logIdx": 8, + "eventSchema": "0xc6c1e0630dbe9130cc068028486c0d118ddcea348550819defd5cb8c257f8a38" + }, + { + "hash": "0x1f3eae61c3217865d6c13ba5f17674e6a91d1090adbb51191dcd1b15e2159d30", + "blockNumber": 13006530, + "txIdx": 1, + "logIdx": 9, + "eventSchema": "0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65" + }, + { + "hash": "0x1f3eae61c3217865d6c13ba5f17674e6a91d1090adbb51191dcd1b15e2159d30", + "blockNumber": 13006530, + "txIdx": 1, + "logIdx": 10, + "eventSchema": "0x320958176930804eb66c2343c7343fc0367dc16249590c0f195783bee199d094" + }, + { + "hash": "0xaf2af67a915656fe75271c5fdcff42dcee5fe98924943ff1274565b50f64acbd", + "blockNumber": 13006466, + "txIdx": 1, + "logIdx": 0, + "eventSchema": "0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c" + }, + { + "hash": "0xaf2af67a915656fe75271c5fdcff42dcee5fe98924943ff1274565b50f64acbd", + "blockNumber": 13006466, + "txIdx": 1, + "logIdx": 1, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0xaf2af67a915656fe75271c5fdcff42dcee5fe98924943ff1274565b50f64acbd", + "blockNumber": 13006466, + "txIdx": 1, + "logIdx": 2, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0xaf2af67a915656fe75271c5fdcff42dcee5fe98924943ff1274565b50f64acbd", + "blockNumber": 13006466, + "txIdx": 1, + "logIdx": 4, + "eventSchema": "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822" + }, + { + "hash": "0x6e637cff43b735bff44220cc981819f81f670e91f8ea60e17da535d49035c0ff", + "blockNumber": 13006402, + "txIdx": 1, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x6e637cff43b735bff44220cc981819f81f670e91f8ea60e17da535d49035c0ff", + "blockNumber": 13006402, + "txIdx": 1, + "logIdx": 1, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x6e637cff43b735bff44220cc981819f81f670e91f8ea60e17da535d49035c0ff", + "blockNumber": 13006402, + "txIdx": 1, + "logIdx": 2, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x6e637cff43b735bff44220cc981819f81f670e91f8ea60e17da535d49035c0ff", + "blockNumber": 13006402, + "txIdx": 1, + "logIdx": 4, + "eventSchema": "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822" + }, + { + "hash": "0x6e637cff43b735bff44220cc981819f81f670e91f8ea60e17da535d49035c0ff", + "blockNumber": 13006402, + "txIdx": 1, + "logIdx": 5, + "eventSchema": "0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65" + } + ], + "category": { + "default": [ + { + "hash": "0x65412cab5538c26798078ae8c6661a5e1be6f0d773fe0c8c8064144d9023fa2c", + "blockNumber": 13006428, + "txIdx": 2 + }, + { + "hash": "0x115c9780a26c66062c485ea9dc14e0ed0297785a6cd26003a467d51e84264acc", + "blockNumber": 13006428, + "txIdx": 3 + }, + { + "hash": "0x1797176df6750301eb98f4054e5a8e32ccce763bba953df0ee63abb7e06f0e59", + "blockNumber": 13006428, + "txIdx": 6 + }, + { + "hash": "0xa4c95fb7a7042f94a0bc688def6a72bcb5f3b2be9ac0594850030b6843d01458", + "blockNumber": 13006428, + "txIdx": 7 + }, + { + "hash": "0xafa32ec0e37cfb790fa8322671f3bb703712a6ca030685ae8b26af35a11ffa24", + "blockNumber": 13006428, + "txIdx": 9 + }, + { + "hash": "0xdb890c937e1debe856f400ed8210add3d720c3ba256a815d645e50520469f925", + "blockNumber": 13006428, + "txIdx": 10 + }, + { + "hash": "0xa0b90dd050ae78597707e819b1b52a571cc3b3ca3fa75f2bf0325df98fe987b4", + "blockNumber": 13006428, + "txIdx": 11 + }, + { + "hash": "0x244fc029bd010183c717ba7d6c493b08ca04216033f51afd1c0f1eb3fabfdffe", + "blockNumber": 13006428, + "txIdx": 12 + }, + { + "hash": "0xde8e1d81a54a0a1162046f0802927d7103d6a0d926e7305ae2f1524861c320f9", + "blockNumber": 13006428, + "txIdx": 14 + }, + { + "hash": "0x1fd58a866d6d8dce0cb9ea71db56d24d2940e6b6bfd841fa88e46a1b29cfdbae", + "blockNumber": 13006428, + "txIdx": 15 + }, + { + "hash": "0xc7fa33de18cb00184e9e7e874fc3a37106d3266f80a265d7e0d1d0f54d977f4b", + "blockNumber": 13006428, + "txIdx": 16 + }, + { + "hash": "0x1d35e868651ef6ae13698e54b1053e950cf919fde79e3f6df0194aabf3f881af", + "blockNumber": 13006428, + "txIdx": 17 + }, + { + "hash": "0x0477c3a8a05ed04e5986d15943507a3a167657e3541ec004d31d7e027e4e6804", + "blockNumber": 13006428, + "txIdx": 18 + }, + { + "hash": "0xaf5073fae75c5daa6f7ab7b2679254737ac4c538eba02e4ac22d3b48458175c4", + "blockNumber": 13006428, + "txIdx": 19 + }, + { + "hash": "0x1709b486be108d13e16bd2f86bed37b77e4683bce8a5dcda77d691d22ad35aa4", + "blockNumber": 13006428, + "txIdx": 20 + }, + { + "hash": "0x671292af7fc605d87e3e8020252952c545fa95d85ac4a50218c94e6861e4212a", + "blockNumber": 13006428, + "txIdx": 21 + }, + { + "hash": "0x0682251d517b9f8fe1863c4c11caac3f51bbf40114c8501bdf9960cd558995bd", + "blockNumber": 13006428, + "txIdx": 22 + }, + { + "hash": "0x9bfcb9a2a17282518c4940f08a265d2efe8119a07381cbc14e70978bff58844c", + "blockNumber": 13006428, + "txIdx": 23 + }, + { + "hash": "0x98d955332f5041566baa7b2b49fbf30c229e67bea52bee9ff9f10e65d5385be8", + "blockNumber": 13006428, + "txIdx": 26 + }, + { + "hash": "0x4354be9fdaa4fcfd76c17e4086b30f0432e5f089c9b9dd3ffda6aea8b3d65163", + "blockNumber": 13006428, + "txIdx": 27 + }, + { + "hash": "0x2dd3fc35ea56188a53947345e931d81602b0c1bdfbf00cbcc63e0e2522f63d01", + "blockNumber": 13006428, + "txIdx": 28 + }, + { + "hash": "0x0c3dd65b0db8b3ba8cc9d4b7ca50190a32ac5f7b56e273223add44e75b2b61c3", + "blockNumber": 13006428, + "txIdx": 29 + }, + { + "hash": "0x103492db3dee9372220a665857827ce20b0a559e5bd398d12f05d98cd5b24b46", + "blockNumber": 13006428, + "txIdx": 30 + }, + { + "hash": "0x11267c24560a2c6fb78aab5a486f09dc7e96aab107e2be2ed8ed6b7d5790808d", + "blockNumber": 13006428, + "txIdx": 31 + }, + { + "hash": "0x0c7288797fae5845742a56fe1a43617f0931f174409b9d57bd7c82f89ab4cc08", + "blockNumber": 13006428, + "txIdx": 32 + }, + { + "hash": "0xb02a8ab2272c3c6d42d893f9db7ac5abb4d9c24852ff8c707883c62e48487885", + "blockNumber": 13006428, + "txIdx": 33 + }, + { + "hash": "0x98e54272bfade3419534b0f8f658bd53355c7b04844f09eb88d7f608dd066720", + "blockNumber": 13006428, + "txIdx": 34 + }, + { + "hash": "0xdf882259e6c4f08746cbbecb81d5e345a9cb2aba12cfea833bb8cde695969c12", + "blockNumber": 13006428, + "txIdx": 35 + }, + { + "hash": "0x4e2ef84fa80847160f97525e890697338fd3b9abcdda9f155151ffbeb9bf9ccb", + "blockNumber": 13006428, + "txIdx": 36 + }, + { + "hash": "0xef073d812bc2e061704751be7f2e71a7d570b5ace7c9211512e946384ef34eae", + "blockNumber": 13006428, + "txIdx": 37 + }, + { + "hash": "0xd2963c2fdbec4da681ea41ea36e77cd33418e402d30e9588951d2656fa20f59e", + "blockNumber": 13006428, + "txIdx": 38 + }, + { + "hash": "0x2532f5c1f0cf061823b9a817355fccc906fa354dbc52a116de4d5a2bcacf5486", + "blockNumber": 13006428, + "txIdx": 39 + } + ], + "medium": [ + { + "hash": "0x5d7babbb4dbd7c4991f16af99c914d19dd35b2f2c2f3d194390e345bc822f94c", + "blockNumber": 13006466, + "txIdx": 25 + }, + { + "hash": "0x4422fda5932ca17c96cf829443a603640a88d3443a9a983d75c4d4d2d5cd1f76", + "blockNumber": 13006274, + "txIdx": 12 + }, + { + "hash": "0x439be47fff1da4b04c8557888b873b4ccdd9ef2f7adb7773364cbebc9854f65d", + "blockNumber": 13006210, + "txIdx": 49 + }, + { + "hash": "0xbfc85fb9de31e71d7086200b848cebaec96fd80a99170658ab054b5c820b515e", + "blockNumber": 13006082, + "txIdx": 19 + }, + { + "hash": "0xe98ccc190f33ac798e3e7c82deba30acbd72b65bd5a23134e98a15c7061e25c6", + "blockNumber": 13005954, + "txIdx": 39 + }, + { + "hash": "0x70d782cbd5fc2cf6fa84d745eefdd64a4abaf64ea9607f22cdc23c8c9897a2f5", + "blockNumber": 13005954, + "txIdx": 57 + }, + { + "hash": "0x9a3fb5cc7c76a57f42cc5cc97e418cb3476890d15c68f36d1ed7d0c53d3ae7b2", + "blockNumber": 13005826, + "txIdx": 48 + }, + { + "hash": "0x6d10809f8f68ff06133bdc1eb9735c4a68b62f0560473163f3c6dd92874e3243", + "blockNumber": 13005762, + "txIdx": 11 + }, + { + "hash": "0x3e00321380b4b6135dcd2b1b5f1429a3b788b098ef5b883991abd21b3407a43e", + "blockNumber": 13005762, + "txIdx": 40 + }, + { + "hash": "0x88c84f0478bac3af98123b5dbdc726521f7ae0d70325f409f3963da3580ab1eb", + "blockNumber": 13005698, + "txIdx": 17 + }, + { + "hash": "0xbd02142e7cdbb2d0364163d482d7f52ef69b0d904e8a66c54d8863ba57768ad8", + "blockNumber": 13005698, + "txIdx": 20 + }, + { + "hash": "0x8afdc65e0b7f89073a654a497356c2f83ae4751977f7eec531eac65837f8ce17", + "blockNumber": 13005570, + "txIdx": 21 + }, + { + "hash": "0x08a03154d0a428093ffd92c062ef94d247f64d985d8d0e7fc9e4dcf2e556698d", + "blockNumber": 13005442, + "txIdx": 28 + }, + { + "hash": "0x3cc78aaab3a69a346ccec1c898403f07edf17d7d2170c03c953047adf35b3add", + "blockNumber": 13005314, + "txIdx": 22 + }, + { + "hash": "0x339e9f01c10582efcff22aedc2e70e5b4967dd3e989ae43f41aa048ea1ae2864", + "blockNumber": 13005186, + "txIdx": 19 + }, + { + "hash": "0x9ca28601fe815a73de80eef67001404a7e5dfacb204a39725cf992ee3ce69e01", + "blockNumber": 13005058, + "txIdx": 138 + }, + { + "hash": "0x4c225a42cb0fb2ff3d2b51039ae6966073b5c235b35b59cf926c5fee8f12892b", + "blockNumber": 13004738, + "txIdx": 47 + }, + { + "hash": "0x414e875dcc93c8a78807b8bc3a5cb541659eb3dfd1180180330f5035deb579eb", + "blockNumber": 13004674, + "txIdx": 25 + }, + { + "hash": "0x6d90589af72046081f712507e41a0c844e0c340cf0ac649b8e3f229412589d5b", + "blockNumber": 13004610, + "txIdx": 18 + }, + { + "hash": "0x3311e2d1986f8a91e0f7db89763602905cb3ad16fb6f0177702a97d595c86192", + "blockNumber": 13004546, + "txIdx": 33 + }, + { + "hash": "0x3334aa25a91401c760182340c6bad893b2f76644300291cfb2f99064a6ac6890", + "blockNumber": 13004482, + "txIdx": 1 + }, + { + "hash": "0xc866a02e189ba75db3f170af3b0d8440dc7b3fa64ee27e364a4ddd7fb6e0a190", + "blockNumber": 13004418, + "txIdx": 26 + }, + { + "hash": "0x09a551ab9f5d9ba6fc18253fa35c3db88caa0b0a51c87204fbc267bb9e596216", + "blockNumber": 13004354, + "txIdx": 46 + }, + { + "hash": "0x3c48da72e936356ac350ddc290185cb1d18718caf63121c8d3b27753d87fdba3", + "blockNumber": 13004226, + "txIdx": 38 + }, + { + "hash": "0x98f28183efb9943e7c6f18c45c1fb83c77c04bf50890129e4c9938c8c2ca03f0", + "blockNumber": 13003842, + "txIdx": 36 + }, + { + "hash": "0xb1967c2792d3bd8cc6dfa23b26416e0910e3595072c1d01a2966f3702b5e2c07", + "blockNumber": 13003842, + "txIdx": 41 + }, + { + "hash": "0xa5c8992c6f690e211b0bfca80266f16180736c8ff71ee959a9d06d66e371ac48", + "blockNumber": 13003778, + "txIdx": 25 + }, + { + "hash": "0x99ca7eed932e5f341bb1b3b0d6ae483acbf4504d8a0eceba38631042f66d3c70", + "blockNumber": 13003650, + "txIdx": 37 + }, + { + "hash": "0xd103c5d8f8f4f6e8ab0a8e94fe3af9959acf3757c37f509c99a160f7192c9490", + "blockNumber": 13003650, + "txIdx": 38 + }, + { + "hash": "0xc6b755ed182ff5beb75aa741a5bcc247cca154c6ebd56482c5a613d179e43156", + "blockNumber": 13003522, + "txIdx": 30 + }, + { + "hash": "0x07fdf25e4a8a7efab05691861711239dac9a87fc7c48b7441dddfd74320eede1", + "blockNumber": 13003458, + "txIdx": 17 + }, + { + "hash": "0x07dac4cc57c15e88ec53e3a314042ee313cd19a7bd0a00f21959e6935ced2c32", + "blockNumber": 13003458, + "txIdx": 36 + } + ], + "large": [ + { + "hash": "0xe6c3994aeb103d365f75e44c2774cb0f4d721e1ba8c5db909912bab0f77835c5", + "blockNumber": 13006428, + "txIdx": 4 + }, + { + "hash": "0x5901fc4ff0870dc58b029c1ac16156ed55b3f8fecc3e5a428cbecc07979add1c", + "blockNumber": 13006722, + "txIdx": 10 + }, + { + "hash": "0x8879965a2ef4a82d14e84dea67ef2061b62ab1a84438591cb82f1bc4357c4593", + "blockNumber": 13006594, + "txIdx": 11 + }, + { + "hash": "0xab6f3a2eec0901c534880581702a8d0cc24ba79f65b0b0279bb9268854117e31", + "blockNumber": 13006338, + "txIdx": 27 + }, + { + "hash": "0x2bb8cbfc36944a4ffea18a381b4519e6a7c2b807609ccdeab565fc66481ffe53", + "blockNumber": 13006274, + "txIdx": 28 + }, + { + "hash": "0x58e3f31ecb7d421fafa4e6748801cd948cead20ac8721473f357a15a5236cf46", + "blockNumber": 13006146, + "txIdx": 14 + }, + { + "hash": "0xcbd5e8f47c2f18c6dfc903b663c54adcb16bea5a997533eaa1df1e08aaa80ee6", + "blockNumber": 13005762, + "txIdx": 15 + }, + { + "hash": "0x467c379b011001b9aec2e660af94e7830d8e868b7b838ae44afa01a97fd181ab", + "blockNumber": 13005442, + "txIdx": 14 + }, + { + "hash": "0x2a1af22199c6716a3f02f027e6ff2ff767d9ba7cd54a70407d616937b19080b4", + "blockNumber": 13005378, + "txIdx": 7 + }, + { + "hash": "0xacb3420c88e929d94abadac22a9f9af55a2f5e76c37aef94e1a7ddb044a3c127", + "blockNumber": 13005186, + "txIdx": 9 + }, + { + "hash": "0xb47939373c35c3fc4dab2ed0ad35a374c8505db409db6ab693d1276fc7110b88", + "blockNumber": 13005122, + "txIdx": 14 + }, + { + "hash": "0x23b3289367990aaf6cdb04ea03fa51a2b75099a8341e79f647b38dbafb36e7d0", + "blockNumber": 13005058, + "txIdx": 7 + }, + { + "hash": "0xfd891beb7ef0bf4b0b9e4d12378ba38ac418ebef86f60fb7cdd6bf977396268f", + "blockNumber": 13005058, + "txIdx": 51 + }, + { + "hash": "0x416fcda8425b3e656187e49421b24784da608798c3514ae9ca0667731f709ff4", + "blockNumber": 13004994, + "txIdx": 51 + }, + { + "hash": "0xddc54204854ee407304b1625206e7b419a025dca9b009b46bcfa1c9564a34298", + "blockNumber": 13004930, + "txIdx": 5 + }, + { + "hash": "0xd332cd47f2a5e03a99b09827478df94f7c37c3a3a83944da6516fe1ea8bbf2b2", + "blockNumber": 13004930, + "txIdx": 30 + }, + { + "hash": "0xc16d70c09cca5dc41cba2eb0ad562436cdb8e631479d673aa288d2dc6aaa3269", + "blockNumber": 13004866, + "txIdx": 23 + }, + { + "hash": "0x6ab53229d7fce1f3602ba86ab2f605bff748e55c0900ecc8244e140f05672cdf", + "blockNumber": 13004802, + "txIdx": 6 + }, + { + "hash": "0x237adb2703987294541e51e416df765fa929360c915b88470370bd7238fc4b5b", + "blockNumber": 13004738, + "txIdx": 35 + }, + { + "hash": "0x5db294dd818d0228934ac37db96ae90f35e4befc79928eef2e04addff313526f", + "blockNumber": 13004674, + "txIdx": 3 + }, + { + "hash": "0x7bb820cf754be2a6a77cea8ed72be259dd60ad6500077299d6a6d4bd8130ecd7", + "blockNumber": 13004354, + "txIdx": 23 + }, + { + "hash": "0x1a06c5654fae0425a4678b8b550a9d7239be9e389909e3be4a15e610894e195b", + "blockNumber": 13004290, + "txIdx": 23 + }, + { + "hash": "0xaa0e8bae3a38b96dbd70946d72d433f84a8415359d5376a7343c693f68527e19", + "blockNumber": 13004162, + "txIdx": 25 + }, + { + "hash": "0xecd33dbadc8c3fb5d14c22c1c33a91965919c31d711b834a81312f82ea8bb960", + "blockNumber": 13004098, + "txIdx": 28 + }, + { + "hash": "0x267913cb9b2f97565330654c20df05ab23a6e3f54b1c2593ab5896df8de04943", + "blockNumber": 13003970, + "txIdx": 22 + }, + { + "hash": "0x865485b37abb0fb719aa8f8bf680b1b32ffb8b9699df7460a6ae1ba2dfe3a812", + "blockNumber": 13003778, + "txIdx": 11 + }, + { + "hash": "0x9a3b21f036132c0c7c41c943ac9aae9acd1a68df4faa184982d1fb0680337a67", + "blockNumber": 13003330, + "txIdx": 16 + }, + { + "hash": "0xf52772b506e1f62bb358e0faca7b372ec9cbc49f201949cb90a2a05697c67029", + "blockNumber": 13003202, + "txIdx": 13 + }, + { + "hash": "0xe818044c5eed0a2d3569602492c31392198ed06f8f31e75651cc7f991dd3b9a6", + "blockNumber": 13002882, + "txIdx": 8 + }, + { + "hash": "0xda5a48889aa41a56bea368b530a75bb9f6962e20aab1750ecbcf482964c55516", + "blockNumber": 13002818, + "txIdx": 7 + }, + { + "hash": "0xefb66309ad7446604e0c8073f5f1cce9eabd687486e2b9a983fbc086b683b2ec", + "blockNumber": 13002690, + "txIdx": 18 + }, + { + "hash": "0x4f555d6552d612a73d84f246162bf70318a28cb4292eab49a70e7ac75e00e0bb", + "blockNumber": 13002434, + "txIdx": 24 + } + ], + "max": [ + { + "hash": "0x1454f2c6684f662c8396fa38869ba4c20cb8d2f59a6ac442176f614b2995ba7f", + "blockNumber": 13006428, + "txIdx": 5 + }, + { + "hash": "0x4474d7818ec14e0f0c78c5ed271e3544338d1c7242753dada189523b31a88a2d", + "blockNumber": 13005634, + "txIdx": 44 + }, + { + "hash": "0x0436874fb318c9851a9675660bb723f0e7e16b1ad65ba070544c90b1d73674a1", + "blockNumber": 13004546, + "txIdx": 41 + }, + { + "hash": "0x90d649b705c2c2205c64c7b6b56650b2f0114fcb13c4ed2bc6e64ab196e95194", + "blockNumber": 13003330, + "txIdx": 20 + }, + { + "hash": "0xd11fc15882205397ce42020770a5281b818c2fb625a207425904d3e3d01e9f81", + "blockNumber": 13002562, + "txIdx": 26 + }, + { + "hash": "0xc795f60b02b19beec6a925ca539115964739e534934af149680e2a8644279ef2", + "blockNumber": 13001474, + "txIdx": 26 + }, + { + "hash": "0xda174d3c29370acfaa1bef00f83e22b04434a184b3929e498bf6ed51a5fc3dec", + "blockNumber": 12999938, + "txIdx": 30 + }, + { + "hash": "0x299112d1b10bfe608b93d1fee3962500877f7e32b71f782cec2ce7f1084d72cc", + "blockNumber": 12999810, + "txIdx": 52 + }, + { + "hash": "0x062a300a34828043a786ea865ab77578c557b4801c9d78677afb7c9a107f2c4c", + "blockNumber": 12999618, + "txIdx": 39 + } + ], + "oversize": [ + { + "hash": "0xcfa53530c9f7e7fd276b68f7e588322d72e8df2741e99a9d7abdc37ee3b18beb", + "blockNumber": 13006338, + "txIdx": 79 + }, + { + "hash": "0x80310132384198bea49366fb99fc6f841a13b2f0c327940d37fc6f6b193b2c6f", + "blockNumber": 13005122, + "txIdx": 23 + }, + { + "hash": "0x1f7ec6ac92fb3d1f440b690f0c5a0f42c855c20c2ba21cf9d4e87013599734fc", + "blockNumber": 13004290, + "txIdx": 17 + }, + { + "hash": "0xaf662d6551f01f0531d7d76e349bbffc8aa5b89cd59c584b044b95193f140a6d", + "blockNumber": 13002882, + "txIdx": 13 + }, + { + "hash": "0xaa96fd4fda2933e681b3c0f41bcb1a43652b8b36dc6840d0c7cae4d33493a1aa", + "blockNumber": 13002882, + "txIdx": 32 + }, + { + "hash": "0x685bdd82cfc15364507b7af7dcf59d4aeb22241dd26f86e91d664b2432249a41", + "blockNumber": 13001538, + "txIdx": 26 + }, + { + "hash": "0xf647fe79f3d7aca30e571cef5e6e13f0c2e9c9a18cdb95f6779f9c37f2ccf7d6", + "blockNumber": 13000898, + "txIdx": 4 + }, + { + "hash": "0xd7e670da148ec0f5ff5d4e9e5b14ab93612322bae14a9d1bce5d20682172805d", + "blockNumber": 13000386, + "txIdx": 40 + }, + { + "hash": "0xf8ca5d353a1ed55d41667ac0b2fa45e8a6b9c593e77f48443f3589808fb7c7fc", + "blockNumber": 13000066, + "txIdx": 26 + }, + { + "hash": "0xbe9d3fe6494d73754684a51820af08bf66a436b7008b7600cd64fa15bf084233", + "blockNumber": 12998978, + "txIdx": 41 + } + ] + } + } +} \ No newline at end of file diff --git a/client/test/chainData/84532.json b/client/test/chainData/84532.json new file mode 100644 index 00000000..a247df36 --- /dev/null +++ b/client/test/chainData/84532.json @@ -0,0 +1,1688 @@ +{ + "chainId": "84532", + "blockRange": { + "start": 8285121, + "end": 8411460 + }, + "blockSamples": 128, + "blockInterval": 64, + "account": { + "eoa": [ + { + "blockNumber": 8285121, + "address": "0xe76a90e3069c9d86e666dcc687e76fcecf4429cf" + }, + { + "blockNumber": 8411460, + "address": "0xba974928b5fa5aabcf2c6a9ad19ab05e5ce21c50" + }, + { + "blockNumber": 8411460, + "address": "0x96da0b6fc6c00e39f2a85d9ab0f36050c0c0b9fa" + }, + { + "blockNumber": 8411396, + "address": "0xe3f28530e5e977daf278735a34fdc76582b7c70a" + }, + { + "blockNumber": 8411396, + "address": "0xb582ddd13f2c58e692b06efa44fd7a36bb45257e" + }, + { + "blockNumber": 8411332, + "address": "0x73fc34ac01d9995247746f18466a4435459956cf" + }, + { + "blockNumber": 8411268, + "address": "0xdd20ca6c15e10e129b5edb89c181d356b493e318" + }, + { + "blockNumber": 8411204, + "address": "0x1eea3b7c68240596bbde880a82344b45f87a860c" + }, + { + "blockNumber": 8411076, + "address": "0xdc2323660d2c2b03769c0d3831a4399fc67e6d6f" + }, + { + "blockNumber": 8411076, + "address": "0x0ed9fdf230a4030b86bca600e2eeabee7057aa4b" + }, + { + "blockNumber": 8411012, + "address": "0xc5892b5639e7e04d094acebe6f756088ad53b657" + }, + { + "blockNumber": 8410884, + "address": "0x30403792e3f8ea0aef6753aef86c54e5dd83849c" + }, + { + "blockNumber": 8410820, + "address": "0x11fcee5a5bf2cb797998eca74453a70f45afb25c" + }, + { + "blockNumber": 8410820, + "address": "0x3b9b1fcdf8f3fe6720b05292a439369e2d195316" + }, + { + "blockNumber": 8410756, + "address": "0xd53eb5203e367bbdd4f72338938224881fc501ab" + }, + { + "blockNumber": 8410692, + "address": "0x78b5ec48629b2e24ac486e469172f704634647d0" + }, + { + "blockNumber": 8410628, + "address": "0x987a45873add2eced1199520bf0a0e7990d90832" + }, + { + "blockNumber": 8410628, + "address": "0x766fe03fadd1c839e1e90140f373ce34448fc405" + }, + { + "blockNumber": 8410564, + "address": "0x1666b63c44b734053889c8ff941c25b9933e65a3" + }, + { + "blockNumber": 8410500, + "address": "0xd53eb5203e367bbdd4f72338938224881fc501ab" + }, + { + "blockNumber": 8410436, + "address": "0xc5892b5639e7e04d094acebe6f756088ad53b657" + }, + { + "blockNumber": 8410308, + "address": "0xd53eb5203e367bbdd4f72338938224881fc501ab" + }, + { + "blockNumber": 8410244, + "address": "0x79a0fef0c227792a6c0702505ec017da2cc052ce" + }, + { + "blockNumber": 8410116, + "address": "0xd53eb5203e367bbdd4f72338938224881fc501ab" + }, + { + "blockNumber": 8409988, + "address": "0x791c7499ebdb775b0780eaa87f3e022adb20b594" + }, + { + "blockNumber": 8409860, + "address": "0x9a8ebfba816641fa47241e38c6038fb13a804dbc" + }, + { + "blockNumber": 8409668, + "address": "0xb07add166dc6f4f1858e161d33d6fea994bc0686" + }, + { + "blockNumber": 8409668, + "address": "0x1cec0875a45571034515613e525bd5c1e8c4975f" + }, + { + "blockNumber": 8409604, + "address": "0x3ccf39f73f7cdd121ddcb34ff36b1d673ca8da25" + }, + { + "blockNumber": 8409540, + "address": "0x73691d38dd985ab59a5041e0870fa5fd10549a37" + }, + { + "blockNumber": 8409412, + "address": "0x106657538ee4890c7be3622f3c627a86da1a1972" + }, + { + "blockNumber": 8409348, + "address": "0x771d78ecd8ade3a7a672331de9af6f28aefbe236" + } + ], + "contract": [ + { + "blockNumber": 8411204, + "address": "0x67dd9c63eb18e4a7dfacd5af67802b1cd11d4f0e" + }, + { + "blockNumber": 8410884, + "address": "0x94cc0aac535ccdb3c01d6787d6413c739ae12bc4" + }, + { + "blockNumber": 8410756, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8410692, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967" + }, + { + "blockNumber": 8410564, + "address": "0x94cc0aac535ccdb3c01d6787d6413c739ae12bc4" + }, + { + "blockNumber": 8410500, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8410308, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8410244, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967" + }, + { + "blockNumber": 8410116, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8409988, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967" + }, + { + "blockNumber": 8409540, + "address": "0x5911cdc73325d3fb3208b8d93ff44e0cfc3dc438" + }, + { + "blockNumber": 8409412, + "address": "0x916a6314e9d8e51beb18b355ad52b4506262620f" + }, + { + "blockNumber": 8409348, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967" + }, + { + "blockNumber": 8409284, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8409220, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8409156, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8409092, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8408900, + "address": "0x5911cdc73325d3fb3208b8d93ff44e0cfc3dc438" + }, + { + "blockNumber": 8408708, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8408644, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8408580, + "address": "0x23565f3acf64455d5611c37d0f5463de6fe55328" + }, + { + "blockNumber": 8408452, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8408324, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8408132, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8408004, + "address": "0xed8de012e6328bb2cd18c7a539be08da1319b711" + }, + { + "blockNumber": 8407940, + "address": "0x94cc0aac535ccdb3c01d6787d6413c739ae12bc4" + }, + { + "blockNumber": 8407812, + "address": "0xad91214effee446500940c764df77af18427294f" + }, + { + "blockNumber": 8407556, + "address": "0x5911cdc73325d3fb3208b8d93ff44e0cfc3dc438" + }, + { + "blockNumber": 8407428, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8407300, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967" + }, + { + "blockNumber": 8407236, + "address": "0xfee7c8e229f538a98437b9a7d0dd8fcd8a1ab569" + }, + { + "blockNumber": 8407108, + "address": "0x2bdcdaca8838ee2400a2a49ded36340a9fbe408d" + } + ] + }, + "storage": { + "nonzero": [ + { + "blockNumber": 8285121, + "address": "0xde8d0f47a71ea3fdfbd3162271652f2847939097", + "slot": 3 + }, + { + "blockNumber": 8411460, + "address": "0x4c07eac4b12259845faf2a274d5eaef8fb9a2578", + "slot": 0 + }, + { + "blockNumber": 8411268, + "address": "0xb031f5f56639147c8f45dd546c58ea5db23901ac", + "slot": 10 + }, + { + "blockNumber": 8411204, + "address": "0x17c56e645329a4481aa9b32c3fc7bc28515c4d3e", + "slot": 0 + }, + { + "blockNumber": 8410948, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789", + "slot": 2 + }, + { + "blockNumber": 8410884, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967", + "slot": 10 + }, + { + "blockNumber": 8410500, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967", + "slot": 3 + }, + { + "blockNumber": 8410244, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967", + "slot": 10 + }, + { + "blockNumber": 8410116, + "address": "0xfb7a1fcc9a4447ec738bde137f28080caa4d7440", + "slot": 0 + }, + { + "blockNumber": 8409732, + "address": "0x5dccee0b347c9e4a316f78a59d40ed79bd965789", + "slot": 0 + }, + { + "blockNumber": 8409604, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789", + "slot": 2 + }, + { + "blockNumber": 8409540, + "address": "0x5911cdc73325d3fb3208b8d93ff44e0cfc3dc438", + "slot": 1 + }, + { + "blockNumber": 8409476, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789", + "slot": 2 + }, + { + "blockNumber": 8409412, + "address": "0x916a6314e9d8e51beb18b355ad52b4506262620f", + "slot": 0 + }, + { + "blockNumber": 8409156, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789", + "slot": 2 + }, + { + "blockNumber": 8409028, + "address": "0x5911cdc73325d3fb3208b8d93ff44e0cfc3dc438", + "slot": 1 + }, + { + "blockNumber": 8408196, + "address": "0xfee7c8e229f538a98437b9a7d0dd8fcd8a1ab569", + "slot": 4 + }, + { + "blockNumber": 8408132, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967", + "slot": 10 + }, + { + "blockNumber": 8408068, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789", + "slot": 2 + }, + { + "blockNumber": 8407300, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967", + "slot": 3 + }, + { + "blockNumber": 8407236, + "address": "0xfee7c8e229f538a98437b9a7d0dd8fcd8a1ab569", + "slot": 8 + }, + { + "blockNumber": 8407172, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967", + "slot": 10 + }, + { + "blockNumber": 8407044, + "address": "0xead908e40cc5f14ed2e1e9beb913a9c5846f4464", + "slot": 3 + }, + { + "blockNumber": 8406788, + "address": "0xb77eb4b4862dca31212555e25f8b5729b346e78a", + "slot": 2 + }, + { + "blockNumber": 8406724, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967", + "slot": 10 + }, + { + "blockNumber": 8406660, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967", + "slot": 3 + }, + { + "blockNumber": 8406596, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967", + "slot": 10 + }, + { + "blockNumber": 8406404, + "address": "0x5911cdc73325d3fb3208b8d93ff44e0cfc3dc438", + "slot": 1 + }, + { + "blockNumber": 8406276, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967", + "slot": 4 + }, + { + "blockNumber": 8406148, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789", + "slot": 2 + }, + { + "blockNumber": 8406084, + "address": "0xf01c4cdb85f5b3c18f9cfeddb1eeb75950439d63", + "slot": 2 + }, + { + "blockNumber": 8405892, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967", + "slot": 2 + } + ] + }, + "tx": { + "type": { + "0": [ + { + "hash": "0xc80b02f1ea20373a2e6d12f62f29fe4a00c96b4b689291376f527b17dd9ca714", + "blockNumber": 8410884, + "txIdx": 5 + }, + { + "hash": "0x13b728215ba8f1e709cb6313848ba60c976b9f2aeaad433316c8e1b6ade6791e", + "blockNumber": 8410628, + "txIdx": 2 + }, + { + "hash": "0xfbb24949b9cd50928240515e70a7b07f026cc7bcbb2d87a2cbf5db4a6a16c3c8", + "blockNumber": 8410052, + "txIdx": 2 + }, + { + "hash": "0xf159a94561db90e0b0438bd473ad3514906b9d522d555f054c7e4ddcd341f4bb", + "blockNumber": 8409412, + "txIdx": 6 + }, + { + "hash": "0xb3155b9a0cefc112f99e74391ff8c36aa9ab731ba36a01a0562455616a315cae", + "blockNumber": 8409412, + "txIdx": 8 + }, + { + "hash": "0xfdff53ee1ffa01d489c35ba38a7023ae180cc9a68bffde1d17341d653ddef291", + "blockNumber": 8409156, + "txIdx": 1 + }, + { + "hash": "0xf9b4632ca83b155fa07afc4ed85c31e1ecd6c5732b2c844c56b1208d37997f88", + "blockNumber": 8408772, + "txIdx": 2 + }, + { + "hash": "0x934194f70872b06051da1523ecbad3f1d23e2659b533ccfa334bf639be48f8f7", + "blockNumber": 8408068, + "txIdx": 17 + }, + { + "hash": "0xe8d21fc30d59b11a761391fb1fe50cc8d3f4cb7459395ebb7e1bc63413b9906f", + "blockNumber": 8407684, + "txIdx": 1 + }, + { + "hash": "0xb39c4eb437415c38d05c364afe80ea832c0db34d744a3326c1cff2d2dfcb57a8", + "blockNumber": 8407620, + "txIdx": 1 + }, + { + "hash": "0xeea485fbac3342408c9f4c592a14f536a79fae124e218a1e975eab0a74559c43", + "blockNumber": 8407620, + "txIdx": 2 + }, + { + "hash": "0x25c1091a2a976f68cfdda31957e66d8e39fa1274ace2b271ac8b123356ee3452", + "blockNumber": 8407172, + "txIdx": 7 + }, + { + "hash": "0x4fb1e82e9c8b1f6b730d6331d70476a1ba083e96cd3a49ae321c5e37105914e9", + "blockNumber": 8406788, + "txIdx": 7 + }, + { + "hash": "0x72b6b9e9c915eeeab4dfb2aee47a5aa3104f7200ee2e7a26433ad174ec9b0f2f", + "blockNumber": 8406532, + "txIdx": 4 + }, + { + "hash": "0x353ac206d808ccddd3264674e0c271334df0ea5ecc58f527043eb4561893a29b", + "blockNumber": 8406468, + "txIdx": 2 + }, + { + "hash": "0x922bad5bcb87eaa487325652647a46d6193ee847fb6413182ea17098294686c9", + "blockNumber": 8404676, + "txIdx": 3 + }, + { + "hash": "0x4888c7b7aed7d0bec69c43e841a35db2ef939257d63ad88012ae71d62f548653", + "blockNumber": 8404612, + "txIdx": 2 + }, + { + "hash": "0xf458ddebbd3a70f03fe30abc09f79bbe545c90af2af17b996f3d32e8a6cb1373", + "blockNumber": 8404356, + "txIdx": 3 + }, + { + "hash": "0x0b02fb591b378c3dc4f6b81be4d0122bb4d1cb9c736181b7564102973ffadc4a", + "blockNumber": 8403588, + "txIdx": 5 + } + ], + "1": [], + "2": [ + { + "hash": "0x7968dd03dac8d40f553194e3f8108654b7951a202afd4d9a8a5d73b9f79294b7", + "blockNumber": 8285121, + "txIdx": 1 + }, + { + "hash": "0x60e9f7675c3211e087ce719df5c6cd8d3a2c6f674093340fed3011f23321eea7", + "blockNumber": 8285121, + "txIdx": 2 + }, + { + "hash": "0x12209669f865c52d9566e3e261ad551eb5b81f1ddedffedfee7851cf3ca1f6af", + "blockNumber": 8285121, + "txIdx": 3 + }, + { + "hash": "0x02b960acc295fe8eaafce8987a35ffd9eba2b1df998892616d4f6b2f7c484bc5", + "blockNumber": 8285121, + "txIdx": 4 + }, + { + "hash": "0x590e0cbfd569dd700eff450f23b0cc982749f04878c3c90e8ef13af883216ada", + "blockNumber": 8285121, + "txIdx": 5 + }, + { + "hash": "0x78cf2fce981580be349dd9ecb0c18a59a190007a54e920cb475b63bb74081d64", + "blockNumber": 8285121, + "txIdx": 6 + }, + { + "hash": "0xf31896dafeeb0e42928994c25cb8902fd3eb2fd91884e2291fc1861fb0706f5b", + "blockNumber": 8285121, + "txIdx": 7 + }, + { + "hash": "0x7a3e38153c76ad881d0da708648969da14a44a1122397e415a7a334893d4001a", + "blockNumber": 8285121, + "txIdx": 8 + }, + { + "hash": "0xdc00cefcca51c91078099db6b9bda4aa7f8028705dd025f647607bb8ce8107bd", + "blockNumber": 8285121, + "txIdx": 9 + }, + { + "hash": "0xa07d2369ff0df1efc0df56be64d4f5f06040c85d9a794e0cdf8c1dea4c644e84", + "blockNumber": 8285121, + "txIdx": 10 + }, + { + "hash": "0x050953c898902a4af5d69e46b4881d7adbc70b0e2a5e1f5515ede60021e7c5f7", + "blockNumber": 8285121, + "txIdx": 11 + }, + { + "hash": "0x65149631d19fd546b872f089b63f84b37fe0d1ee4a37a35a807a08164b53b0e8", + "blockNumber": 8285121, + "txIdx": 12 + }, + { + "hash": "0x6994bdf13e7ecd0508c2179f12e8e1e72a2be92884c96bda3a49eb8aff5f1ee9", + "blockNumber": 8285121, + "txIdx": 13 + }, + { + "hash": "0xaa325ee442e3c7f82f89b4551b4537d08f042194c432850728f71d203a4a60fe", + "blockNumber": 8411460, + "txIdx": 1 + }, + { + "hash": "0x779a430bd4c7c98286bfb7bd9c7d88e0c701478805184eed100590d0e312edec", + "blockNumber": 8411460, + "txIdx": 2 + }, + { + "hash": "0xe0d49aa43a2e3fc3eb23d80516a765ae729befd118cc239f033d55ea5743e666", + "blockNumber": 8411460, + "txIdx": 3 + }, + { + "hash": "0xc4d2cf105d53547d604c28330303de52f2e0af2ba302b95a706da6defa203100", + "blockNumber": 8411460, + "txIdx": 4 + }, + { + "hash": "0x372910da9fedd710f1463b248c6b464ff929e5e7f8adfcac826e3ae5a5238cad", + "blockNumber": 8411460, + "txIdx": 5 + }, + { + "hash": "0x7af88fbb69cd0f8ce21c098bb47703ca754a6319d96584fbd17847647e1aea34", + "blockNumber": 8411460, + "txIdx": 6 + }, + { + "hash": "0xcbf64325aec722fd712cb9999230e01d93b06d7d918b59e27dc75d5768ce3233", + "blockNumber": 8411460, + "txIdx": 7 + }, + { + "hash": "0x271eb60e5035caefb8e3467c8254810e51b5f046075b9a011841c1363d85b57e", + "blockNumber": 8411460, + "txIdx": 8 + }, + { + "hash": "0x542ad4342f048b37efb23468faf6e990ea852ea4d5bd393b0f85ffcf464a5f9c", + "blockNumber": 8411460, + "txIdx": 9 + }, + { + "hash": "0xee02a2bef054900155e12515caa1b7ac9da2bb7c822225778546991bac2e0f42", + "blockNumber": 8411460, + "txIdx": 10 + }, + { + "hash": "0x8e883b8b03ccd5725506d3cfa1062f1dff7b367a701101581798d60a32a5f975", + "blockNumber": 8411460, + "txIdx": 11 + }, + { + "hash": "0x40263bf297637647f871fe6d9f40b9b02557971c68ff74f43cf2041e5df7d8a8", + "blockNumber": 8411460, + "txIdx": 12 + }, + { + "hash": "0x4675165ef6bc0d63547d5460229cf57a2be4fdc55ac58f61a8c414f41a46ff1c", + "blockNumber": 8411460, + "txIdx": 13 + }, + { + "hash": "0x5f51ff8b88691db75d983025f4b73f8adb77ab8aaef83d377fd00cd6a1e98b48", + "blockNumber": 8411460, + "txIdx": 14 + }, + { + "hash": "0x31c27f5b692607274010195b982ac561323f85d991fbda99ebf2171815bce092", + "blockNumber": 8411460, + "txIdx": 15 + }, + { + "hash": "0xb93ca94afa7cffaeb21e3f799c8a58d9f9ab7cf0cd738dcab50086211458d5db", + "blockNumber": 8411396, + "txIdx": 1 + }, + { + "hash": "0x905da2905ec4a55955522beffc054b489d9d42a56ef93123a5a5c94fd48b52dd", + "blockNumber": 8411396, + "txIdx": 2 + }, + { + "hash": "0xf10e116f5168d9365f1761bca31df65f2bcec597452aa666b736ca633ed9ff61", + "blockNumber": 8411396, + "txIdx": 3 + }, + { + "hash": "0x7533d40da23a43504af7c94800ddc54705668fd4f7046009923f898491e640f6", + "blockNumber": 8411396, + "txIdx": 4 + } + ], + "3": [] + }, + "category": { + "default": [ + { + "hash": "0x7968dd03dac8d40f553194e3f8108654b7951a202afd4d9a8a5d73b9f79294b7", + "blockNumber": 8285121, + "txIdx": 1 + }, + { + "hash": "0x02b960acc295fe8eaafce8987a35ffd9eba2b1df998892616d4f6b2f7c484bc5", + "blockNumber": 8285121, + "txIdx": 4 + }, + { + "hash": "0x590e0cbfd569dd700eff450f23b0cc982749f04878c3c90e8ef13af883216ada", + "blockNumber": 8285121, + "txIdx": 5 + }, + { + "hash": "0xf31896dafeeb0e42928994c25cb8902fd3eb2fd91884e2291fc1861fb0706f5b", + "blockNumber": 8285121, + "txIdx": 7 + }, + { + "hash": "0x7a3e38153c76ad881d0da708648969da14a44a1122397e415a7a334893d4001a", + "blockNumber": 8285121, + "txIdx": 8 + }, + { + "hash": "0xdc00cefcca51c91078099db6b9bda4aa7f8028705dd025f647607bb8ce8107bd", + "blockNumber": 8285121, + "txIdx": 9 + }, + { + "hash": "0xa07d2369ff0df1efc0df56be64d4f5f06040c85d9a794e0cdf8c1dea4c644e84", + "blockNumber": 8285121, + "txIdx": 10 + }, + { + "hash": "0x050953c898902a4af5d69e46b4881d7adbc70b0e2a5e1f5515ede60021e7c5f7", + "blockNumber": 8285121, + "txIdx": 11 + }, + { + "hash": "0x65149631d19fd546b872f089b63f84b37fe0d1ee4a37a35a807a08164b53b0e8", + "blockNumber": 8285121, + "txIdx": 12 + }, + { + "hash": "0x6994bdf13e7ecd0508c2179f12e8e1e72a2be92884c96bda3a49eb8aff5f1ee9", + "blockNumber": 8285121, + "txIdx": 13 + }, + { + "hash": "0xaa325ee442e3c7f82f89b4551b4537d08f042194c432850728f71d203a4a60fe", + "blockNumber": 8411460, + "txIdx": 1 + }, + { + "hash": "0x779a430bd4c7c98286bfb7bd9c7d88e0c701478805184eed100590d0e312edec", + "blockNumber": 8411460, + "txIdx": 2 + }, + { + "hash": "0xe0d49aa43a2e3fc3eb23d80516a765ae729befd118cc239f033d55ea5743e666", + "blockNumber": 8411460, + "txIdx": 3 + }, + { + "hash": "0xc4d2cf105d53547d604c28330303de52f2e0af2ba302b95a706da6defa203100", + "blockNumber": 8411460, + "txIdx": 4 + }, + { + "hash": "0x372910da9fedd710f1463b248c6b464ff929e5e7f8adfcac826e3ae5a5238cad", + "blockNumber": 8411460, + "txIdx": 5 + }, + { + "hash": "0x7af88fbb69cd0f8ce21c098bb47703ca754a6319d96584fbd17847647e1aea34", + "blockNumber": 8411460, + "txIdx": 6 + }, + { + "hash": "0xcbf64325aec722fd712cb9999230e01d93b06d7d918b59e27dc75d5768ce3233", + "blockNumber": 8411460, + "txIdx": 7 + }, + { + "hash": "0x271eb60e5035caefb8e3467c8254810e51b5f046075b9a011841c1363d85b57e", + "blockNumber": 8411460, + "txIdx": 8 + }, + { + "hash": "0x542ad4342f048b37efb23468faf6e990ea852ea4d5bd393b0f85ffcf464a5f9c", + "blockNumber": 8411460, + "txIdx": 9 + }, + { + "hash": "0xee02a2bef054900155e12515caa1b7ac9da2bb7c822225778546991bac2e0f42", + "blockNumber": 8411460, + "txIdx": 10 + }, + { + "hash": "0x8e883b8b03ccd5725506d3cfa1062f1dff7b367a701101581798d60a32a5f975", + "blockNumber": 8411460, + "txIdx": 11 + }, + { + "hash": "0x40263bf297637647f871fe6d9f40b9b02557971c68ff74f43cf2041e5df7d8a8", + "blockNumber": 8411460, + "txIdx": 12 + }, + { + "hash": "0x4675165ef6bc0d63547d5460229cf57a2be4fdc55ac58f61a8c414f41a46ff1c", + "blockNumber": 8411460, + "txIdx": 13 + }, + { + "hash": "0x5f51ff8b88691db75d983025f4b73f8adb77ab8aaef83d377fd00cd6a1e98b48", + "blockNumber": 8411460, + "txIdx": 14 + }, + { + "hash": "0x31c27f5b692607274010195b982ac561323f85d991fbda99ebf2171815bce092", + "blockNumber": 8411460, + "txIdx": 15 + }, + { + "hash": "0xb93ca94afa7cffaeb21e3f799c8a58d9f9ab7cf0cd738dcab50086211458d5db", + "blockNumber": 8411396, + "txIdx": 1 + }, + { + "hash": "0x905da2905ec4a55955522beffc054b489d9d42a56ef93123a5a5c94fd48b52dd", + "blockNumber": 8411396, + "txIdx": 2 + }, + { + "hash": "0xf10e116f5168d9365f1761bca31df65f2bcec597452aa666b736ca633ed9ff61", + "blockNumber": 8411396, + "txIdx": 3 + }, + { + "hash": "0x7533d40da23a43504af7c94800ddc54705668fd4f7046009923f898491e640f6", + "blockNumber": 8411396, + "txIdx": 4 + }, + { + "hash": "0x0b35d1e97a426a68520be4f5f0169347b9ae4cb754cf659e0935eb0ba9492f01", + "blockNumber": 8411396, + "txIdx": 5 + }, + { + "hash": "0x71d5588c5f474db0d3ef761cb8a1b5a32632d00d5ebd7a6ec96c3b5dd041a8ab", + "blockNumber": 8411396, + "txIdx": 6 + }, + { + "hash": "0x08c0c7970dba7ea90f910f0bbd33a6fe5bd387463c3da8665bdd126675fc1792", + "blockNumber": 8411332, + "txIdx": 1 + } + ], + "large": [ + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2 + }, + { + "hash": "0x5fb3c50a81953581658b79e2856b73f58648da666adaa84eff4afba7a949cb68", + "blockNumber": 8411268, + "txIdx": 4 + }, + { + "hash": "0x53ef2000baf21e5d40eb2bbe4a0cdefab0d087794052fc5ee79e37a71633d2b4", + "blockNumber": 8411140, + "txIdx": 4 + }, + { + "hash": "0x4ed454b9ba18f8bc4e74b70d31357753a082a5092de736f2efe73e43ef2ea6c3", + "blockNumber": 8410884, + "txIdx": 8 + }, + { + "hash": "0x7c3b1eece29e1a581a115571b3679b63d37308801990f4fb6b9f15111d47ae1c", + "blockNumber": 8410372, + "txIdx": 2 + }, + { + "hash": "0x274d5ecfc9e474cc7dc62971eddff6e66690fe4f866ba1dab85045b4c4331ec2", + "blockNumber": 8409988, + "txIdx": 7 + }, + { + "hash": "0xf0bb2877d9ddfa0fdb7e404a09b76a081ad1ec1797077fb4b05062509ddb59f3", + "blockNumber": 8409924, + "txIdx": 3 + }, + { + "hash": "0x058cda17022e8d27fe9cdc63748566f8b75a1261c04ecc73f83928d45931bfc1", + "blockNumber": 8409732, + "txIdx": 5 + }, + { + "hash": "0x292c2e380b83c3185982d010da100b32f4cb184b2e8ae82ad6e6becfdfbbd202", + "blockNumber": 8409668, + "txIdx": 5 + }, + { + "hash": "0xb4ccbe851bb76af1a5d4a9db4269e2f50b144d3c580794f9278f85e86825f9c2", + "blockNumber": 8409412, + "txIdx": 9 + }, + { + "hash": "0xcc2fedff27e726d4af40f31db1d63b638c715fef4457ba9299e15cd165038035", + "blockNumber": 8409348, + "txIdx": 3 + }, + { + "hash": "0x1dcdc7fb35fc8798f172e676e8f18b95022587a2984fcc7a9803d08fd78212c7", + "blockNumber": 8409220, + "txIdx": 3 + }, + { + "hash": "0xe3b639e75fa11e6d088ccf14383096841ffbbc206578b1bc9d0d89ef749cd7dc", + "blockNumber": 8408900, + "txIdx": 4 + }, + { + "hash": "0x749df4d3c9f558b81d564becbdefba7670ba8fd180758d5f41dd4963ff3e2471", + "blockNumber": 8408836, + "txIdx": 10 + }, + { + "hash": "0x381a1370ffb1403372462e105abcce7528be08e4769d5024c3a3044b358121bb", + "blockNumber": 8408580, + "txIdx": 5 + }, + { + "hash": "0xa32c4f636480748d97bbe57523e94d08ae72a0f895c15ac2123e4de6152d3fb0", + "blockNumber": 8408516, + "txIdx": 3 + }, + { + "hash": "0xdb04c9f9e93c3ad4616a1a93d769276fe9c8a000a0afe77bc37dc052a6faf0cd", + "blockNumber": 8408388, + "txIdx": 3 + }, + { + "hash": "0x52224ab58dff929b8cdd3f8738278c42c672abdb49e66e865258f0ccb381063f", + "blockNumber": 8408324, + "txIdx": 3 + }, + { + "hash": "0x93537756d98226f95abf593370793dfc971ac1c4a3531ea3908bfea051ead00f", + "blockNumber": 8408132, + "txIdx": 6 + }, + { + "hash": "0x7b77a283a50b28ee31a89881c36afde70c571688b0d84cfceae0e41a5a18f589", + "blockNumber": 8408068, + "txIdx": 18 + }, + { + "hash": "0x40d00bbdb3ca243b137d2344bdd6281eb506ff24039b75713b284af4ab852033", + "blockNumber": 8407748, + "txIdx": 3 + }, + { + "hash": "0x25dd0809b91b4009b6d778857d79a6b351754f1f0421928f10acaecd0a621b89", + "blockNumber": 8407684, + "txIdx": 3 + }, + { + "hash": "0x0eefbd2a5b87d1b5d1f5e77a0276e326a32652ddc8d6504d419d930bf57af999", + "blockNumber": 8407556, + "txIdx": 4 + }, + { + "hash": "0x7f65dcd22b43892f7e4a02bd002b2ce5ee60c7826b9736031d6a88096ce20eaf", + "blockNumber": 8407492, + "txIdx": 5 + }, + { + "hash": "0x49a42297f49bb9a8fa0cd95df974ff899168a8cce95315e762d11847d6c965f7", + "blockNumber": 8407428, + "txIdx": 2 + }, + { + "hash": "0x2a093e20cc80b405dd2e2fa05e1ecc1cb9a4c23047ae76322e7b39a88603e24b", + "blockNumber": 8407236, + "txIdx": 3 + }, + { + "hash": "0xd6827fe4746a09be90e805e11f734a3ab1534416194e959a74926467285e8e44", + "blockNumber": 8406980, + "txIdx": 2 + }, + { + "hash": "0x766429aea09f82c69f6f40b8c839edd64d5030719ce78d01ab101a6b2519116e", + "blockNumber": 8406660, + "txIdx": 3 + }, + { + "hash": "0x1e481b5ee6915c79d4b5817a64b2b3ab8ca51104fdeb3b074912d217038a870c", + "blockNumber": 8406212, + "txIdx": 3 + }, + { + "hash": "0x89ba54fee308a984468ede310c68bfee46c3141e62fddee4540f3065aacbcd71", + "blockNumber": 8406084, + "txIdx": 5 + }, + { + "hash": "0xc2b0e8f370c5dee3478be3dce95e84ae8a0da8ea970ebcc141ac3a6f4e9d2b98", + "blockNumber": 8406020, + "txIdx": 1 + }, + { + "hash": "0x53c1d114329a2856046aa37aa2eed8c9fb49f6412b31d9a0aab7ea2376c34964", + "blockNumber": 8405380, + "txIdx": 3 + } + ], + "max": [ + { + "hash": "0x60e9f7675c3211e087ce719df5c6cd8d3a2c6f674093340fed3011f23321eea7", + "blockNumber": 8285121, + "txIdx": 2 + }, + { + "hash": "0x12209669f865c52d9566e3e261ad551eb5b81f1ddedffedfee7851cf3ca1f6af", + "blockNumber": 8285121, + "txIdx": 3 + }, + { + "hash": "0x78cf2fce981580be349dd9ecb0c18a59a190007a54e920cb475b63bb74081d64", + "blockNumber": 8285121, + "txIdx": 6 + }, + { + "hash": "0xfbb24949b9cd50928240515e70a7b07f026cc7bcbb2d87a2cbf5db4a6a16c3c8", + "blockNumber": 8410052, + "txIdx": 2 + }, + { + "hash": "0x934194f70872b06051da1523ecbad3f1d23e2659b533ccfa334bf639be48f8f7", + "blockNumber": 8408068, + "txIdx": 17 + }, + { + "hash": "0xeea485fbac3342408c9f4c592a14f536a79fae124e218a1e975eab0a74559c43", + "blockNumber": 8407620, + "txIdx": 2 + }, + { + "hash": "0x4fb1e82e9c8b1f6b730d6331d70476a1ba083e96cd3a49ae321c5e37105914e9", + "blockNumber": 8406788, + "txIdx": 7 + }, + { + "hash": "0x353ac206d808ccddd3264674e0c271334df0ea5ecc58f527043eb4561893a29b", + "blockNumber": 8406468, + "txIdx": 2 + } + ], + "oversize": [] + } + }, + "rc": { + "events": [ + { + "hash": "0x7a3e38153c76ad881d0da708648969da14a44a1122397e415a7a334893d4001a", + "blockNumber": 8285121, + "txIdx": 8, + "logIdx": 0, + "eventSchema": "0xa7aaf2512769da4e444e3de247be2564225c2e7a8f74cfe528e46e17d24868e2" + }, + { + "hash": "0x779a430bd4c7c98286bfb7bd9c7d88e0c701478805184eed100590d0e312edec", + "blockNumber": 8411460, + "txIdx": 2, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x779a430bd4c7c98286bfb7bd9c7d88e0c701478805184eed100590d0e312edec", + "blockNumber": 8411460, + "txIdx": 2, + "logIdx": 1, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x779a430bd4c7c98286bfb7bd9c7d88e0c701478805184eed100590d0e312edec", + "blockNumber": 8411460, + "txIdx": 2, + "logIdx": 2, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x779a430bd4c7c98286bfb7bd9c7d88e0c701478805184eed100590d0e312edec", + "blockNumber": 8411460, + "txIdx": 2, + "logIdx": 3, + "eventSchema": "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67" + }, + { + "hash": "0xb93ca94afa7cffaeb21e3f799c8a58d9f9ab7cf0cd738dcab50086211458d5db", + "blockNumber": 8411396, + "txIdx": 1, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 4, + "eventSchema": "0xd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 9, + "eventSchema": "0xd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 12, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 13, + "eventSchema": "0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 14, + "eventSchema": "0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 16, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 17, + "eventSchema": "0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 18, + "eventSchema": "0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 20, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 21, + "eventSchema": "0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 22, + "eventSchema": "0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 24, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 25, + "eventSchema": "0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 26, + "eventSchema": "0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 28, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 29, + "eventSchema": "0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 30, + "eventSchema": "0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 32, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 33, + "eventSchema": "0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 34, + "eventSchema": "0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 36, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 37, + "eventSchema": "0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 38, + "eventSchema": "0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f" + }, + { + "hash": "0x5fb3c50a81953581658b79e2856b73f58648da666adaa84eff4afba7a949cb68", + "blockNumber": 8411268, + "txIdx": 4, + "logIdx": 4, + "eventSchema": "0xd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d" + }, + { + "hash": "0x5fb3c50a81953581658b79e2856b73f58648da666adaa84eff4afba7a949cb68", + "blockNumber": 8411268, + "txIdx": 4, + "logIdx": 7, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x5fb3c50a81953581658b79e2856b73f58648da666adaa84eff4afba7a949cb68", + "blockNumber": 8411268, + "txIdx": 4, + "logIdx": 8, + "eventSchema": "0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e" + } + ], + "category": { + "default": [ + { + "hash": "0x60e9f7675c3211e087ce719df5c6cd8d3a2c6f674093340fed3011f23321eea7", + "blockNumber": 8285121, + "txIdx": 2 + }, + { + "hash": "0x12209669f865c52d9566e3e261ad551eb5b81f1ddedffedfee7851cf3ca1f6af", + "blockNumber": 8285121, + "txIdx": 3 + }, + { + "hash": "0x7a3e38153c76ad881d0da708648969da14a44a1122397e415a7a334893d4001a", + "blockNumber": 8285121, + "txIdx": 8 + }, + { + "hash": "0xdc00cefcca51c91078099db6b9bda4aa7f8028705dd025f647607bb8ce8107bd", + "blockNumber": 8285121, + "txIdx": 9 + }, + { + "hash": "0x779a430bd4c7c98286bfb7bd9c7d88e0c701478805184eed100590d0e312edec", + "blockNumber": 8411460, + "txIdx": 2 + }, + { + "hash": "0xee02a2bef054900155e12515caa1b7ac9da2bb7c822225778546991bac2e0f42", + "blockNumber": 8411460, + "txIdx": 10 + }, + { + "hash": "0x5f51ff8b88691db75d983025f4b73f8adb77ab8aaef83d377fd00cd6a1e98b48", + "blockNumber": 8411460, + "txIdx": 14 + }, + { + "hash": "0x31c27f5b692607274010195b982ac561323f85d991fbda99ebf2171815bce092", + "blockNumber": 8411460, + "txIdx": 15 + }, + { + "hash": "0xb93ca94afa7cffaeb21e3f799c8a58d9f9ab7cf0cd738dcab50086211458d5db", + "blockNumber": 8411396, + "txIdx": 1 + }, + { + "hash": "0x7533d40da23a43504af7c94800ddc54705668fd4f7046009923f898491e640f6", + "blockNumber": 8411396, + "txIdx": 4 + }, + { + "hash": "0x71d5588c5f474db0d3ef761cb8a1b5a32632d00d5ebd7a6ec96c3b5dd041a8ab", + "blockNumber": 8411396, + "txIdx": 6 + }, + { + "hash": "0x25b73040612cb3cce1ed3be26203792188021a53b4c0472d40f6d230ebc7a8e8", + "blockNumber": 8411268, + "txIdx": 2 + }, + { + "hash": "0x2de96342d4c180f3537e31600b414325231f27037052c469a091f04d77db2254", + "blockNumber": 8411204, + "txIdx": 1 + }, + { + "hash": "0xfad7ecf74cca7ddc187426a4a4f77698e5ef6f003339baf8e9a4c0d368165dc6", + "blockNumber": 8411204, + "txIdx": 2 + }, + { + "hash": "0xd31422543dbf432e69e258d1b6fe23670ddaadcae1abc22b7f20e306041ffe1f", + "blockNumber": 8411140, + "txIdx": 1 + }, + { + "hash": "0x3d0253efe301921aafad4f9b60579dfc5f8eab268e6e00243921b4af4042569e", + "blockNumber": 8411140, + "txIdx": 3 + }, + { + "hash": "0xbd4db3ce06e711ca7be949f59155795828c7f3c0e97a91da527b8cdd5a190b2f", + "blockNumber": 8411076, + "txIdx": 10 + }, + { + "hash": "0x45817a23e18dcd4d03b2a6d8d5b2b21bc77c522cde0ca3572d3e13605ca8134f", + "blockNumber": 8410948, + "txIdx": 1 + }, + { + "hash": "0xd8970ca4db7746cb175617fb4d22820d73d191a5be8f53502be5be5b8dca479d", + "blockNumber": 8410948, + "txIdx": 2 + }, + { + "hash": "0x201328510d0fd2b5e62deea68c09e0a25f5c291d7a2aa0b8a374f4cc81c7b6ed", + "blockNumber": 8410948, + "txIdx": 3 + }, + { + "hash": "0x6722f0ec0d7543addf4a75c348fef7101ed179211358050570b2dc372011aa1e", + "blockNumber": 8410948, + "txIdx": 8 + }, + { + "hash": "0xff7c00034bd8f5e39033de90ebe070a5c3c0430e6864c4964983c9d37cfbb426", + "blockNumber": 8410884, + "txIdx": 1 + }, + { + "hash": "0xef938cf753b3e0f732be0e4c750fab3f557fe0c74224370619e6ad04a4b2338f", + "blockNumber": 8410884, + "txIdx": 2 + }, + { + "hash": "0xc99e0ae591d676d1ee0f07d2316f0ffb37e8165b3c02402bb257598732aad9de", + "blockNumber": 8410820, + "txIdx": 3 + }, + { + "hash": "0x20171b4d06ddcfb46268ae3a8450290fd185c9f9ac675c15889e3c55ec342785", + "blockNumber": 8410756, + "txIdx": 1 + }, + { + "hash": "0x1111de9c0dde56d1fc615789847bcc5a58dca786e788c399f8f84459069088fc", + "blockNumber": 8410756, + "txIdx": 4 + }, + { + "hash": "0xb8a77c6af1ac9177291a520c321c9bd994c2f0196c7b50fc6d844d5c037cabe0", + "blockNumber": 8410692, + "txIdx": 1 + }, + { + "hash": "0xa4b415c833a50b8bdc2dd55168c388816307f6b8a81fd0b03c09591f7a8d8801", + "blockNumber": 8410692, + "txIdx": 2 + }, + { + "hash": "0xa4393fa40bf34889161de9000b40389b0c53ec2400979a8a7e650a5e79280db3", + "blockNumber": 8410692, + "txIdx": 3 + }, + { + "hash": "0x8834f0a11d203c07ad7089f6284e36ce33efe51fab7dddf1d415fe332be342f5", + "blockNumber": 8410692, + "txIdx": 4 + }, + { + "hash": "0xfa8436f5a27b7ca46c4165e423879d06eba9724971158ebf447f53cbd09fab63", + "blockNumber": 8410628, + "txIdx": 3 + }, + { + "hash": "0x113ae7709aa24612220164f2898024831398a14737aa2d8f3a08248822c2ec09", + "blockNumber": 8410628, + "txIdx": 5 + } + ], + "medium": [ + { + "hash": "0x6994bdf13e7ecd0508c2179f12e8e1e72a2be92884c96bda3a49eb8aff5f1ee9", + "blockNumber": 8285121, + "txIdx": 13 + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2 + }, + { + "hash": "0x5fb3c50a81953581658b79e2856b73f58648da666adaa84eff4afba7a949cb68", + "blockNumber": 8411268, + "txIdx": 4 + }, + { + "hash": "0xf379fb4e13b0d01e89b00fb6bbf560d5b67ca980051ba8dc5b083645db435b08", + "blockNumber": 8411204, + "txIdx": 4 + }, + { + "hash": "0x53ef2000baf21e5d40eb2bbe4a0cdefab0d087794052fc5ee79e37a71633d2b4", + "blockNumber": 8411140, + "txIdx": 4 + }, + { + "hash": "0x9d5c8a26e62ef0fbe73dd164404dd8463e54e15811aca9201f7fd24d18ed8a2a", + "blockNumber": 8411012, + "txIdx": 3 + }, + { + "hash": "0x4ed454b9ba18f8bc4e74b70d31357753a082a5092de736f2efe73e43ef2ea6c3", + "blockNumber": 8410884, + "txIdx": 8 + }, + { + "hash": "0x7c3b1eece29e1a581a115571b3679b63d37308801990f4fb6b9f15111d47ae1c", + "blockNumber": 8410372, + "txIdx": 2 + }, + { + "hash": "0x1113bd661227886bda4fad983f0b41ebe88e12b6dc6d411080ea8a0a2fc0eee2", + "blockNumber": 8410308, + "txIdx": 1 + }, + { + "hash": "0x7faf9cf64b56acae4cea6b9522f297c4fe290eee068c8fcaceefb399a1f830af", + "blockNumber": 8410308, + "txIdx": 5 + }, + { + "hash": "0xab8b494951a67c9b1edf043b3765c26aea7da4802948e05bb6a2e791f8d3a5de", + "blockNumber": 8410180, + "txIdx": 4 + }, + { + "hash": "0x274d5ecfc9e474cc7dc62971eddff6e66690fe4f866ba1dab85045b4c4331ec2", + "blockNumber": 8409988, + "txIdx": 7 + }, + { + "hash": "0xf0bb2877d9ddfa0fdb7e404a09b76a081ad1ec1797077fb4b05062509ddb59f3", + "blockNumber": 8409924, + "txIdx": 3 + }, + { + "hash": "0x058cda17022e8d27fe9cdc63748566f8b75a1261c04ecc73f83928d45931bfc1", + "blockNumber": 8409732, + "txIdx": 5 + }, + { + "hash": "0x292c2e380b83c3185982d010da100b32f4cb184b2e8ae82ad6e6becfdfbbd202", + "blockNumber": 8409668, + "txIdx": 5 + }, + { + "hash": "0x2f3688c36e7d7493e415361c25650f46f09b054ae9d5300bbbfc8ec2312bb255", + "blockNumber": 8409476, + "txIdx": 2 + }, + { + "hash": "0xb4ccbe851bb76af1a5d4a9db4269e2f50b144d3c580794f9278f85e86825f9c2", + "blockNumber": 8409412, + "txIdx": 9 + }, + { + "hash": "0xcc2fedff27e726d4af40f31db1d63b638c715fef4457ba9299e15cd165038035", + "blockNumber": 8409348, + "txIdx": 3 + }, + { + "hash": "0x1dcdc7fb35fc8798f172e676e8f18b95022587a2984fcc7a9803d08fd78212c7", + "blockNumber": 8409220, + "txIdx": 3 + }, + { + "hash": "0xe4afc42f865b7f9d813e7552269da0fbc96370a83ef117c289c245c06fbe1a43", + "blockNumber": 8409156, + "txIdx": 2 + }, + { + "hash": "0x257fcba3e02d6a65bc16349b99e3b4cf06be2683e798bc259f73463d91671a83", + "blockNumber": 8409028, + "txIdx": 5 + }, + { + "hash": "0xe3b639e75fa11e6d088ccf14383096841ffbbc206578b1bc9d0d89ef749cd7dc", + "blockNumber": 8408900, + "txIdx": 4 + }, + { + "hash": "0x749df4d3c9f558b81d564becbdefba7670ba8fd180758d5f41dd4963ff3e2471", + "blockNumber": 8408836, + "txIdx": 10 + }, + { + "hash": "0xec8da83e3a629fbf755c0d67e64ef3a41e402ed8c2309969d45debe4ce7b6c12", + "blockNumber": 8408772, + "txIdx": 4 + }, + { + "hash": "0xeaa4c12aedefaaa5f13ca376f146c5ea59f2b6709ecfd08b333d549250a24f68", + "blockNumber": 8408644, + "txIdx": 4 + }, + { + "hash": "0x381a1370ffb1403372462e105abcce7528be08e4769d5024c3a3044b358121bb", + "blockNumber": 8408580, + "txIdx": 5 + }, + { + "hash": "0xa32c4f636480748d97bbe57523e94d08ae72a0f895c15ac2123e4de6152d3fb0", + "blockNumber": 8408516, + "txIdx": 3 + }, + { + "hash": "0xdb04c9f9e93c3ad4616a1a93d769276fe9c8a000a0afe77bc37dc052a6faf0cd", + "blockNumber": 8408388, + "txIdx": 3 + }, + { + "hash": "0x52224ab58dff929b8cdd3f8738278c42c672abdb49e66e865258f0ccb381063f", + "blockNumber": 8408324, + "txIdx": 3 + }, + { + "hash": "0xcc1c8aa6c14cd45d67d015465bc7c383bfbff6837d24edbf3bc3508392d57b34", + "blockNumber": 8408196, + "txIdx": 10 + }, + { + "hash": "0x93537756d98226f95abf593370793dfc971ac1c4a3531ea3908bfea051ead00f", + "blockNumber": 8408132, + "txIdx": 6 + }, + { + "hash": "0x7b77a283a50b28ee31a89881c36afde70c571688b0d84cfceae0e41a5a18f589", + "blockNumber": 8408068, + "txIdx": 18 + } + ], + "large": [ + { + "hash": "0x02b960acc295fe8eaafce8987a35ffd9eba2b1df998892616d4f6b2f7c484bc5", + "blockNumber": 8285121, + "txIdx": 4 + }, + { + "hash": "0x2e94b905987a9f78620657a8a32bd3073bed5b835d549ce90fbf12dd43a4aa99", + "blockNumber": 8410244, + "txIdx": 4 + }, + { + "hash": "0x5e4edd0f6596acec67a3a9979f1c20c0fd67c68e669782ed97553ae27f58495b", + "blockNumber": 8408004, + "txIdx": 3 + }, + { + "hash": "0x79f8a5f7075e02f9672321a8f602f041683accaa07462136317e38257c204f1b", + "blockNumber": 8404548, + "txIdx": 6 + }, + { + "hash": "0x6d5ccd4809c68cb6c4bb0cc7e9f2936990aa53a598c99e58a137a98ddb117409", + "blockNumber": 8403716, + "txIdx": 7 + } + ], + "max": [ + { + "hash": "0x590e0cbfd569dd700eff450f23b0cc982749f04878c3c90e8ef13af883216ada", + "blockNumber": 8285121, + "txIdx": 5 + }, + { + "hash": "0xfbb24949b9cd50928240515e70a7b07f026cc7bcbb2d87a2cbf5db4a6a16c3c8", + "blockNumber": 8410052, + "txIdx": 2 + }, + { + "hash": "0x934194f70872b06051da1523ecbad3f1d23e2659b533ccfa334bf639be48f8f7", + "blockNumber": 8408068, + "txIdx": 17 + }, + { + "hash": "0xeea485fbac3342408c9f4c592a14f536a79fae124e218a1e975eab0a74559c43", + "blockNumber": 8407620, + "txIdx": 2 + }, + { + "hash": "0x4fb1e82e9c8b1f6b730d6331d70476a1ba083e96cd3a49ae321c5e37105914e9", + "blockNumber": 8406788, + "txIdx": 7 + }, + { + "hash": "0x353ac206d808ccddd3264674e0c271334df0ea5ecc58f527043eb4561893a29b", + "blockNumber": 8406468, + "txIdx": 2 + }, + { + "hash": "0x7d31b9520c2e067a0b6972579731315beb7956055ce862048a180b55620721a5", + "blockNumber": 8405060, + "txIdx": 7 + } + ], + "oversize": [] + } + } +} \ No newline at end of file diff --git a/client/test/circuits/quickstart/11155111/average.defaultInputs.json b/client/test/circuits/quickstart/11155111/average.defaultInputs.json new file mode 100644 index 00000000..8dc4022e --- /dev/null +++ b/client/test/circuits/quickstart/11155111/average.defaultInputs.json @@ -0,0 +1,4 @@ +{ + "blockNumber": 5636745, + "address": "0x5b555821f2e0d73347c0bf6b9c0a12c18d7b5562" +} \ No newline at end of file diff --git a/client/test/circuits/quickstart/11155111/average.inputs.json b/client/test/circuits/quickstart/11155111/average.inputs.json new file mode 100644 index 00000000..ed1fabbd --- /dev/null +++ b/client/test/circuits/quickstart/11155111/average.inputs.json @@ -0,0 +1,4 @@ +{ + "blockNumber": 5636745, + "address": "0xd6e1f227335d926a7c0fa0476d3e8c27fbf73da0" +} \ No newline at end of file diff --git a/client/test/circuits/quickstart/84532/average.defaultInputs.json b/client/test/circuits/quickstart/84532/average.defaultInputs.json new file mode 100644 index 00000000..00059c86 --- /dev/null +++ b/client/test/circuits/quickstart/84532/average.defaultInputs.json @@ -0,0 +1,4 @@ +{ + "blockNumber": 8279568, + "address": "0xd53eb5203e367bbdd4f72338938224881fc501ab" +} \ No newline at end of file diff --git a/client/test/circuits/quickstart/84532/average.inputs.json b/client/test/circuits/quickstart/84532/average.inputs.json new file mode 100644 index 00000000..582cd29e --- /dev/null +++ b/client/test/circuits/quickstart/84532/average.inputs.json @@ -0,0 +1,4 @@ +{ + "blockNumber": 8279568, + "address": "0x84646ea731b6e1f08c92af03d6940bae9a41c57e" +} \ No newline at end of file diff --git a/client/test/integration/circuits/quickstart/average.circuit.ts b/client/test/circuits/quickstart/average.circuit.ts similarity index 94% rename from client/test/integration/circuits/quickstart/average.circuit.ts rename to client/test/circuits/quickstart/average.circuit.ts index a965ce25..ed3d687a 100644 --- a/client/test/integration/circuits/quickstart/average.circuit.ts +++ b/client/test/circuits/quickstart/average.circuit.ts @@ -22,8 +22,8 @@ export interface CircuitInputs { // Default inputs to use for compiling the circuit. These values should be different than the inputs fed into // the circuit at proving time. export const defaultInputs = { - "blockNumber": 4000000, - "address": "0xEaa455e4291742eC362Bc21a8C46E5F2b5ed4701" + "blockNumber": 4000000, //$ account.eoa[4].blockNumber + "address": "0xEaa455e4291742eC362Bc21a8C46E5F2b5ed4701" //$ account.eoa[4].address }; // The function name `circuit` is searched for by default by our Axiom CLI; if you decide to diff --git a/client/test/circuits/quickstart/average.compiled.json b/client/test/circuits/quickstart/average.compiled.json new file mode 100644 index 00000000..3e7b7b22 --- /dev/null +++ b/client/test/circuits/quickstart/average.compiled.json @@ -0,0 +1,18 @@ +{ + "vk": "Ag0AAAAABgAAAKdY0S2x49O88WffhIg6j+sI1Nhyl5stleJlyqOU4a4YI3l5FcT4uSbnhps89EEvH7Pl4PdxSKEhmsm6qRblcCQVgXLM4obm5Lk6ap7FB6/9by2ZeNBW+s3zUP4Tjs8zFwUJeY5o0HbwT8zy8/+AfM2INbHJvHk8PKCOs4WFSqAc/vGqIp67oJ8uQuSVU6bTUlxF+PMTDb+ftpQZsrU62A99kpXyg32AfrmozWbZbJJQCdsmAATcH2t3dMs9sq1WDgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB+iw7aQ1yOTPFMoosESOKg1wEi3YTO7f1cWja0lCYMGach/muGTfZjWxeQGP5FRFbvvMeu9C9Rpj7mnAIioGge5Y4eyFqcWBb398AVAY1OV4hvhUz/GR9leHrjGvCVLC71WbmQ3qAvh2ZDO507QY1tuVVcG9qEES/IwVWjtM4MvNbkFZydC5AcudVP5ZXNpqh3VLZRV19ozwxNdZOd37y0LaVF9cdNxt8uBTro5G1nsbb3AAQSxhe5Ljm1KdHVRCMVaeC9tQ0w3NfPHRq1jJLc4gGmnkzh87EMghDb9tZohFxr4MAIY0dDW1Ud4bWbSs1Kf/wBRxHbvRBf8KXfImCeQ8abjs9k3ton3Trhk72vHrvJzzqyaX6Z2h9hMz+bpDZRnQtfr+JQ1bgNokpaNGYut/YrC6d4EAUolcHdxVmQmPwQoTpUYgwd30W1X/ucY5o3aHbL3VX3IyACsIWP0/ibdRKvKAqHvu3u1Ikm++E92gpGZvIieJ6T8yIFYiE+rJZq41Bmcdozx2l0w5M5LURajabU/ITU4mfgbHBG9xFwGbAUsUIVDc3LmCzDIulhHTvnjSfZ1WFZcNmXMewuADSY=", + "config": { + "k": 13, + "numAdvice": 4, + "numLookupAdvice": 1, + "numInstance": 1, + "numLookupBits": 12, + "numVirtualInstance": 2 + }, + "capacity": { + "maxOutputs": 128, + "maxSubqueries": 128 + }, + "querySchema": "0xa44ce4065d6d6db90c3844966dd0a804e28cc5b8e9e02ca38d10e33a4a33ef97", + "inputSchema": "eyJibG9ja051bWJlciI6IkNpcmN1aXRWYWx1ZSIsImFkZHJlc3MiOiJDaXJjdWl0VmFsdWUifQ==", + "circuit": "Y29uc3QgY2xpZW50XzEgPSBBWElPTV9DTElFTlRfSU1QT1JUCmFzeW5jIChpbnB1dHMpID0+IHsKICAgIC8vIE51bWJlciBvZiBzYW1wbGVzIHRvIHRha2UuIE5vdGUgdGhhdCB0aGlzIG11c3QgYmUgYSBjb25zdGFudCB2YWx1ZSBhbmQgTk9UIGFuIGlucHV0IGJlY2F1c2UgdGhlIHNpemUgb2YgCiAgICAvLyB0aGUgY2lyY3VpdCBtdXN0IGJlIGtub3duIGF0IGNvbXBpbGUgdGltZS4KICAgIGNvbnN0IHNhbXBsZXMgPSA4OwogICAgLy8gTnVtYmVyIG9mIGJsb2NrcyBiZXR3ZWVuIGVhY2ggc2FtcGxlLgogICAgY29uc3Qgc3BhY2luZyA9IDkwMDsKICAgIC8vIFZhbGlkYXRlIHRoYXQgdGhlIGJsb2NrIG51bWJlciBpcyBncmVhdGVyIHRoYW4gdGhlIG51bWJlciBvZiBzYW1wbGVzIHRpbWVzIHRoZSBzcGFjaW5nCiAgICBpZiAoaW5wdXRzLmJsb2NrTnVtYmVyLnZhbHVlKCkgPD0gKHNhbXBsZXMgKiBzcGFjaW5nKSkgewogICAgICAgIHRocm93IG5ldyBFcnJvcigiQmxvY2sgbnVtYmVyIG11c3QgYmUgZ3JlYXRlciB0aGFuIHRoZSBudW1iZXIgb2Ygc2FtcGxlcyB0aW1lcyB0aGUgc3BhY2luZyIpOwogICAgfQogICAgLy8gUGVyZm9ybSB0aGUgYmxvY2sgbnVtYmVyIHZhbGlkYXRpb24gaW4gdGhlIGNpcmN1aXQgYXMgd2VsbAogICAgKDAsIGNsaWVudF8xLmNoZWNrTGVzc1RoYW4pKCgwLCBjbGllbnRfMS5tdWwpKHNhbXBsZXMsIHNwYWNpbmcpLCBpbnB1dHMuYmxvY2tOdW1iZXIpOwogICAgLy8gR2V0IGFjY291bnQgYmFsYW5jZSBhdCB0aGUgc2FtcGxlIGJsb2NrIG51bWJlcnMKICAgIGxldCBzYW1wbGVkQWNjb3VudHMgPSBuZXcgQXJyYXkoc2FtcGxlcyk7CiAgICBmb3IgKGxldCBpID0gMDsgaSA8IHNhbXBsZXM7IGkrKykgewogICAgICAgIGNvbnN0IHNhbXBsZUJsb2NrTnVtYmVyID0gKDAsIGNsaWVudF8xLnN1YikoaW5wdXRzLmJsb2NrTnVtYmVyLCAoMCwgY2xpZW50XzEubXVsKShzcGFjaW5nLCBpKSk7CiAgICAgICAgY29uc3QgYWNjb3VudCA9ICgwLCBjbGllbnRfMS5nZXRBY2NvdW50KShzYW1wbGVCbG9ja051bWJlciwgaW5wdXRzLmFkZHJlc3MpOwogICAgICAgIHNhbXBsZWRBY2NvdW50c1tpXSA9IGFjY291bnQ7CiAgICB9CiAgICAvLyBBY2N1bXVsYXRlIGFsbCBvZiB0aGUgYmFsYW5jZXMgdG8gYHRvdGFsYAogICAgbGV0IHRvdGFsID0gKDAsIGNsaWVudF8xLmNvbnN0YW50KSgwKTsKICAgIGZvciAoY29uc3QgYWNjb3VudCBvZiBzYW1wbGVkQWNjb3VudHMpIHsKICAgICAgICBjb25zdCBiYWxhbmNlID0gYXdhaXQgYWNjb3VudC5iYWxhbmNlKCk7CiAgICAgICAgdG90YWwgPSAoMCwgY2xpZW50XzEuYWRkKSh0b3RhbCwgYmFsYW5jZS50b0NpcmN1aXRWYWx1ZSgpKTsKICAgIH0KICAgIC8vIERpdmlkZSB0aGUgdG90YWwgYW1vdW50IGJ5IHRoZSBudW1iZXIgb2Ygc2FtcGxlcyB0byBnZXQgdGhlIGF2ZXJhZ2UgdmFsdWUKICAgIGNvbnN0IGF2ZXJhZ2UgPSAoMCwgY2xpZW50XzEuZGl2KSh0b3RhbCwgc2FtcGxlcyk7CiAgICAvLyBXZSBjYWxsIGBhZGRUb0NhbGxiYWNrYCBvbiBhbGwgdmFsdWVzIHRoYXQgd2Ugd291bGQgbGlrZSB0byBiZSBwYXNzZWQgdG8gb3VyIGNvbnRyYWN0IGFmdGVyIHRoZSBjaXJjdWl0IGhhcwogICAgLy8gYmVlbiBwcm92ZW4gaW4gWksuIFRoZSB2YWx1ZXMgY2FuIHRoZW4gYmUgaGFuZGxlZCBieSBvdXIgY29udHJhY3Qgb25jZSB0aGUgcHJvdmVyIGNhbGxzIHRoZSBjYWxsYmFjayBmdW5jdGlvbi4KICAgICgwLCBjbGllbnRfMS5hZGRUb0NhbGxiYWNrKShpbnB1dHMuYmxvY2tOdW1iZXIpOwogICAgKDAsIGNsaWVudF8xLmFkZFRvQ2FsbGJhY2spKGlucHV0cy5hZGRyZXNzKTsKICAgICgwLCBjbGllbnRfMS5hZGRUb0NhbGxiYWNrKShhdmVyYWdlKTsKfQ==" +} \ No newline at end of file diff --git a/client/test/integration/capacityDataQuery.test.ts b/client/test/integration/capacityDataQuery.test.ts deleted file mode 100644 index 00c52af1..00000000 --- a/client/test/integration/capacityDataQuery.test.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { Axiom } from "../../src"; -import { generateCircuit } from "./circuitTest"; - -describe("On-chain Data Query scenarios", () => { - test("Send one of each DataQuery", async () => { - const { circuit, compiledCircuit, inputs } = await generateCircuit("capacityDataQuery/oneOfEach"); - - const axiom = new Axiom({ - circuit, - compiledCircuit, - chainId: "11155111", // Sepolia - provider: process.env.PROVIDER_URI_SEPOLIA as string, - privateKey: process.env.PRIVATE_KEY_SEPOLIA as string, - callback: { - target: "0x4A4e2D8f3fBb3525aD61db7Fc843c9bf097c362e", - }, - }); - await axiom.init(); - await axiom.prove(inputs); - const receipt = await axiom.sendQuery(); - expect(receipt.status).toBe('success'); - }, 90000); - - test("Send a size-128 header DataQuery", async () => { - const { circuit, compiledCircuit, inputs } = await generateCircuit("capacityDataQuery/size128Header"); - - const axiom = new Axiom({ - circuit, - compiledCircuit, - chainId: "11155111", // Sepolia - provider: process.env.PROVIDER_URI_SEPOLIA as string, - privateKey: process.env.PRIVATE_KEY_SEPOLIA as string, - callback: { - target: "0x4A4e2D8f3fBb3525aD61db7Fc843c9bf097c362e", - }, - }); - await axiom.init(); - await axiom.prove(inputs); - const receipt = await axiom.sendQuery(); - expect(receipt.status).toBe('success'); - }, 180000); - - test("256-capacity query", async () => { - const { circuit, compiledCircuit, inputs } = await generateCircuit("capacityDataQuery/size256Header"); - - const axiom = new Axiom({ - circuit: circuit, - compiledCircuit: compiledCircuit, - chainId: "11155111", // Sepolia - provider: process.env.PROVIDER_URI_SEPOLIA as string, - privateKey: process.env.PRIVATE_KEY_SEPOLIA as string, - callback: { - target: "0x4A4e2D8f3fBb3525aD61db7Fc843c9bf097c362e", - }, - options: { - overrides: { - validateBuild: false, - }, - }, - capacity: { - maxOutputs: 256, - maxSubqueries: 256, - }, - }); - await axiom.init(); - await axiom.prove(inputs); - const receipt = await axiom.sendQuery(); - // Transaction will be sent successfully but fulfill tx may not succeed - expect(receipt.status).toBe('success'); - }, 180000); -}); diff --git a/client/test/integration/circuitTest.ts b/client/test/integration/circuitTest.ts deleted file mode 100644 index 58cc9aa8..00000000 --- a/client/test/integration/circuitTest.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { execSync } from "child_process"; -import { existsSync, rmSync } from "fs"; -import path from "path"; - -export async function generateCircuit(circuitPath: string) { - const provider = process.env.PROVIDER_URI_SEPOLIA as string; - if (!provider) { - throw new Error("`PROVIDER_URI_SEPOLIA` environment variable required"); - } - - const circuitFile = path.resolve(`./test/integration/circuits/${circuitPath}.circuit.ts`); - const compiledPath = path.resolve(`./test/integration/circuits/output/${circuitPath}.compiled.json`); - const inputsPath = path.resolve(`./test/integration/circuits/${circuitPath}.inputs.json`); - - if (existsSync(compiledPath)) { - rmSync(compiledPath); - } - execSync(`node ./dist/cli/index.js circuit compile ${circuitFile} -o ${compiledPath} -p ${provider}`, { stdio: 'inherit' }); - - let inputs = {}; - if (existsSync(inputsPath)) { - inputs = (await import(inputsPath)).default; - } - - return { - circuit: (await import(circuitFile)).circuit, - compiledCircuit: await import(compiledPath), - inputs, - }; -} \ No newline at end of file diff --git a/client/test/integration/circuits/8_state_root.circuit.ts b/client/test/integration/circuits/8_state_root.circuit.ts deleted file mode 100644 index 9e96c9f7..00000000 --- a/client/test/integration/circuits/8_state_root.circuit.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { -CircuitValue, -CircuitValue256, -getHeader, -addToCallback, -add, -or, -} from "../../../src"; - -export const inputs = { - "claimedBlockNumber": 3000000 -}; -export type CircuitInputType = typeof inputs; -export interface CircuitInputs extends CircuitInputType { } -export interface CircuitValueInputs { - claimedBlockNumber: CircuitValue; -} -export const circuit = async ({ - claimedBlockNumber, -}: CircuitValueInputs) => { - - for(let i=0; i<8; i++){ - const header = getHeader(add(3000000, i)); - addToCallback(await header.stateRoot()) - } - - -}; \ No newline at end of file diff --git a/client/test/integration/circuits/8_state_root.compiled.json b/client/test/integration/circuits/8_state_root.compiled.json deleted file mode 100644 index 5fbf3a61..00000000 --- a/client/test/integration/circuits/8_state_root.compiled.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "vk": "Ag0AAAAABgAAAKdY0S2x49O88WffhIg6j+sI1Nhyl5stleJlyqOU4a4YI3l5FcT4uSbnhps89EEvH7Pl4PdxSKEhmsm6qRblcCRUHV0Oe+DFTIoTMAQ+FheGCITbU00kVZMnBfG/8cztCq5FrSn2h8IYXpsbiEmQEVH7iJ8v0yskj46zl6FR/H8nL4QyG3Pv2I/wKQpJPixdTPE6UGY3E5npP9DzlAvD/gflFh/C94M+BgFAp9lxJ/e9eDRDjGtM5+mUCJQVaaAwKQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH7Ro7x5mnRfi9bt66ugSpdU0neEYRojNVtHaqsV/YYR5UO7wFHZfoLaYQYMhE+CLPDjB0iXYpR7yG+gWuAGdyvA6UtnGYbz0KwTwD+f6DCODBJ/mZv212qal4rgHMFuK7JlwsEiZ5xgiOjPsbal6mmbB23jUfIbbW45+hjUcGMRNbkFZydC5AcudVP5ZXNpqh3VLZRV19ozwxNdZOd37y0LaVF9cdNxt8uBTro5G1nsbb3AAQSxhe5Ljm1KdHVRCMVaeC9tQ0w3NfPHRq1jJLc4gGmnkzh87EMghDb9tZohFxr4MAIY0dDW1Ud4bWbSs1Kf/wBRxHbvRBf8KXfImCeQ8abjs9k3ton3Trhk72vHrvJzzqyaX6Z2h9hMz+bpDZRnQtfr+JQ1bgNokpaNGYut/YrC6d4EAUolcHdxVmQmqr0t23/QYY81HxmN/NmZ8hGnYz6YlA13M7aVLx8PATDOQlK/3J6kYGI18Le3ItdcqYbi//hsrm6SLvWIK1cJBYCM207KQVY5JLoVgzeAxQ1F3vPWNPNIbBAi/kbVEnUgBr9WZIUM37jSYTIf64RPNFCDvnXHoYRh7DmINVZj1hQ=", - "config": { - "k": 13, - "numAdvice": 4, - "numLookupAdvice": 1, - "numInstance": 1, - "numLookupBits": 12, - "numVirtualInstance": 2 - }, - "querySchema": "0x9c9d11cdb2a42cd200f9aec1d74bad9d32dcefd926dd96b13779baa8f4e575e8", - "inputSchema": "eyJibG9ja051bWJlciI6IkNpcmN1aXRWYWx1ZSIsImFkZHJlc3MiOiJDaXJjdWl0VmFsdWUifQ==", - "circuit": "Y29uc3QgY2xpZW50XzEgPSBBWElPTV9DTElFTlRfSU1QT1JUCmFzeW5jICh7IGJsb2NrTnVtYmVyLCBhZGRyZXNzLCB9KSA9PiB7CiAgICAvLyBTaW5jZSB0aGUgYmxvY2tOdW1iZXIgaXMgYSB2YXJpYWJsZSBpbnB1dCwgbGV0J3MgYWRkIGl0IHRvIHRoZSByZXN1bHRzIHRoYXQgd2lsbCBiZSBzZW50IHRvIG91ciBjYWxsYmFjayBmdW5jdGlvbgogICAgKDAsIGNsaWVudF8xLmFkZFRvQ2FsbGJhY2spKGJsb2NrTnVtYmVyKTsKICAgICgwLCBjbGllbnRfMS5hZGRUb0NhbGxiYWNrKShhZGRyZXNzKTsKICAgIC8vIE51bWJlciBvZiBzYW1wbGVzIHRvIHRha2UuIE5vdGUgdGhhdCB0aGlzIG11c3QgYmUgYSBjb25zdGFudCB2YWx1ZSBhbmQgTk9UIGFuIGlucHV0IGJlY2F1c2UgdGhlIHNpemUgb2YgdGhlIGNpcmN1aXQgCiAgICAvLyBtdXN0IGJlIGtub3duIGF0IGNvbXBpbGUgdGltZS4KICAgIGNvbnN0IHNhbXBsZXMgPSA4OwogICAgLy8gTnVtYmVyIG9mIGJsb2NrcyBiZXR3ZWVuIGVhY2ggc2FtcGxlLgogICAgY29uc3Qgc3BhY2luZyA9IDkwMDsKICAgIC8vIFZhbGlkYXRlIHRoYXQgdGhlIGJsb2NrIG51bWJlciBpcyBncmVhdGVyIHRoYW4gdGhlIG51bWJlciBvZiBzYW1wbGVzIHRpbWVzIHRoZSBzcGFjaW5nCiAgICBpZiAoYmxvY2tOdW1iZXIudmFsdWUoKSA8PSAoc2FtcGxlcyAqIHNwYWNpbmcpKSB7CiAgICAgICAgdGhyb3cgbmV3IEVycm9yKCJCbG9jayBudW1iZXIgbXVzdCBiZSBncmVhdGVyIHRoYW4gdGhlIG51bWJlciBvZiBzYW1wbGVzIHRpbWVzIHRoZSBzcGFjaW5nIik7CiAgICB9CiAgICAvLyBDcmVhdGUgYW4gYXJyYXkgb2YgYmxvY2sgbnVtYmVycyB0byBzYW1wbGUgZnJvbQogICAgY29uc3QgYmxvY2tOdW1iZXJzID0gQXJyYXkuZnJvbSh7IGxlbmd0aDogc2FtcGxlcyB9LCAoXywgaSkgPT4gYmxvY2tOdW1iZXIubnVtYmVyKCkgLSAoc3BhY2luZyAqIGkpKTsKICAgIC8vIEdldCBhbGwgYmFsYW5jZXMgZm9yIHRoZSBnaXZlbiBhZGRyZXNzIGF0IHRoZSBibG9jayBudW1iZXJzIHdlIGFyZSBzYW1wbGluZyBmcm9tCiAgICBjb25zdCBiYWxhbmNlcyA9IGF3YWl0IFByb21pc2UuYWxsKAogICAgLy8gQ2FsbCBgZ2V0QWNjb3VudGAgZm9yIGVhY2ggc2FtcGxlIGJsb2NrIG51bWJlciBjb25jdXJyZW50bHkKICAgIGJsb2NrTnVtYmVycy5tYXAoKHNhbXBsZUJsb2NrTnVtKSA9PiAoMCwgY2xpZW50XzEuZ2V0QWNjb3VudCkoc2FtcGxlQmxvY2tOdW0sIGFkZHJlc3MpLmJhbGFuY2UoKSkpOwogICAgLy8gQ2FsY3VsYXRlIHRoZSB0b3RhbAogICAgY29uc3QgdG90YWwgPSAoMCwgY2xpZW50XzEuc3VtKShiYWxhbmNlcy5tYXAoKGJhbGFuY2UpID0+IGJhbGFuY2UudmFsdWUoKSkpOwogICAgLy8gRGl2aWRlIGJ5IHRoZSBudW1iZXIgb2Ygc2FtcGxlcyB0byBnZXQgdGhlIGF2ZXJhZ2UgdmFsdWUKICAgIGNvbnN0IGF2ZXJhZ2UgPSAoMCwgY2xpZW50XzEuZGl2KSh0b3RhbCwgc2FtcGxlcyk7CiAgICAvLyBXZSBhZGQgdGhlIHJlc3VsdCB0byB0aGUgY2FsbGJhY2ssIHdoaWNoIG91ciBTb2xpZGl0eSBjb250cmFjdCB3aWxsIHRoZW4gaGFuZGxlCiAgICAoMCwgY2xpZW50XzEuYWRkVG9DYWxsYmFjaykoYXZlcmFnZSk7Cn0=" -} \ No newline at end of file diff --git a/client/test/integration/circuits/capacityDataQuery/oneOfEach.circuit.ts b/client/test/integration/circuits/capacityDataQuery/oneOfEach.circuit.ts deleted file mode 100644 index a2cfd12d..00000000 --- a/client/test/integration/circuits/capacityDataQuery/oneOfEach.circuit.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { add, addToCallback, constant, getAccount, getHeader, getReceipt, getSolidityMapping, getStorage, getTx, mul } from "@axiom-crypto/circuit"; - -export interface CircuitInputs {} - -export const defaultInputs = {}; - -export const circuit = async (inputs: CircuitInputs) => { - const blockNumber = 5000000; - const addr = "0x83c8c0b395850ba55c830451cfaca4f2a667a983"; - const header = await getHeader(blockNumber).receiptsRoot(); - const account = await getAccount(blockNumber, addr).balance(); - const storage = await getStorage(blockNumber, addr).slot(0); - const tx = await getTx(blockNumber, 0).to(); - const rc = await getReceipt(blockNumber, 0).status(); - const mapping = await getSolidityMapping(blockNumber, addr, 0).key(0); -} \ No newline at end of file diff --git a/client/test/integration/circuits/capacityDataQuery/size128Header.circuit.ts b/client/test/integration/circuits/capacityDataQuery/size128Header.circuit.ts deleted file mode 100644 index 7e6bb144..00000000 --- a/client/test/integration/circuits/capacityDataQuery/size128Header.circuit.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { add, addToCallback, constant, getAccount, getHeader, getReceipt, getSolidityMapping, getStorage, getTx, mul } from "@axiom-crypto/circuit"; - -export interface CircuitInputs {} - -export const defaultInputs = {}; - -export const circuit = async (inputs: CircuitInputs) => { - const blockNumber = 5000000; - for (let i = 0; i < 128; i++) { - const header = await getHeader(blockNumber + i).receiptsRoot(); - addToCallback(header); - } -} \ No newline at end of file diff --git a/client/test/integration/circuits/capacityDataQuery/size256Header.circuit.ts b/client/test/integration/circuits/capacityDataQuery/size256Header.circuit.ts deleted file mode 100644 index f8fa8ace..00000000 --- a/client/test/integration/circuits/capacityDataQuery/size256Header.circuit.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { add, addToCallback, constant, getAccount, getHeader, getReceipt, getSolidityMapping, getStorage, getTx, mul } from "@axiom-crypto/circuit"; - -export interface CircuitInputs {} - -export const defaultInputs = {}; - -export const config = { - capacity: { - maxOutputs: 256, - maxSubqueries: 256, - }, -}; - -export const circuit = async (inputs: CircuitInputs) => { - const blockNumber = 5000000; - for (let i = 0; i < 256; i++) { - const header = await getHeader(blockNumber + i).receiptsRoot(); - addToCallback(header); - } -} \ No newline at end of file diff --git a/client/test/integration/circuits/computeQuery/simple.inputs.json b/client/test/integration/circuits/computeQuery/simple.inputs.json deleted file mode 100644 index 6761a468..00000000 --- a/client/test/integration/circuits/computeQuery/simple.inputs.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "blockNumber": 5100010 -} \ No newline at end of file diff --git a/client/test/integration/circuits/computeQuery/simpleWithCapacity.inputs.json b/client/test/integration/circuits/computeQuery/simpleWithCapacity.inputs.json deleted file mode 100644 index 6761a468..00000000 --- a/client/test/integration/circuits/computeQuery/simpleWithCapacity.inputs.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "blockNumber": 5100010 -} \ No newline at end of file diff --git a/client/test/integration/circuits/computeQueryStandalone/computeQueryNoData.compiled.json b/client/test/integration/circuits/computeQueryStandalone/computeQueryNoData.compiled.json deleted file mode 100644 index e6235594..00000000 --- a/client/test/integration/circuits/computeQueryStandalone/computeQueryNoData.compiled.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "vk": "Ag0AAAAABgAAAKdY0S2x49O88WffhIg6j+sI1Nhyl5stleJlyqOU4a4YI3l5FcT4uSbnhps89EEvH7Pl4PdxSKEhmsm6qRblcCSRULmGnUikU8NHmDf7pwVgmfItOijZAeSvtbW2h2gwAt5Qe7pe1ktgutBUW7jAODJQPcX6LIVtbExN2AAk1noK4ws9wnYJZCNgqeGJivOdBj0pSJ5wFbAOzoz+lQCQSRKh36sxFwBnzBxC5zy5HLzivAgAkMrZsc0AaH8YxadoBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIMy4Bq9GYe6j+BBjxsTpGLxlguU4gWEf3pKQgigs+YAb9vbg0lRVSPZR7MBudZkQjzDGx5LOc2VR2zRotgLPR2StIcrQZnB57OmSLs4Dme2Y4GFVareMjWnrLRjCIVmLqjnGNxNZUz9OLTHQTJbPrqJm9D/ecN140XZtjjDl/MlNbkFZydC5AcudVP5ZXNpqh3VLZRV19ozwxNdZOd37y0LaVF9cdNxt8uBTro5G1nsbb3AAQSxhe5Ljm1KdHVRCMVaeC9tQ0w3NfPHRq1jJLc4gGmnkzh87EMghDb9tZohFxr4MAIY0dDW1Ud4bWbSs1Kf/wBRxHbvRBf8KXfImCeQ8abjs9k3ton3Trhk72vHrvJzzqyaX6Z2h9hMz+bpDZRnQtfr+JQ1bgNokpaNGYut/YrC6d4EAUolcHdxVmQmWmiZLdfTU5ylUEM1sYbzqWUyywHey3pwcBHNJs/6BRKDKUbxle+MFOFbd02IuweOE6jMIfgSjy7KkOMCCtbwIvYyZOeG1FzDrT/PchwhPEwKQcYXpTGd1gqdN/Y2v7ss9zPmLt+cOOipLl4rCDC5mHLybzgzFTaL+WQYzgTMuCQ=", - "config": { - "k": 13, - "numAdvice": 4, - "numLookupAdvice": 1, - "numInstance": 1, - "numLookupBits": 12, - "numVirtualInstance": 2 - }, - "querySchema": "0xe9ca549129e5e6a15e84131ce10812ad7383cbefd26c86199d078332e597fee8", - "inputSchema": "e30=", - "circuit": "Y29uc3QgY2xpZW50XzEgPSBBWElPTV9DTElFTlRfSU1QT1JUCmFzeW5jIChpbnB1dHMpID0+IHsKICAgIGxldCB0b3RhbCA9ICgwLCBjbGllbnRfMS5jb25zdGFudCkoMCk7CiAgICBmb3IgKGxldCBpID0gMDsgaSA8IDE2OyBpKyspIHsKICAgICAgICBjb25zdCBhID0gKDAsIGNsaWVudF8xLmNvbnN0YW50KSgyNTYpOwogICAgICAgIGNvbnN0IGIgPSAoMCwgY2xpZW50XzEuY29uc3RhbnQpKDEyOCk7CiAgICAgICAgY29uc3QgYyA9ICgwLCBjbGllbnRfMS5tdWwpKGEsIGIpOwogICAgICAgIHRvdGFsID0gKDAsIGNsaWVudF8xLmFkZCkodG90YWwsIGMpOwogICAgfQogICAgKDAsIGNsaWVudF8xLmFkZFRvQ2FsbGJhY2spKHRvdGFsKTsKfQ==" -} \ No newline at end of file diff --git a/client/test/integration/circuits/computeQueryStandalone/computeQueryNoDataLarge.compiled.json b/client/test/integration/circuits/computeQueryStandalone/computeQueryNoDataLarge.compiled.json deleted file mode 100644 index b149876e..00000000 --- a/client/test/integration/circuits/computeQueryStandalone/computeQueryNoDataLarge.compiled.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "vk": "Ag0AAAAABgAAAKdY0S2x49O88WffhIg6j+sI1Nhyl5stleJlyqOU4a4YI3l5FcT4uSbnhps89EEvH7Pl4PdxSKEhmsm6qRblcCQGwTh8e8/X6rAkwBBjwEAe8JQwJihUy2OevYaTWaVsCn51qsuEcLo1e8KHJIpslGGyt+MP0H1H+N5Sx7WKO/sG1TUK+WLLt/QucbbkpP0smQkSUm3Jc2QA1Qm3BClFEgQ9hLmmQW9w/81QNF6E/UtAOttUfr5MS13hrhVOxTi+DQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPACPlujvpxWS/sQOxpmXJXQL/R1FKtzL8PgcYDQAzwWRZArIpjDgLva9grWihuvbRmk1ilnnSeOsuamrKoODy19rkQ1RwSYnJGg6IvZ2dvj2sNY/4EIU2n4+OLY5Z1zDEz6oO65cArsf/hBAGnp7ozGWhEJH1W3RjPLwUexvjIkNbkFZydC5AcudVP5ZXNpqh3VLZRV19ozwxNdZOd37y0LaVF9cdNxt8uBTro5G1nsbb3AAQSxhe5Ljm1KdHVRCMVaeC9tQ0w3NfPHRq1jJLc4gGmnkzh87EMghDb9tZohFxr4MAIY0dDW1Ud4bWbSs1Kf/wBRxHbvRBf8KXfImCeQ8abjs9k3ton3Trhk72vHrvJzzqyaX6Z2h9hMz+bpDZRnQtfr+JQ1bgNokpaNGYut/YrC6d4EAUolcHdxVmQmqVdiYD19KGwhox9gJVOrQNg7aLGpT8PGDS5oaWzlTRuW2VcLOgHVMCCHHJ+sfourqoy8h/pqBsGgcQicI0VKK6CAU9q2zt1XpJbe839pUZ5WRuhgSZD8Sa1wukojRoAU9WmzP1WTnUrVzljfy6bH1bBCyBpfOFwuU3xDSaZhLAM=", - "config": { - "k": 13, - "numAdvice": 4, - "numLookupAdvice": 1, - "numInstance": 1, - "numLookupBits": 12, - "numVirtualInstance": 2 - }, - "querySchema": "0x4df858bb6ecf92a348bc32150a6abfd7d1bc7875d6bdd22dd4d059623a211952", - "inputSchema": "eyJ4IjoiQ2lyY3VpdFZhbHVlW10iLCJ5IjoiQ2lyY3VpdFZhbHVlW10ifQ==", - "circuit": "Y29uc3QgY2lyY3VpdF8xID0gQVhJT01fQ0xJRU5UX0lNUE9SVAphc3luYyAoaW5wdXRzKSA9PiB7CiAgICBsZXQgeFJlcyA9IFtdOwogICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpbnB1dHMueC5sZW5ndGg7IGkrKykgewogICAgICAgIC8vIHheMiArIHkKICAgICAgICBjb25zdCB4XzIgPSAoMCwgY2lyY3VpdF8xLm11bCkoaW5wdXRzLnhbaV0sIGlucHV0cy54W2ldKTsKICAgICAgICBjb25zdCB2YWwgPSAoMCwgY2lyY3VpdF8xLmFkZCkoeF8yLCBpbnB1dHMueVtpXSk7CiAgICAgICAgaWYgKGkgPCA0KSB7CiAgICAgICAgICAgIHhSZXMucHVzaCh2YWwpOwogICAgICAgIH0KICAgIH0KICAgIGxldCB5UmVzID0gW107CiAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlucHV0cy55Lmxlbmd0aDsgaSsrKSB7CiAgICAgICAgLy8geF4yICsgeQogICAgICAgIGNvbnN0IHlfMiA9ICgwLCBjaXJjdWl0XzEubXVsKShpbnB1dHMueVtpXSwgaW5wdXRzLnlbaV0pOwogICAgICAgIGNvbnN0IHZhbCA9ICgwLCBjaXJjdWl0XzEuYWRkKSh5XzIsIGlucHV0cy54W2ldKTsKICAgICAgICBpZiAoaSA8IDQpIHsKICAgICAgICAgICAgeVJlcy5wdXNoKHZhbCk7CiAgICAgICAgfQogICAgfQogICAgbGV0IHpSZXMgPSBbXTsKICAgIGZvciAobGV0IGkgPSAwOyBpIDwgeFJlcy5sZW5ndGg7IGkrKykgewogICAgICAgIGNvbnN0IHZhbCA9ICgwLCBjaXJjdWl0XzEubXVsKSh4UmVzW2ldLCB5UmVzW2ldKTsKICAgICAgICBpZiAoaSA8IDQpIHsKICAgICAgICAgICAgelJlcy5wdXNoKHZhbCk7CiAgICAgICAgfQogICAgfQogICAgbGV0IGFSZXMgPSBbXTsKICAgIGZvciAobGV0IGkgPSAwOyBpIDwgeFJlcy5sZW5ndGg7IGkrKykgewogICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgeVJlcy5sZW5ndGg7IGorKykgewogICAgICAgICAgICBjb25zdCB2YWwgPSAoMCwgY2lyY3VpdF8xLm11bCkoeFJlc1tpXSwgeVJlc1tqXSk7CiAgICAgICAgICAgIGlmIChpIDwgNCAmJiBqIDwgNCkgewogICAgICAgICAgICAgICAgYVJlcy5wdXNoKHZhbCk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CiAgICBsZXQgYlJlcyA9IFtdOwogICAgZm9yIChsZXQgaSA9IDA7IGkgPCB5UmVzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCB6UmVzLmxlbmd0aDsgaisrKSB7CiAgICAgICAgICAgIGNvbnN0IHZhbCA9ICgwLCBjaXJjdWl0XzEubXVsKSh5UmVzW2ldLCB6UmVzW2pdKTsKICAgICAgICAgICAgaWYgKGkgPCA0ICYmIGogPCA0KSB7CiAgICAgICAgICAgICAgICBiUmVzLnB1c2godmFsKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KICAgIGxldCBjUmVzID0gW107CiAgICBmb3IgKGxldCBpID0gMDsgaSA8IHpSZXMubGVuZ3RoOyBpKyspIHsKICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IHhSZXMubGVuZ3RoOyBqKyspIHsKICAgICAgICAgICAgY29uc3QgdmFsID0gKDAsIGNpcmN1aXRfMS5tdWwpKHpSZXNbaV0sIHhSZXNbal0pOwogICAgICAgICAgICBpZiAoaSA8IDQgJiYgaiA8IDQpIHsKICAgICAgICAgICAgICAgIGNSZXMucHVzaCh2YWwpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQogICAgZm9yIChsZXQgaSA9IDA7IGkgPCB4UmVzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgaWYgKGkgPCA0KSB7CiAgICAgICAgICAgICgwLCBjaXJjdWl0XzEuYWRkVG9DYWxsYmFjaykoeFJlc1tpXSk7CiAgICAgICAgICAgICgwLCBjaXJjdWl0XzEuYWRkVG9DYWxsYmFjaykoeVJlc1tpXSk7CiAgICAgICAgICAgICgwLCBjaXJjdWl0XzEuYWRkVG9DYWxsYmFjaykoelJlc1tpXSk7CiAgICAgICAgfQogICAgfQogICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhUmVzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgY29uc3QgdmFsID0gKDAsIGNpcmN1aXRfMS5tdWwpKGNSZXNbaV0sICgwLCBjaXJjdWl0XzEubXVsKShhUmVzW2ldLCBiUmVzW2ldKSk7CiAgICAgICAgaWYgKGkgPCA0KSB7CiAgICAgICAgICAgICgwLCBjaXJjdWl0XzEuYWRkVG9DYWxsYmFjaykodmFsKTsKICAgICAgICB9CiAgICB9Cn0=" -} \ No newline at end of file diff --git a/client/test/integration/circuits/computeQueryStandalone/computeQueryNoDataLarge.inputs.json b/client/test/integration/circuits/computeQueryStandalone/computeQueryNoDataLarge.inputs.json deleted file mode 100644 index 8edadc93..00000000 --- a/client/test/integration/circuits/computeQueryStandalone/computeQueryNoDataLarge.inputs.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "x": [100,50,200,150,80,95,25,88,12,50,11,20,55,18,955,36,29,603,90,111], - "y": [81,22,56,69,28,182,20,205,53,27,291,53,59,22,8,225,37,50,22,409] -} \ No newline at end of file diff --git a/client/test/integration/circuits/eip4844/eip4844receipt.inputs.json b/client/test/integration/circuits/eip4844/eip4844receipt.inputs.json deleted file mode 100644 index d81aedd7..00000000 --- a/client/test/integration/circuits/eip4844/eip4844receipt.inputs.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "blockNumber": 5205303, - "txIdx": 0 -} \ No newline at end of file diff --git a/client/test/integration/circuits/queryId/basic.circuit.ts b/client/test/integration/circuits/queryId/basic.circuit.ts deleted file mode 100644 index 76f8e0d5..00000000 --- a/client/test/integration/circuits/queryId/basic.circuit.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { - addToCallback, - getHeader, -} from "@axiom-crypto/circuit"; - -export interface CircuitInputs {} - -export const defaultInputs = {}; - -export const circuit = async (inputs: CircuitInputs) => { - const header = await getHeader(5300000).number(); - addToCallback(header); -} \ No newline at end of file diff --git a/client/test/integration/circuits/quickstart/average.inputs.json b/client/test/integration/circuits/quickstart/average.inputs.json deleted file mode 100644 index d41316e8..00000000 --- a/client/test/integration/circuits/quickstart/average.inputs.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "blockNumber": 5000000, - "address": "0xEaa455e4291742eC362Bc21a8C46E5F2b5ed4701" -} \ No newline at end of file diff --git a/client/test/integration/circuits/sendQuery/average.inputs.json b/client/test/integration/circuits/sendQuery/average.inputs.json deleted file mode 100644 index 4b7a414d..00000000 --- a/client/test/integration/circuits/sendQuery/average.inputs.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "blockNumber": 5000001, - "address": "0xEaa455e4291742eC362Bc21a8C46E5F2b5ed4701" -} \ No newline at end of file diff --git a/client/test/integration/computeQuery.test.ts b/client/test/integration/computeQuery.test.ts deleted file mode 100644 index 8c119bb8..00000000 --- a/client/test/integration/computeQuery.test.ts +++ /dev/null @@ -1,55 +0,0 @@ - -import { Axiom } from "../../src"; -import { generateCircuit } from "./circuitTest"; - -describe("Build ComputeQuery with DataQuery", () => { - test("simple computeQuery with dataQuery", async () => { - const { circuit, compiledCircuit, inputs } = await generateCircuit("computeQuery/simple"); - - const axiom = new Axiom({ - circuit: circuit, - compiledCircuit: compiledCircuit, - chainId: "11155111", // Sepolia - provider: process.env.PROVIDER_URI_SEPOLIA as string, - privateKey: process.env.PRIVATE_KEY_SEPOLIA as string, - callback: { - target: "0x4A4e2D8f3fBb3525aD61db7Fc843c9bf097c362e", - }, - }); - await axiom.init(); - await axiom.prove(inputs); - const receipt = await axiom.sendQuery(); - expect(receipt.status).toBe('success'); - }, 90000); - - test("simple computeQuery with dataQuery and address override", async () => { - const { circuit, compiledCircuit, inputs } = await generateCircuit("computeQuery/simple"); - - const chainIdOverride = "84532"; - const addressOverride = "0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"; - - const axiom = new Axiom({ - circuit: circuit, - compiledCircuit: compiledCircuit, - chainId: chainIdOverride, // Base - provider: process.env.PROVIDER_URI_84532 as string, - privateKey: process.env.PRIVATE_KEY_SEPOLIA as string, - callback: { - target: "0x4A4e2D8f3fBb3525aD61db7Fc843c9bf097c362e", - }, - options: { - overrides: { - queryAddress: addressOverride, - } - } - }); - await axiom.init(); - await axiom.prove(inputs); - const args = axiom.getSendQueryArgs(); - if (!args) { - throw new Error("Unable to get sendQuery args."); - } - expect(args.args[0]).toBe(chainIdOverride); - expect(args.address).toBe(addressOverride); - }, 90000); -}); diff --git a/client/test/integration/computeQueryStandalone.test.ts b/client/test/integration/computeQueryStandalone.test.ts deleted file mode 100644 index 1c6e158a..00000000 --- a/client/test/integration/computeQueryStandalone.test.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Axiom } from "../../src"; -import { generateCircuit } from "./circuitTest"; - -describe("Build ComputeQuery Standalone", () => { - test("simple computeQuery w/ no data subqueries", async () => { - const { circuit, compiledCircuit, inputs } = await generateCircuit("computeQueryStandalone/computeQueryNoData"); - - const axiom = new Axiom({ - circuit, - compiledCircuit, - chainId: "11155111", // Sepolia - provider: process.env.PROVIDER_URI_SEPOLIA as string, - privateKey: process.env.PRIVATE_KEY_SEPOLIA as string, - callback: { - target: "0x4A4e2D8f3fBb3525aD61db7Fc843c9bf097c362e", - }, - }); - await axiom.init(); - await axiom.prove(inputs); - const receipt = await axiom.sendQuery(); - expect(receipt.status).toBe('success'); - }, 90000); - - test("larger computeQuery w/ no data subqueries", async () => { - const { circuit, compiledCircuit, inputs } = await generateCircuit("computeQueryStandalone/computeQueryNoDataLarge"); - - const axiom = new Axiom({ - circuit, - compiledCircuit, - chainId: "11155111", // Sepolia - provider: process.env.PROVIDER_URI_SEPOLIA as string, - privateKey: process.env.PRIVATE_KEY_SEPOLIA as string, - callback: { - target: "0x4A4e2D8f3fBb3525aD61db7Fc843c9bf097c362e", - }, - }); - await axiom.init(); - await axiom.prove(inputs); - const receipt = await axiom.sendQuery(); - expect(receipt.status).toBe('success'); - }, 90000); -}); diff --git a/client/test/integration/eip4844.test.ts b/client/test/integration/eip4844.test.ts deleted file mode 100644 index 5243d208..00000000 --- a/client/test/integration/eip4844.test.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Axiom } from "../../src"; -import { generateCircuit } from "./circuitTest"; - -describe("EIP-4844 transaction", () => { - test("Send EIP-4848 transaction", async () => { - const { circuit, compiledCircuit, inputs } = await generateCircuit("eip4844/eip4844receipt"); - - const testFn = async () => { - const axiom = new Axiom({ - circuit, - compiledCircuit, - chainId: "11155111", // Sepolia - provider: process.env.PROVIDER_URI_SEPOLIA as string, - privateKey: process.env.PRIVATE_KEY_SEPOLIA as string, - callback: { - target: "0x4A4e2D8f3fBb3525aD61db7Fc843c9bf097c362e", - }, - }); - await axiom.init(); - await axiom.prove(inputs); - const receipt = await axiom.sendQuery(); - }; - await expect(testFn()).rejects.toThrow(); - }, 60000); -}) \ No newline at end of file diff --git a/client/test/integration/queryId.test.ts b/client/test/integration/queryId.test.ts deleted file mode 100644 index 2040582c..00000000 --- a/client/test/integration/queryId.test.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { Axiom } from "../../src"; -import { bytes32 } from "@axiom-crypto/core"; -import { generateCircuit } from "./circuitTest"; - -describe("QueryID Integration Tests", () => { - test("check queryId matches emitted event", async () => { - const { circuit, compiledCircuit, inputs } = await generateCircuit("queryId/basic"); - - const axiom = new Axiom({ - circuit, - compiledCircuit, - chainId: "11155111", // Sepolia - provider: process.env.PROVIDER_URI_SEPOLIA as string, - privateKey: process.env.PRIVATE_KEY_SEPOLIA as string, - callback: { - target: "0x4A4e2D8f3fBb3525aD61db7Fc843c9bf097c362e", - }, - }); - await axiom.init(); - await axiom.prove(inputs); - const args = axiom.getSendQueryArgs(); - if (!args) { - throw new Error("Unable to get sendQuery args."); - } - const receipt = await axiom.sendQuery(); - expect(receipt.status).toBe('success'); - - const queryInitiatedOnChainEvent = receipt.logs[1]; - const onchainQueryId = queryInitiatedOnChainEvent.topics[3]; - expect(bytes32(args.queryId)).toEqual(onchainQueryId); - }, 90000); -}); diff --git a/client/test/integration/quickstart.test.ts b/client/test/integration/quickstart.test.ts deleted file mode 100644 index 26ee6f79..00000000 --- a/client/test/integration/quickstart.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Axiom } from "../../src"; -import { generateCircuit } from "./circuitTest"; - -describe("Quickstart", () => { - test("Quickstart query", async () => { - const { circuit, compiledCircuit, inputs } = await generateCircuit("quickstart/average"); - - const axiom = new Axiom({ - circuit, - compiledCircuit, - chainId: "11155111", // Sepolia - provider: process.env.PROVIDER_URI_SEPOLIA as string, - privateKey: process.env.PRIVATE_KEY_SEPOLIA as string, - callback: { - target: "0x4A4e2D8f3fBb3525aD61db7Fc843c9bf097c362e", - }, - }); - await axiom.init(); - await axiom.prove(inputs); - const receipt = await axiom.sendQuery(); - expect(receipt.status).toBe('success'); - }, 90000); -}); diff --git a/client/test/integration/readme.md b/client/test/integration/readme.md index b1bbf45d..26302977 100644 --- a/client/test/integration/readme.md +++ b/client/test/integration/readme.md @@ -1,3 +1,3 @@ # Client SDK Integration Tests -**NOTE:** Imports in the integration tests use `@axiom-crypto/circuit` instead of `@axiom-crypto/client`. +Integration tests should be run via the test harness. See `/harness/test/integration`. diff --git a/client/test/integration/sendQuery.test.ts b/client/test/integration/sendQuery.test.ts deleted file mode 100644 index 867daabb..00000000 --- a/client/test/integration/sendQuery.test.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Axiom } from "../../src"; -import { generateCircuit } from "./circuitTest"; - -describe("Send Query using Axiom client", () => { - test("Send a query", async () => { - const { circuit, compiledCircuit, inputs } = await generateCircuit("sendQuery/average"); - - const axiom = new Axiom({ - circuit, - compiledCircuit, - chainId: "11155111", // Sepolia - provider: process.env.PROVIDER_URI_SEPOLIA as string, - privateKey: process.env.PRIVATE_KEY_SEPOLIA as string, - callback: { - target: "0x4A4e2D8f3fBb3525aD61db7Fc843c9bf097c362e", - }, - }); - await axiom.init(); - await axiom.prove(inputs); - if (!process.env.PRIVATE_KEY_SEPOLIA) { - console.log("No private key provided: Query will not be sent to the blockchain."); - return; - } - const receipt = await axiom.sendQuery(); - expect(receipt.status).toBe('success'); - }, 90000); -}); \ No newline at end of file diff --git a/client/test/integration/sendQueryIpfs.test.ts b/client/test/integration/sendQueryIpfs.test.ts deleted file mode 100644 index c60460bf..00000000 --- a/client/test/integration/sendQueryIpfs.test.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { Axiom } from "../../src"; -import { PinataIpfsClient } from "@axiom-crypto/core"; -import { ByteStringReader, decodeFullQueryV2 } from "@axiom-crypto/core/packages/tools"; -import { getQueryHashV2, getDataQueryHashFromSubqueries } from "@axiom-crypto/tools"; -import { generateCircuit } from "./circuitTest"; - -describe("Send Query using Axiom client", () => { - test("Send a query with IPFS", async () => { - const { circuit, compiledCircuit, inputs } = await generateCircuit("sendQuery/average"); - - const ipfsClient = new PinataIpfsClient(process.env.PINATA_JWT as string); - - const axiom = new Axiom({ - circuit, - compiledCircuit, - chainId: "11155111", // Sepolia - provider: process.env.PROVIDER_URI_SEPOLIA as string, - privateKey: process.env.PRIVATE_KEY_SEPOLIA as string, - callback: { - target: "0x4A4e2D8f3fBb3525aD61db7Fc843c9bf097c362e", - }, - options: { - ipfsClient: ipfsClient, - }, - }); - await axiom.init(); - await axiom.prove(inputs); - if (!process.env.PRIVATE_KEY_SEPOLIA) { - console.log("No private key provided: Query will not be sent to the blockchain."); - return; - } - const receipt = await axiom.sendQueryWithIpfs(); - expect(receipt.status).toBe('success'); - - // Get the IPFS hash from the logs - const logData = receipt.logs[1].data; - const bsr = new ByteStringReader(logData); - bsr.readBytes(32); // skip the first 32 bytes - const ipfsHash = bsr.readBytes(32); - - // Read the data posted on IPFS and decode it - const pinata = new PinataIpfsClient(process.env.PINATA_JWT); - const readRes = await pinata.read(ipfsHash); - if (readRes.status - 200 > 99) { - throw new Error("Failed to read data from IPFS"); - } - console.log(readRes); - const decoded = decodeFullQueryV2(readRes.value as string); - if (!decoded) { - throw new Error("Failed to decode the data from IPFS"); - } - // const = decoded?.sourceChainId - const dataQueryHash = getDataQueryHashFromSubqueries(decoded.dataQuery.sourceChainId, decoded.dataQuery.subqueries); - const queryHash = getQueryHashV2(decoded.sourceChainId, dataQueryHash, decoded.computeQuery); - - const sendQueryArgs = axiom.getSendQueryArgs(); - if (!sendQueryArgs) { - throw new Error("Failed to get sendQueryArgs"); - } - - expect(queryHash).toEqual(sendQueryArgs.args[0]); - }, 90000); -}); diff --git a/client/test/unit/axiom/axiom.test.ts b/client/test/unit/axiom/axiom.test.ts new file mode 100644 index 00000000..9d5a9bcf --- /dev/null +++ b/client/test/unit/axiom/axiom.test.ts @@ -0,0 +1,83 @@ +import { Axiom } from '../../../src/axiom/axiom'; +import { circuit } from "../../circuits/quickstart/average.circuit"; +import compiledCircuit from "../../circuits/quickstart/average.compiled.json"; +import { viemChain } from '../../../src/lib/viem'; +import { createPublicClient, http } from 'viem'; +import { AxiomV2QueryOptions } from '../../../src'; + +const chainId = process.env.CHAIN_ID || "11155111" +const provider = process.env[`PROVIDER_URI_${chainId}`] as string; + +describe('Axiom class tests', () => { + const config = { + chainId, + provider, + circuit, + compiledCircuit, + callback: { + target: '0x4A4e2D8f3fBb3525aD61db7Fc843c9bf097c362e', + }, + }; + + test('should initialize correctly', async () => { + const axiom = new Axiom(config); + expect(axiom).toBeInstanceOf(Axiom); + }); + + test('setOptions should update options correctly', () => { + const axiom = new Axiom(config); + const newOptions: AxiomV2QueryOptions = { callbackGasLimit: 500000 }; + axiom.setOptions(newOptions); + expect(axiom.getOptions()).toMatchObject(newOptions); + }); + + test('sendQuery should fail without built args', async () => { + const axiom = new Axiom(config); + await expect(axiom.sendQuery()).rejects.toThrow('SendQuery args have not been built yet. Please run `prove` first.'); + }); + + test('prove should build sendQuery args correctly', async () => { + const axiom = new Axiom({ + ...config, + privateKey: process.env.PRIVATE_KEY_ANVIL as string, + }); + const inputs = { + blockNumber: 4000000, + address: "0xEaa455e4291742eC362Bc21a8C46E5F2b5ed4701", + }; + await axiom.init(); + await axiom.prove(inputs); + const args = axiom.getSendQueryArgs(); + expect(args?.args[0]).toEqual(chainId); + expect(args?.args[2].resultLen).toEqual(3); + expect(args?.args[3].target).toEqual(config.callback.target.toLowerCase()); + expect(args?.args[6]).toEqual("0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"); + }, 40000); + + test('sendQueryWithIpfs should throw error without ipfsClient', async () => { + const axiom = new Axiom({ + ...config, + privateKey: process.env.PRIVATE_KEY_ANVIL as string, + }); + await expect(axiom.sendQueryWithIpfs()).rejects.toThrow("Setting `ipfsClient` is required to send a Query with IPFS"); + }); + + test('should build sendQuery with custom refundee', async () => { + const axiom = new Axiom({ + ...config, + privateKey: process.env.PRIVATE_KEY_ANVIL as string, + options: { + refundee: "0x000000000000000000000000000000000000aabb", + }, + }); + const inputs = { + blockNumber: 4000000, + address: "0xEaa455e4291742eC362Bc21a8C46E5F2b5ed4701", + }; + await axiom.init(); + await axiom.prove(inputs); + const args = axiom.getSendQueryArgs(); + expect(args?.args[6]).toEqual("0x000000000000000000000000000000000000aabb"); + }, 40000); +}); + diff --git a/client/test/unit/axiom/inputSchema.test.ts b/client/test/unit/axiom/inputSchema.test.ts deleted file mode 100644 index c32ef055..00000000 --- a/client/test/unit/axiom/inputSchema.test.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { convertInputSchemaToJsonString } from "../../../src/axiom/utils"; - -describe("Input schema tests", () => { - test("validate input schema transform", async () => { - let inputSchema = convertInputSchemaToJsonString({ - claimedBlockNumber: "uint32", - abort: "bytes32", - argo: "int224[]", - test: "uint256[]", - }); - let expectedOutput = '{\n "claimedBlockNumber": "CircuitValue",\n "abort": "CircuitValue256",\n "argo": "CircuitValue[]",\n "test": "CircuitValue256[]"\n}'; - expect(inputSchema).toEqual(expectedOutput); - - inputSchema = convertInputSchemaToJsonString({ - blockNumber: "uint32", - address: "address", - }); - expectedOutput = '{\n "blockNumber": "CircuitValue",\n "address": "CircuitValue"\n}'; - expect(inputSchema).toEqual(expectedOutput); - }); -}); \ No newline at end of file diff --git a/client/test/unit/circuits/average.compiled.json b/client/test/unit/circuits/average.compiled.json deleted file mode 100644 index 710ccef4..00000000 --- a/client/test/unit/circuits/average.compiled.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "vk": "Ag0AAAAABgAAAKdY0S2x49O88WffhIg6j+sI1Nhyl5stleJlyqOU4a4YI3l5FcT4uSbnhps89EEvH7Pl4PdxSKEhmsm6qRblcCQVgXLM4obm5Lk6ap7FB6/9by2ZeNBW+s3zUP4Tjs8zFwUJeY5o0HbwT8zy8/+AfM2INbHJvHk8PKCOs4WFSqAc/vGqIp67oJ8uQuSVU6bTUlxF+PMTDb+ftpQZsrU62A99kpXyg32AfrmozWbZbJJQCdsmAATcH2t3dMs9sq1WDgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB+iw7aQ1yOTPFMoosESOKg1wEi3YTO7f1cWja0lCYMGach/muGTfZjWxeQGP5FRFbvvMeu9C9Rpj7mnAIioGge5Y4eyFqcWBb398AVAY1OV4hvhUz/GR9leHrjGvCVLC71WbmQ3qAvh2ZDO507QY1tuVVcG9qEES/IwVWjtM4MvNbkFZydC5AcudVP5ZXNpqh3VLZRV19ozwxNdZOd37y0LaVF9cdNxt8uBTro5G1nsbb3AAQSxhe5Ljm1KdHVRCMVaeC9tQ0w3NfPHRq1jJLc4gGmnkzh87EMghDb9tZohFxr4MAIY0dDW1Ud4bWbSs1Kf/wBRxHbvRBf8KXfImCeQ8abjs9k3ton3Trhk72vHrvJzzqyaX6Z2h9hMz+bpDZRnQtfr+JQ1bgNokpaNGYut/YrC6d4EAUolcHdxVmQmPwQoTpUYgwd30W1X/ucY5o3aHbL3VX3IyACsIWP0/ibdRKvKAqHvu3u1Ikm++E92gpGZvIieJ6T8yIFYiE+rJZq41Bmcdozx2l0w5M5LURajabU/ITU4mfgbHBG9xFwGbAUsUIVDc3LmCzDIulhHTvnjSfZ1WFZcNmXMewuADSY=", - "config": { - "k": 13, - "numAdvice": 4, - "numLookupAdvice": 1, - "numInstance": 1, - "numLookupBits": 12, - "numVirtualInstance": 2 - }, - "capacity": { - "maxOutputs": 128, - "maxSubqueries": 128 - }, - "querySchema": "0xa44ce4065d6d6db90c3844966dd0a804e28cc5b8e9e02ca38d10e33a4a33ef97", - "inputSchema": "eyJibG9ja051bWJlciI6IkNpcmN1aXRWYWx1ZSIsImFkZHJlc3MiOiJDaXJjdWl0VmFsdWUifQ==", - "circuit": "Y29uc3QgY2lyY3VpdF8xID0gQVhJT01fQ0xJRU5UX0lNUE9SVAphc3luYyAoaW5wdXRzKSA9PiB7CiAgICAvLyBOdW1iZXIgb2Ygc2FtcGxlcyB0byB0YWtlLiBOb3RlIHRoYXQgdGhpcyBtdXN0IGJlIGEgY29uc3RhbnQgdmFsdWUgYW5kIE5PVCBhbiBpbnB1dCBiZWNhdXNlIHRoZSBzaXplIG9mIAogICAgLy8gdGhlIGNpcmN1aXQgbXVzdCBiZSBrbm93biBhdCBjb21waWxlIHRpbWUuCiAgICBjb25zdCBzYW1wbGVzID0gODsKICAgIC8vIE51bWJlciBvZiBibG9ja3MgYmV0d2VlbiBlYWNoIHNhbXBsZS4KICAgIGNvbnN0IHNwYWNpbmcgPSA5MDA7CiAgICAvLyBWYWxpZGF0ZSB0aGF0IHRoZSBibG9jayBudW1iZXIgaXMgZ3JlYXRlciB0aGFuIHRoZSBudW1iZXIgb2Ygc2FtcGxlcyB0aW1lcyB0aGUgc3BhY2luZwogICAgaWYgKGlucHV0cy5ibG9ja051bWJlci52YWx1ZSgpIDw9IChzYW1wbGVzICogc3BhY2luZykpIHsKICAgICAgICB0aHJvdyBuZXcgRXJyb3IoIkJsb2NrIG51bWJlciBtdXN0IGJlIGdyZWF0ZXIgdGhhbiB0aGUgbnVtYmVyIG9mIHNhbXBsZXMgdGltZXMgdGhlIHNwYWNpbmciKTsKICAgIH0KICAgIC8vIFBlcmZvcm0gdGhlIGJsb2NrIG51bWJlciB2YWxpZGF0aW9uIGluIHRoZSBjaXJjdWl0IGFzIHdlbGwKICAgICgwLCBjaXJjdWl0XzEuY2hlY2tMZXNzVGhhbikoKDAsIGNpcmN1aXRfMS5tdWwpKHNhbXBsZXMsIHNwYWNpbmcpLCBpbnB1dHMuYmxvY2tOdW1iZXIpOwogICAgLy8gR2V0IGFjY291bnQgYmFsYW5jZSBhdCB0aGUgc2FtcGxlIGJsb2NrIG51bWJlcnMKICAgIGxldCBzYW1wbGVkQWNjb3VudHMgPSBuZXcgQXJyYXkoc2FtcGxlcyk7CiAgICBmb3IgKGxldCBpID0gMDsgaSA8IHNhbXBsZXM7IGkrKykgewogICAgICAgIGNvbnN0IHNhbXBsZUJsb2NrTnVtYmVyID0gKDAsIGNpcmN1aXRfMS5zdWIpKGlucHV0cy5ibG9ja051bWJlciwgKDAsIGNpcmN1aXRfMS5tdWwpKHNwYWNpbmcsIGkpKTsKICAgICAgICBjb25zdCBhY2NvdW50ID0gKDAsIGNpcmN1aXRfMS5nZXRBY2NvdW50KShzYW1wbGVCbG9ja051bWJlciwgaW5wdXRzLmFkZHJlc3MpOwogICAgICAgIHNhbXBsZWRBY2NvdW50c1tpXSA9IGFjY291bnQ7CiAgICB9CiAgICAvLyBBY2N1bXVsYXRlIGFsbCBvZiB0aGUgYmFsYW5jZXMgdG8gYHRvdGFsYAogICAgbGV0IHRvdGFsID0gKDAsIGNpcmN1aXRfMS5jb25zdGFudCkoMCk7CiAgICBmb3IgKGNvbnN0IGFjY291bnQgb2Ygc2FtcGxlZEFjY291bnRzKSB7CiAgICAgICAgY29uc3QgYmFsYW5jZSA9IGF3YWl0IGFjY291bnQuYmFsYW5jZSgpOwogICAgICAgIHRvdGFsID0gKDAsIGNpcmN1aXRfMS5hZGQpKHRvdGFsLCBiYWxhbmNlLnRvQ2lyY3VpdFZhbHVlKCkpOwogICAgfQogICAgLy8gRGl2aWRlIHRoZSB0b3RhbCBhbW91bnQgYnkgdGhlIG51bWJlciBvZiBzYW1wbGVzIHRvIGdldCB0aGUgYXZlcmFnZSB2YWx1ZQogICAgY29uc3QgYXZlcmFnZSA9ICgwLCBjaXJjdWl0XzEuZGl2KSh0b3RhbCwgc2FtcGxlcyk7CiAgICAvLyBXZSBjYWxsIGBhZGRUb0NhbGxiYWNrYCBvbiBhbGwgdmFsdWVzIHRoYXQgd2Ugd291bGQgbGlrZSB0byBiZSBwYXNzZWQgdG8gb3VyIGNvbnRyYWN0IGFmdGVyIHRoZSBjaXJjdWl0IGhhcwogICAgLy8gYmVlbiBwcm92ZW4gaW4gWksuIFRoZSB2YWx1ZXMgY2FuIHRoZW4gYmUgaGFuZGxlZCBieSBvdXIgY29udHJhY3Qgb25jZSB0aGUgcHJvdmVyIGNhbGxzIHRoZSBjYWxsYmFjayBmdW5jdGlvbi4KICAgICgwLCBjaXJjdWl0XzEuYWRkVG9DYWxsYmFjaykoaW5wdXRzLmJsb2NrTnVtYmVyKTsKICAgICgwLCBjaXJjdWl0XzEuYWRkVG9DYWxsYmFjaykoaW5wdXRzLmFkZHJlc3MpOwogICAgKDAsIGNpcmN1aXRfMS5hZGRUb0NhbGxiYWNrKShhdmVyYWdlKTsKfQ==" -} \ No newline at end of file diff --git a/client/test/unit/lib/paymentCalc/base.test.ts b/client/test/unit/lib/paymentCalc/base.test.ts index 9df78880..6746215a 100644 --- a/client/test/unit/lib/paymentCalc/base.test.ts +++ b/client/test/unit/lib/paymentCalc/base.test.ts @@ -1,11 +1,13 @@ import { Axiom, getOpStackL1BlockAttributesAbi, getOpStackL1BlockAttributesAddress } from "../../../../src"; import { createPublicClient, http } from "viem"; import { viemChain } from "../../../../src/lib/viem"; -import { circuit } from "../../../integration/circuits/quickstart/average.circuit"; -import compiledCircuit from "../../circuits/average.compiled.json"; -import inputs from "../../../integration/circuits/quickstart/average.inputs.json"; -import { ClientConstants } from "../../../../src/constants"; +import { circuit } from "../../../circuits/quickstart/average.circuit"; +import compiledCircuit from "../../../circuits/quickstart/average.compiled.json"; +import inputs from "../../../circuits/quickstart/11155111/average.inputs.json"; import { getChainDefaults } from "../../../../src/lib/chain"; +import { ClientConstants } from "../../../../src/lib/constants"; + +const DIFF_THRESHOLD_X100 = 800n; // 8% describe("PaymentCalc: Base", () => { const CHAIN_ID = "84532"; // Base Sepolia @@ -105,8 +107,8 @@ describe("PaymentCalc: Base", () => { const queryCost = calculateQueryCost(basefee, baseFeeScalar, blobBaseFee, blobBaseFeeScalar, maxFeePerGas, callbackGasLimit, proofVerificationGas); let percentDiff = percentDiffX100(queryCost, BigInt(args?.value ?? 0)); - expect(percentDiff).toBeLessThan(500n); // 5% - }, 20000); + expect(percentDiff).toBeLessThan(DIFF_THRESHOLD_X100); + }, 30000); test("Payment calculation high based on options", async () => { const maxFeePerGas = 500000000000n; @@ -133,8 +135,8 @@ describe("PaymentCalc: Base", () => { const queryCost = calculateQueryCost(basefee, baseFeeScalar, blobBaseFee, blobBaseFeeScalar, maxFeePerGas, callbackGasLimit, proofVerificationGas); let percentDiff = percentDiffX100(queryCost, BigInt(args?.value ?? 0)); - expect(percentDiff).toBeLessThan(500n); // 5% - }, 20000); + expect(percentDiff).toBeLessThan(DIFF_THRESHOLD_X100); + }, 30000); test("Payment calculation low based on options", async () => { const maxFeePerGas = 5000000000n; @@ -161,8 +163,8 @@ describe("PaymentCalc: Base", () => { const queryCost = calculateQueryCost(basefee, baseFeeScalar, blobBaseFee, blobBaseFeeScalar, maxFeePerGas, callbackGasLimit, proofVerificationGas); let percentDiff = percentDiffX100(queryCost, BigInt(args?.value ?? 0)); - expect(percentDiff).toBeLessThan(500n); // 5% - }, 20000); + expect(percentDiff).toBeLessThan(DIFF_THRESHOLD_X100); + }, 30000); test("Set overrideAxiomQueryFee greater than standard payment", async () => { const maxFeePerGas = 5000000000n @@ -187,7 +189,7 @@ describe("PaymentCalc: Base", () => { await axiom.prove(inputs); const args = axiom.getSendQueryArgs(); expect(args?.value).toEqual(502600000000000000n); - }, 20000); + }, 30000); test("Set overrideAxiomQueryFee less than standard payment", async () => { const maxFeePerGas = 5000000000n; @@ -214,6 +216,6 @@ describe("PaymentCalc: Base", () => { const queryCost = calculateQueryCost(basefee, baseFeeScalar, blobBaseFee, blobBaseFeeScalar, maxFeePerGas, callbackGasLimit, proofVerificationGas); let percentDiff = percentDiffX100(queryCost, BigInt(args?.value ?? 0)); - expect(percentDiff).toBeLessThan(500n); // 5% - }, 20000); + expect(percentDiff).toBeLessThan(DIFF_THRESHOLD_X100); + }, 30000); }); \ No newline at end of file diff --git a/client/test/unit/lib/paymentCalc/ethereum.test.ts b/client/test/unit/lib/paymentCalc/ethereum.test.ts index 98541b03..53c39483 100644 --- a/client/test/unit/lib/paymentCalc/ethereum.test.ts +++ b/client/test/unit/lib/paymentCalc/ethereum.test.ts @@ -1,9 +1,9 @@ import { Axiom } from "../../../../src"; import { createPublicClient, http } from "viem"; import { viemChain } from "../../../../src/lib/viem"; -import { circuit } from "../../../integration/circuits/quickstart/average.circuit"; -import compiledCircuit from "../../circuits/average.compiled.json"; -import inputs from "../../../integration/circuits/quickstart/average.inputs.json"; +import { circuit } from "../../../circuits/quickstart/average.circuit"; +import compiledCircuit from "../../../circuits/quickstart/average.compiled.json"; +import inputs from "../../../circuits/quickstart/11155111/average.inputs.json"; describe("PaymentCalc: Ethereum", () => { const CHAIN_ID = "11155111"; @@ -30,7 +30,7 @@ describe("PaymentCalc: Ethereum", () => { await axiom.prove(inputs); const args = axiom.getSendQueryArgs(); expect(args?.value).toEqual(5600000000000000n); - }, 20000); + }, 30000); test("Payment calculation high based on options", async () => { const axiom = new Axiom({ @@ -51,7 +51,7 @@ describe("PaymentCalc: Ethereum", () => { await axiom.prove(inputs); const args = axiom.getSendQueryArgs(); expect(args?.value).toEqual(500213000000000000000n); - }, 20000); + }, 30000); test("Payment calculation low based on options", async () => { const axiom = new Axiom({ @@ -72,7 +72,7 @@ describe("PaymentCalc: Ethereum", () => { await axiom.prove(inputs); const args = axiom.getSendQueryArgs(); expect(args?.value).toEqual(5105000000000000n); - }, 20000); + }, 30000); test("Set overrideAxiomQueryFee greater than standard payment", async () => { const axiom = new Axiom({ @@ -93,7 +93,7 @@ describe("PaymentCalc: Ethereum", () => { await axiom.prove(inputs); const args = axiom.getSendQueryArgs(); expect(args?.value).toEqual(52600000000000000n); - }, 20000); + }, 30000); test("Set overrideAxiomQueryFee less than standard payment", async () => { const axiom = new Axiom({ @@ -114,5 +114,5 @@ describe("PaymentCalc: Ethereum", () => { await axiom.prove(inputs); const args = axiom.getSendQueryArgs(); expect(args?.value).toEqual(5600000000000000n); - }, 20000); + }, 30000); }); \ No newline at end of file diff --git a/client/test/unit/queryBuilderClient/queryBuilderOptions.test.ts b/client/test/unit/queryBuilderClient/queryBuilderOptions.test.ts new file mode 100644 index 00000000..813155af --- /dev/null +++ b/client/test/unit/queryBuilderClient/queryBuilderOptions.test.ts @@ -0,0 +1,66 @@ +import { ethers } from "ethers"; +import { QueryBuilderClient, QueryBuilderClientConfig } from "../../../src"; +import { HeaderField } from "@axiom-crypto/circuit"; +import { ConstantsV2 } from "../../../../circuit/src/queryBuilderBase/constants"; +import { Subquery } from "@axiom-crypto/tools"; + +// Test coverage areas: +// - QueryBuilderV2 options + +describe("QueryBuilderV2 Options", () => { + const config: QueryBuilderClientConfig = { + providerUri: process.env.PROVIDER_URI_MAINNET as string, + caller: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + sourceChainId: 1, + version: "v2", + }; + const wallet = new ethers.Wallet( + process.env.PRIVATE_KEY_ANVIL as string, + new ethers.JsonRpcProvider(process.env.PROVIDER_URI_MAINNET as string), + ); + const blockNumber = 18300000; + + test("set maxFeePerGas", async () => { + const axiom = new QueryBuilderClient(config); + axiom.appendDataSubquery({ + blockNumber, + fieldIdx: HeaderField.Timestamp, + } as Subquery); + axiom.setOptions({ + maxFeePerGas: "1000000000000", + }); + const builtQuery = await axiom.build(); + expect(builtQuery.feeData.maxFeePerGas).toEqual("1000000000000"); + expect(builtQuery.feeData.callbackGasLimit).toEqual(ConstantsV2.DefaultCallbackGasLimit); + expect(builtQuery.feeData.overrideAxiomQueryFee).toEqual("0"); + }); + + test("set callbackGasLimit", async () => { + const axiom = new QueryBuilderClient(config); + axiom.appendDataSubquery({ + blockNumber, + fieldIdx: HeaderField.Timestamp, + } as Subquery); + axiom.setOptions({ + callbackGasLimit: 10000, + }); + const builtQuery = await axiom.build(); + expect(builtQuery.feeData.maxFeePerGas).toEqual(ConstantsV2.DefaultMaxFeePerGasWei); + expect(builtQuery.feeData.callbackGasLimit).toEqual(10000); + expect(builtQuery.feeData.overrideAxiomQueryFee).toEqual("0"); + expect(builtQuery.refundee).toEqual((await wallet.getAddress()).toLowerCase()); + }); + + test("set refundee", async () => { + const axiom = new QueryBuilderClient({...config, refundee: "0xe76a90E3069c9d86e666DcC687e76fcecf4429cF"}); + axiom.appendDataSubquery({ + blockNumber, + fieldIdx: HeaderField.Timestamp, + } as Subquery); + const builtQuery = await axiom.build(); + expect(builtQuery.feeData.maxFeePerGas).toEqual(ConstantsV2.DefaultMaxFeePerGasWei); + expect(builtQuery.feeData.callbackGasLimit).toEqual(ConstantsV2.DefaultCallbackGasLimit); + expect(builtQuery.feeData.overrideAxiomQueryFee).toEqual("0"); + expect(builtQuery.refundee).toEqual("0xe76a90e3069c9d86e666dcc687e76fcecf4429cf"); + }); +}); diff --git a/client/test/unit/queryBuilderClient/queryParams.test.ts b/client/test/unit/queryBuilderClient/queryParams.test.ts new file mode 100644 index 00000000..ad1c6e78 --- /dev/null +++ b/client/test/unit/queryBuilderClient/queryParams.test.ts @@ -0,0 +1,201 @@ +import { bytes32, HeaderField, Subquery } from "@axiom-crypto/tools"; +import { + AxiomV2Callback, + AxiomV2ComputeQuery, + AxiomV2DataQuery, + QueryBuilderClient, + QueryBuilderClientConfig, +} from "../../../src"; + +// Test coverage areas: +// - QueryID +// - QuerySchema + +describe("Query ID and Schema calculation", () => { + const config: QueryBuilderClientConfig = { + providerUri: process.env.PROVIDER_URI_MAINNET as string, + caller: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + sourceChainId: 1, + version: "v2", + }; + + const callback: AxiomV2Callback = { + target: "0x41a7a901ef58d383801272d2408276d96973550d", + extraData: bytes32("0xbbd0d3671093a36d6e3b608a7e3b1fdc96da1116"), + }; + + test("get query ID and querySchema for simple computeQuery with dataQuery", async () => { + const computeQuery: AxiomV2ComputeQuery = { + k: 13, + resultLen: 1, + vkey: [ + "0x83b88c6080be442679432e6c5634a3e3a7a26051a3b2581fba85dba0973fca20", + "0xc04b25057d0bddf35d4542077516abb76445b8e745a457e3ccc1bf9aac2ba406", + "0xa471542dc1c798279c6e094f7fae5174d83d5bd4f419d39f38a18a6aadadef23", + "0xa17889e08418a09cecdac9afac9ddb4d839a56cc50205cd8df90ab459f53e900", + "0x0000000000000000000000000000000000000000000000000000000000000080", + "0x0000000000000000000000000000000000000000000000000000000000000080", + "0x0000000000000000000000000000000000000000000000000000000000000080", + "0xdaa121f99b66245770900bec7f7df67ba081c1ea1ec4e85de531e5efcb05dc2b", + "0x72e95e6a67298de4d3da26492ee511e5b88295db678f739edb226e7947d38d0b", + "0x22e4c62aacfc240ed0553bfad00122ba8c7627c870c739f3f818584e066a8b1f", + "0x841485e0a9f109688bdc4f5ff851d9e2e44833ae573456742c1237322e938542", + "0x79a62f1cc2f1440cc9fdcd534b612a49da4b6139bbed8cf53a26f4568ac3f567", + "0x1c5846bb7c78a94b984ed2e0296334dd93085bdb3cbe3e69f89772ba64fa102c", + "0xb9681242289c63756173eed28ce8ff44a71fe1fcf683bd07fcd70fdaede5b769", + ], + computeProof: + "0x0000000000000000000000000000000000000000000000008713ff58e11eda2c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b742e3f91720ab2f43ece6b297314a246a28e8a37718433aee65e2452a1ebc57f4ca1a1e173855eaa5a9fbb74f96343f20e26d3d3ead44407e2e762f51ec4d0ed9b0aef7e5779df902223b4830ed0d12a02b950758107e35e5518d878cbff12da8658a104bf75f18aa7e3addaa8f4eaed64a353795f6e79b5faa6a633c3af06c2fb71ba568306ab02ca08f5a3a781b41f88696d30919d6bb1f849332d89f180065d76a0f0cbd417968fec77aee71be48054fcb4e6558be00fdce9a27a94aad593889074e456d9c1604b89eace24329a1e70091eaa7de84f0b5003719d5f4a7426599d89656cc63b4fe5889cbef9822b8bc72b13f5c17ce053168c479122de0024d54935ef42eacea4bcd71212dd3df7915258bb6b7e10b4fcba0cda608359a60e25ce4db9a4781e37fd89aa45b72b837bfedf2270abe6a71e39eb8a35bdbad1e967b1bc90fa8acee63c07191105168642f1d8b155342f1e0496ce9da38eade6bf41ba260e495de52802e49fa3cdc8df28a35b17c9d70420952e37034abfac36d7ab7dd54e0eccab23dcc53c12d0477046f6232c6e2b969eb38d432277ec24270e971c3d634f961848bbc9ae1a2e3c240056d3cd6f05cce571a417eeaf01c446fd30244b86c099a4c33d65f7b584152a3af87506b76c7ca75d4c1026becbf293003fbf082a70a5f59c8e04d4ff7ff6765c15881ece1da60dfd929e32c755239230bf43fc4550991af513d27dd6d6eaaf6722815574f6dfda59d2ccacf21f366037c7d3e718e28bc938f2f0bcc531106a6c080b1668af4cd43a1e78b6be2826b084788029be51d8e6a2c28aa3ff6a40a8cfad83258c9de474b927e9ab690760d159d29f54bcd509d436a9b5f9b823210ebc7270ed35a847e6a69a2c0144cb34d22cb4188b51dd1f066e2b81a8ca6b0eb71a63d70dc58cd6d6052c399afc220bd211595f31aa97ff14841347122e0339220f5d54e53fbf1637c9e06623279d27f11f855dc69c96c75d5c6eae7405d2818a9c3d23d278a98370d051cc807998374170c6b334eec536d0908e778e05f09dad697e6600b65664d452d95eccb96cfc1056dba89a96e878acf151abe100ba0bb9b5d312f78f71593b3362439beca96fb04d9e81ddf083b8d8d27761815149917c987b2f20d33fac83382bc3bbb06429c2c0fecd6ce7dc5dec284247b52df9c40eeda443cd2251f03dd7c273861a3416a102b62251dc9e7c2e5a31af17cf61e42ca536353041ff1e5c8250de0e4e3abbf268b59c095f2ac631d4d8096372bca388ab6d8a0fb65dede8377c79e8b7f7d900740e401f41adcbc17099e7aa8d460a5b83c4fad9778e47962049c22fdb3aaf51cff60d8b2f8f334918a30decf3e037a7a8c0e82f59164bdb64e39adfa8a63db052c82399a620c80d95bafcb87979a4de501948c0f1d3484f10c1a5ec4062e7f034043b6bc02b2e3b8827173e885cb1acbd835742c7cd7efcb96e4eddbf7831d1c1a7db7eb87c2949a9fdeccca48a072dcad163472f202312772eee02a1c3fd012d6b993f8a9f3f0948057f2cde182945fbf1c953fb6413a099180312c78da471289c0fa64c7c0228d79d7e432cfd00ef50973db40566a71221c1a0b89e6084526000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000de97f1ddfb2158546e5e03072fecbbe020f0dbd3de37507743e2fa0ebad01f1c90dabcf0e87726d1c855b8740ba4bd58e976a816d798c06a76eca992b5694f2e340984db397c67b1cff836cfe8511334d80b313b5b167849ac88bf68c7f9f11126a1dd52e4a44dbc34111734e572e47a6fcf395f1af6bc1ecd4513588038f51a5bdfc30a8b7eeb2bad8c6d353f405b65ca3644935ee6ce7b451420f6d7821c15c026098859e9e7ef0802201bb1d18cec3628d18858e307d8fc450cc487c3ed0e2ea995450e7d315de27bbe2dc3c984de54c4124fc5bfa316bab6782119610327f30bea752bc651ef7566c0a0b63019f80bba217203c82c9c81d9acb0ea60c01efddb1b4256395523642a5bc7d1b26a39326b7ae354a60bea41b514e8f1282312d26a6f35c969fa352d94a336118edd4cf01d9b84abdc817814d57cea99ac322ba025020705565ef4e356580bcaef735b1012bca412100c3a635d78a92683a12bfe47f0e03a21b89394bfb6a871da24eac0d61c38c7f3a0bb9dd80e2785065b157561e9f1c36d3f8002913bc37b2cda34d988af0154ce83536ba9b65093e61522927bc3c36119ca9d7cea8b57fda0957121358965c20f317ce227d816a411cd1daf43d3e16180dab1536b66944e96640f45b5583d4c351f72c126a02b995b102f1e4bc4a2d03b064cc6fdf6d8b0a919387002f22acfd6b6abb8676de7f4c8a607848a771aa2bea3f4d01d740a111e86282be89c83bf3ab7723fad017a453e6b07ac92550f2773027a09daf2c71030dce29042b7fa9d0e79a634b2990e49121510653a0d3a6939258ea5727164cc3ac9c8056391c0f3dae76a8eb6af86ee0c022a6abaf06d576ec79280cf5fdab040eb85b0bf89b0201b7cc39661671fe6f17b23b07a252e1da57576842a4c751ba7ed0a1e353e42acc64d97be8207ce9257d00ec9735011e00a5edba5dbbd8d7124911639526b0563911179c7bb6765745c6b0a10f7e06499deb91e71b5d52213b973cd761105e5950009e8a96b75c721f89c2f0e7e87d280431249edbaabe885198349651032396cb30bb20942d700abb8da2c0df5c2d5361dc487452cd3d7d5ea5da9a6b2fcceb8b49a4b84be63caf4fdce0e4e13218cbcdca3bc55a05981a169890efc7c8906500140c9c51aa75490d7c41e", + }; + const dataQuery: AxiomV2DataQuery = { + sourceChainId: "5", + subqueries: [ + { + subqueryData: { blockNumber: 9900000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as Subquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9899000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as Subquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9898000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as Subquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9897000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as Subquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9896000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as Subquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9895000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as Subquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9894000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as Subquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9893000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as Subquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9892000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as Subquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9891000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as Subquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9890000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as Subquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9889000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as Subquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9888000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as Subquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9887000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as Subquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9886000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as Subquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9885000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as Subquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9884000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as Subquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9883000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as Subquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9882000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as Subquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9881000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as Subquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9880000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as Subquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9879000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as Subquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9878000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as Subquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9877000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as Subquery, + type: 2, + }, + { + subqueryData: { blockNumber: 9876000, addr: "0xb392448932f6ef430555631f765df0dfae34eff3", fieldIdx: 1 } as Subquery, + type: 2, + }, + ], + }; + const axiom = new QueryBuilderClient(config); + axiom.setBuiltDataQuery(dataQuery); + axiom.setComputeQuery(computeQuery); + axiom.setCallback(callback); + const builtQuery = await axiom.build(); + if (builtQuery === undefined) { + throw new Error("builtQuery is undefined"); + } + builtQuery.userSalt = bytes32(1); // lock the salt value for consistent results + + const querySchema = builtQuery.querySchema; + expect(querySchema).toEqual("0x412efc8f4184ff6cb59c65113d3e64ddfdc521b3dd083bd076aecec735fb6e98"); + + const queryId = await axiom.getQueryId(); + expect(queryId).toEqual("89525960724271132278334995917248842528153283060108231237459388983234366061533"); + }); + + test("queryId should change with different caller", async () => { + const blockNumber = 18400000; + const dataQueryReq = [ + { + blockNumber: blockNumber, + fieldIdx: HeaderField.GasUsed, + } as Subquery, + { + blockNumber: blockNumber + 1000, + fieldIdx: HeaderField.GasUsed, + } as Subquery, + ]; + const axiom = new QueryBuilderClient(config); + axiom.append(dataQueryReq); + axiom.setCallback(callback); + + await axiom.build(); + const builtQuery = axiom.getBuiltQuery(); + if (builtQuery === undefined) { + throw new Error("builtQuery is undefined"); + } + builtQuery.userSalt = bytes32(1); // lock the salt value for consistent results + + let queryId = await axiom.getQueryId(); + expect(queryId).toEqual("98889725304317068813202880468729579267735358960168967565344125062025862943344"); + + queryId = await axiom.getQueryId("0x41a7a901ef58d383801272d2408276d96973550d"); + expect(queryId).toEqual("62886233841812629436578595916260905602794710735771458585228955613176673015071"); + }); +}); diff --git a/client/test/unit/queryBuilderClient/queryV2.test.ts b/client/test/unit/queryBuilderClient/queryV2.test.ts new file mode 100644 index 00000000..728f45ed --- /dev/null +++ b/client/test/unit/queryBuilderClient/queryV2.test.ts @@ -0,0 +1,493 @@ +import { + AccountField, + AccountSubquery, + AxiomV2ComputeQuery, + DataSubquery, + DataSubqueryType, + HeaderField, + HeaderSubquery, + ReceiptField, + ReceiptSubquery, + SolidityNestedMappingSubquery, + StorageSubquery, + TxSubquery, + TxField, + AxiomV2Callback, +} from "@axiom-crypto/circuit"; +import { + getSlotForMapping, + getBlockNumberAndTxIdx, + getFieldIdxReceiptLogIdx, + getFieldIdxReceiptTopicIdx, + bytes32, + getEventSchema, +} from "@axiom-crypto/circuit/pkg/tools"; +import { ethers } from "ethers"; +import { QueryBuilderClient, QueryBuilderClientConfig, AxiomV2QueryOptions } from "../../../src"; +import { Subquery } from "@axiom-crypto/tools"; + +describe("QueryV2", () => { + const BLOCK_NUMBER = 15537394; + const WETH_ADDR = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"; + const WETH_WHALE = "0x2E15D7AA0650dE1009710FDd45C3468d75AE1392"; + const WSOL_ADDR = "0xd31a59c85ae9d8edefec411d448f90841571b89c"; + const UNI_V3_FACTORY_ADDR = "0x1F98431c8aD98523631AE4a59f267346ea31F984"; + + const provider = new ethers.JsonRpcProvider(process.env.PROVIDER_URI_MAINNET as string); + + const vkey = [ + "0x0000000e0000000609bddd9050d5cb871ead4831773e485d445bde72a636efda", + "0x1a1ce29363a95e142250c9b1df9fcc375c0b71f470588fa27fd57ad62b8cc3b8", + "0xaca6c8e6e65a5225833d35582dfe7f9fbdb28598e7d87261505ac67a26951b63", + "0x452351ddad76be162d068b32017323fa42cdbeb8882e6b9582277860c70eb6c4", + "0x8c39a3fa19ab7624b1c084dc9fcca92697d8d41620b2393d75f44573da6be049", + "0xcc79594db2d33d0b2adb2b256c968b17fc485d2105d46f7221d936f975fce7fd", + "0xa5b28db43392ab162e3fee98ae4b3b5935b6a8cd2b4cc8fc26d319b8cca11b05", + "0xb683ec6275cd9c146fc386defa21b217f145d3d8bff96a5ef1d2530dddeb53fd", + "0xd228c6a0da9844082e3fee98ae4b3b5935b6a8cd2b4cc8fc26d319b8cca11b05", + "0xb683ec6275cd9c146fc386defa21b217f145d3d8bff96a5ef1d2530dddeb53fd", + "0xd228c6a0da984408fcdcb0effeaf608e158bad39e70072d125e5b5ea83955ffb", + "0x519a816dfc19e1224006758437d363765499910d51df557f567e3d629fbd7967", + "0x6cd5aa11f6bcaf2e28e51fedd5bb63a14f5eb83b2ce83646742b81b1d31c9c27", + "0xa8642cfe25252a2f3ce91b8b813227e1249646be944066164de6bdca2160993f", + "0x647e99067fdcb308aa083ca60fd005a3426f1cdae3f61cd9cbf99a325dd10b9d", + "0x8bdf8050a2bf9e1925024beceabdb4b4911d011231b05c11cbea9de0a296a9a7", + "0xff37223fa4521324822bb6371579ee4d87fc23254bb027e326c7a60c83989daa", + "0xfb5d7cdca6f47902548b714abc5c49468e138847d3fd35a200d1c5240b1fb352", + "0xc8f988d6dadf7c12c9c899f8dfcd1b01a8497ee582027bdc6ad9995e6c6836d4", + "0x19ee3efcb9fc3908d65b2e0e1f1afb07e7f35cbfea5f0649c5e0fa2e50825254", + "0x4fabda276bdae80dc2d10c313afdca472b8d45c6c98872fb8d8b09bc88a77455", + "0xa4995ef6767e9b079e0425b2f369b67d1bdf0cba3a2681fd12b690922d42547e", + "0xe5d9d4dea6af9615aec2751eaac88b4bcf7969cca3e547bebd893d3f751abc05", + "0x8af761b646abf21daef711c3949c6f59999cf8d0b12c7c256700e6ec67350497", + "0x0bbab076c2dad81f826c6e91fed65b76616d54dfb63bd4c854b8e774554f2d5c", + "0xfa80f45234bb7103758da87d898e257c4bede49ce5365c6d7436b466a5c7f655", + "0x0e10dcf28e543323", + ]; + const computeProofRaw = [ + "0xf08a9fbf6aa1f3fb27851ff707d578c63969e8fc30499e992459e14105e03720", + "0xd93c948001512f47a1f4ee4e1302363d88c5df5d52a507ae9ecdd6043bb4cc2e", + "0x4819463c40c44377be16a3bc55f2a05308657483d6b19261fe180229a0cbc503", + "0xb90ca2c55f2dab164337f7503f109f617a3f914481761ef706fdfc42a7883915", + "0x5230666db2fcc516076061538fd01d7869b30567881cc34e05ecd123fb7d7999", + "0x894f3f36d1d5cd76a41dd27ac0098a844757515b9fd0a16b0a3a8e67947ac780", + "0x8189020b1c13c38731ad46af4699500e23ec90b77977669064b50500a77eec05", + "0x9e9c8f90974b04f35fcdc714509ca9a38abe8df61753cc4aefc61564331e8b16", + "0x6df183079bbf659093c8334e1a6bae21a719ba17b29d94ec7f1277fd27013f81", + "0xa20fb5ae56418e81ed9dedf3e708429fd5ad703cd7d49d6dabe947092bf12f87", + "0x823c310561b7f55a17a657aa87203eedf580b6fee639019fd23e36279b091b20", + "0x632debc513cf2897c18f4776d76d502333c8df622ff06a097ff2522eff34aa9b", + "0x09f19aac148f0b1169901ace4dc7d5924b436a9413ae16d3f67d6471e51571a4", + "0xac5dc971463c1e82b9368b0a80215ace2ee1a0494c59eec646e80f03b0db6592", + "0x3fd8d858a40199f75dbfa182bb9f0c880ca7942fdb2df30fe0119730442bf42f", + "0x18d483768799f9892f761ee6a046b5c6b984a173c5f5474b5a49dd3e9a0d3bab", + "0x6b033b106f8c6d51ce72616d71e041e54ea3da3ce7a5d2f075313ac1be439f02", + "0x5fffc0cf07ac33893ddf94fc1b25a4b8b073f15dcd95fc3484fe473e1072b205", + "0xdd6a2cb891ee443ecabbb84caee02cfca08870e5bb07cf096201ae9d0112b109", + "0x1ebb396036f43391ff39ff40c08acb10933891285b057d8672229af992ab7c08", + "0xe5cbd8a1a206897374a425297eac18e4087b26c0b5cfc9901c64dc2e016ae30d", + "0x220b6a7f35d58659fbb2038ca155d343f12d34ed35d8f6f3f0bdf78f297a1228", + "0x779822e0786a139fe3bcca766302847155bc8dec5f445a95e3da3b3d5ffd0323", + "0x5033c66364e6b862be706a082a294814dc3d2b7a808cc04527d22ec292d77716", + "0xe85decacc284a06bff5b45679379b7d9d85d26090209a80da085555df6ee1302", + "0xea1ffd2c0578cb5727984a3a5c77075546fd75931e04d7e44db3c3ea0f5b152f", + "0xffb162acdf5c846bd9bc331025e4854856e4e8d68b7d2f9d5b395ef8b5fc9c08", + "0xdea5e6df32bc9c0d4b71ee3437efebaf0ba11a29fa241350f25225cbf6b8ef12", + "0x86f1680c12dee6efbf00443a6071e33964adbb4373c071efeb5835ec8e1efd1d", + "0x2214f8adbf1ace46fb88b7b47d175654bf45b7f861fbcd485c8b8e32303a2118", + "0xc52832a6739b9974a7aa78f3eab172fcedb13237a79da05916242b1dfdd2f40c", + "0x777a97b11164c244e875b1a7fccebff66f92d05726994ae0e868cbd70c675712", + "0xbb230940f96174495d3ab4b871a27d56f9510bc5a00594e8d24a2d033f420612", + "0xe7535e736b4318db5bef5942fe66054f7b99f475e5fede5a589014785306071d", + "0xecc0a65b07b4b274ccfc64f417b6c7a10604f34195c19b0926d322a2c826ce05", + "0xb8d8c157037f3373536938aecff1d4392f48b29c16d0b499127f17cb675ed701", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0xc160b2e978e1037bcc2034e366cfed4f6532c014319ab40602cf93d3fefcec22", + "0xc8a84807085c69fbebac778605aa0d2fd610f840ac32b248d1c2f4c00cb4b400", + "0xd0579274b1e406c16b250704b8e1683019611adc878370956584c1a5f784ea0f", + "0xa68b6973d41090b360a8dd0a151761115af8da30c688b25ecc6dad64854f2211", + "0x429934b81bcdeb2a4be0bfdf278bd7c2894f8550b1e504995e310752db33a108", + "0x8219d0029b2760dfbf2f231846de8b042e2a0be9f28dcaab2e4a34a82c841f2b", + "0x564688c793dee27c7f89735f2bef9bf87ecbf53976f46b4286d01fe6f35edd23", + "0x6ae147ae4f898b9c227e40b46713edbc07b5ac0686ed33e14d286da575ebbe09", + "0x13e378b9ce62a3d367ba89cded15b9c485de4af9d8db711b7eecc9d43a915720", + "0x762a767e01cc602b1c76037defdd8890f2a77f2a90ff1d14a49d9f639e45f505", + "0x7e4bdec786615fe2cb6883b08b59f385fc6cc8f7aba6965053b18c60a6098e04", + "0xdc83c16b9ffb6bf683d714b35c8fa5ab25950482fb7757a6c6ca7085f523482c", + "0x98ef52da04bc13491ae2e874851c647f778f141681651a1d3b0c88db1c77c403", + "0x46f091d16f7d8ca0dad3d971a5348e038134294467067c515956983d61685c1e", + "0x17fd52ac8fe6ce1f8b6c03516fabebaa16bfcb18c66ebdd2e3c3a22ab0f5c22d", + "0x72a7a090e6642273203457e9eb7db25bbf26418d144edac0c305a7bbf235182e", + "0x417bda7622cac6f173a9e47c5a3626bd2b641e354b9b868fddee7802821ec020", + "0xb463641aaa099f23202001b793dc978a89da2c24fa0ab4964f7fb0cccc772b15", + "0xd2edda42535bea2201fdbe28d6aee35154fd4df0a82d09f14193a38404502005", + "0xfffe392c999ef8065909de4aa427c8d02dfff8793f12582829f4efba645af524", + "0xa51e7832f5c1970d29c1d3304c7f5c2cc199c7d7b4a6be3a518dd4adde247c1b", + "0x3616e8bb8c735878faf1d00f7fe8d159d16917724df5e99d752c58812d484d2f", + "0x0a402861a2d79ae8ebb9287c67a37c5fbab5ef17c428f4ef1b62c23f738fd423", + "0x706b5e2d8b8e8550391b9d10fd8ac4462cb71677e2dc12aab4d4514daad0d512", + "0xde7b9d73817e10ca37b5f2cab8ab5bcb549127d90229e0533bf97cb80252f709", + "0xd902d285a5395f96ea452bd4a4053df580879c9ce50c3a14f06e2ed43ffe6ba1", + ]; + const computeProof = ethers.concat(computeProofRaw); + + const config: QueryBuilderClientConfig = { + caller: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + providerUri: process.env.PROVIDER_URI_MAINNET as string, + version: "v2", + }; + // const axiom = new QueryBuilderClient(config); + + test("should validate a QueryV2", async () => { + const dataQuery = [ + { + blockNumber: BLOCK_NUMBER, + fieldIdx: 0, + } as Subquery, + { + blockNumber: BLOCK_NUMBER + 1, + fieldIdx: 1, + } as Subquery, + { + blockNumber: BLOCK_NUMBER, + addr: WETH_WHALE, + fieldIdx: AccountField.Nonce, + } as Subquery, + { + blockNumber: 17975259, + txIdx: 34, + // txHash: "0x47082a4eaba054312c652a21c6d75a44095b8be43c60bdaeffad03d38a8b1602", + fieldOrLogIdx: ReceiptField.CumulativeGas, + topicOrDataOrAddressIdx: 0, + eventSchema: ethers.ZeroHash, + } as Subquery, + { + blockNumber: 17000000, + addr: "0x1F98431c8aD98523631AE4a59f267346ea31F984", + mappingSlot: "5", + mappingDepth: 3, + keys: [ + bytes32("0x0000000000085d4780b73119b644ae5ecd22b376"), + bytes32("0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"), + bytes32(3000), + ], + } as Subquery, + ]; + const computeQueryReq: AxiomV2ComputeQuery = { + k: 14, + vkey, + computeProof, + }; + const callbackQuery = { + target: WETH_ADDR, + extraData: bytes32(ethers.solidityPacked(["address"], [WETH_WHALE])), + }; + const options = {}; + const axiom = new QueryBuilderClient(config, dataQuery, computeQueryReq, callbackQuery, options); + const isValid = await axiom.validate(); + expect(isValid).toEqual(true); + }, 20000); + + test("Compute callback resultLen based on number of subqueries", async () => { + const axiom = new QueryBuilderClient(config); + + const callback: AxiomV2Callback = { + target: WETH_ADDR, + extraData: ethers.solidityPacked(["address"], [WETH_WHALE]), + }; + axiom.setCallback(callback); + + axiom.appendDataSubquery({ + blockNumber: 17000000, + fieldIdx: HeaderField.GasLimit, + } as Subquery); + axiom.appendDataSubquery({ + blockNumber: 17000001, + fieldIdx: HeaderField.GasLimit, + } as Subquery); + + const builtQuery = await axiom.build(); + expect(builtQuery.computeQuery.resultLen).toEqual(2); + }); + + test("Use specified callback resultLen if there is a computeQuery", async () => { + const axiom = new QueryBuilderClient(config); + + const callback: AxiomV2Callback = { + target: WETH_ADDR, + extraData: ethers.solidityPacked(["address"], [WETH_WHALE]), + }; + axiom.setCallback(callback); + const computeQueryReq: AxiomV2ComputeQuery = { + k: 14, + resultLen: 4, + vkey, + computeProof, + }; + axiom.setComputeQuery(computeQueryReq); + + axiom.appendDataSubquery({ + blockNumber: 17000000, + fieldIdx: HeaderField.GasLimit, + } as Subquery); + axiom.appendDataSubquery({ + blockNumber: 17000001, + fieldIdx: HeaderField.GasLimit, + } as Subquery); + + const builtQuery = await axiom.build(); + expect(builtQuery.computeQuery.resultLen).toEqual(4); + }); + + test("Set various options", async () => { + const axiom = new QueryBuilderClient({...config, refundee: ethers.ZeroAddress}); + + const options: AxiomV2QueryOptions = { + maxFeePerGas: "100000000", + callbackGasLimit: 50000, + }; + axiom.setOptions(options); + + const callback: AxiomV2Callback = { + target: WETH_ADDR, + extraData: ethers.solidityPacked(["address"], [WETH_WHALE]), + }; + axiom.setCallback(callback); + const computeQueryReq: AxiomV2ComputeQuery = { + k: 14, + resultLen: 4, + vkey, + computeProof, + }; + axiom.setComputeQuery(computeQueryReq); + + axiom.appendDataSubquery({ + blockNumber: 17000000, + fieldIdx: HeaderField.GasLimit, + } as Subquery); + axiom.appendDataSubquery({ + blockNumber: 17000001, + fieldIdx: HeaderField.GasLimit, + } as Subquery); + + const builtQuery = await axiom.build(); + expect(builtQuery.feeData.maxFeePerGas).toEqual(options.maxFeePerGas); + expect(builtQuery.feeData.callbackGasLimit).toEqual(options.callbackGasLimit); + expect(builtQuery.feeData.overrideAxiomQueryFee).toEqual("0"); + expect(builtQuery.refundee).toEqual(ethers.ZeroAddress); + }); + + test("Append a Header subquery", async () => { + const axiom = new QueryBuilderClient(config); + axiom.appendDataSubquery({ + blockNumber: 17000000, + fieldIdx: HeaderField.GasLimit, + } as Subquery); + await axiom.build(); + const builtQuery = axiom.getBuiltQuery(); + const builtDataQuery = builtQuery?.dataQueryStruct.subqueries; + expect((builtDataQuery?.[0].subqueryData as HeaderSubquery).blockNumber).toEqual(17000000); + expect((builtDataQuery?.[0].subqueryData as HeaderSubquery).fieldIdx).toEqual(HeaderField.GasLimit); + }); + + test("Append an Account subquery", async () => { + const axiom = new QueryBuilderClient(config); + axiom.appendDataSubquery({ + blockNumber: 17000000, + addr: WETH_WHALE, + fieldIdx: AccountField.Nonce, + } as Subquery); + await axiom.build(); + const builtQuery = axiom.getBuiltQuery(); + const builtDataQuery = builtQuery?.dataQueryStruct.subqueries; + expect((builtDataQuery?.[0].subqueryData as AccountSubquery).blockNumber).toEqual(17000000); + expect((builtDataQuery?.[0].subqueryData as AccountSubquery).addr).toEqual(WETH_WHALE.toLowerCase()); + expect((builtDataQuery?.[0].subqueryData as AccountSubquery).fieldIdx).toEqual(AccountField.Nonce); + }); + + test("Append a Storage subquery", async () => { + const axiom = new QueryBuilderClient(config); + const slot = getSlotForMapping("3", "address", WETH_WHALE); + axiom.appendDataSubquery({ + blockNumber: 18000000, + addr: WETH_ADDR, + slot, + } as Subquery); + + await axiom.build(); + const builtQuery = axiom.getBuiltQuery(); + const builtDataQuery = builtQuery?.dataQueryStruct.subqueries; + expect((builtDataQuery?.[0].subqueryData as StorageSubquery).blockNumber).toEqual(18000000); + expect((builtDataQuery?.[0].subqueryData as StorageSubquery).addr).toEqual(WETH_ADDR.toLowerCase()); + expect((builtDataQuery?.[0].subqueryData as StorageSubquery).slot).toEqual(slot); + }); + + test("Append a Tx subquery", async () => { + const axiom = new QueryBuilderClient(config); + const txHash = "0x8d2e6cbd7cf1f88ee174600f31b79382e0028e239bb1af8301ba6fc782758bc6"; + const { blockNumber, txIdx } = (await getBlockNumberAndTxIdx(provider, txHash)) as { + blockNumber: number; + txIdx: number; + }; + axiom.appendDataSubquery({ + blockNumber, + txIdx, + fieldOrCalldataIdx: TxField.To, + } as Subquery); + + await axiom.build(); + const builtQuery = axiom.getBuiltQuery(); + const builtDataQuery = builtQuery?.dataQueryStruct.subqueries; + expect((builtDataQuery?.[0].subqueryData as TxSubquery).blockNumber).toEqual(blockNumber); + expect((builtDataQuery?.[0].subqueryData as TxSubquery).txIdx).toEqual(txIdx); + expect((builtDataQuery?.[0].subqueryData as TxSubquery).fieldOrCalldataIdx).toEqual(TxField.To); + }); + + test("Append a Receipt subquery", async () => { + const axiom = new QueryBuilderClient(config); + const eventSchema = getEventSchema("Transfer", ["address", "address", "uint256"]); + + const txHash = "0x8d2e6cbd7cf1f88ee174600f31b79382e0028e239bb1af8301ba6fc782758bc6"; + const { blockNumber, txIdx } = (await getBlockNumberAndTxIdx(provider, txHash)) as { + blockNumber: number; + txIdx: number; + }; + + axiom.appendDataSubquery({ + blockNumber, + txIdx, + fieldOrLogIdx: getFieldIdxReceiptLogIdx(0), + topicOrDataOrAddressIdx: getFieldIdxReceiptTopicIdx(1), + eventSchema, + } as Subquery); + + await axiom.build(); + const builtQuery = axiom.getBuiltQuery(); + const builtDataQuery = builtQuery?.dataQueryStruct.subqueries; + const fieldOrLogIdx = getFieldIdxReceiptLogIdx(0); + const topicOrDataOrAddressIdx = getFieldIdxReceiptTopicIdx(1); + expect((builtDataQuery?.[0].subqueryData as ReceiptSubquery).blockNumber).toEqual(blockNumber); + expect((builtDataQuery?.[0].subqueryData as ReceiptSubquery).txIdx).toEqual(txIdx); + expect((builtDataQuery?.[0].subqueryData as ReceiptSubquery).fieldOrLogIdx).toEqual(fieldOrLogIdx); + expect((builtDataQuery?.[0].subqueryData as ReceiptSubquery).topicOrDataOrAddressIdx).toEqual( + topicOrDataOrAddressIdx, + ); + expect((builtDataQuery?.[0].subqueryData as ReceiptSubquery).eventSchema).toEqual(eventSchema); + }); + + test("Append a Solidity Nested Mapping subquery", async () => { + const axiom = new QueryBuilderClient(config); + axiom.appendDataSubquery({ + blockNumber: 17000000, + addr: UNI_V3_FACTORY_ADDR, + mappingSlot: 5, + mappingDepth: 3, + keys: [WETH_ADDR, WSOL_ADDR, 10000], + } as Subquery); + await axiom.build(); + const builtQuery = axiom.getBuiltQuery(); + const builtDataQuery = builtQuery?.dataQueryStruct.subqueries; + expect((builtDataQuery?.[0].subqueryData as SolidityNestedMappingSubquery).blockNumber).toEqual(17000000); + expect((builtDataQuery?.[0].subqueryData as SolidityNestedMappingSubquery).addr).toEqual( + UNI_V3_FACTORY_ADDR.toLowerCase(), + ); + expect((builtDataQuery?.[0].subqueryData as SolidityNestedMappingSubquery).mappingSlot).toEqual(5); + expect((builtDataQuery?.[0].subqueryData as SolidityNestedMappingSubquery).mappingDepth).toEqual(3); + expect((builtDataQuery?.[0].subqueryData as SolidityNestedMappingSubquery).keys).toEqual([ + bytes32(WETH_ADDR), + bytes32(WSOL_ADDR), + bytes32(10000), + ]); + }); + + test("Set a built DataQuery", async () => { + const dataQueryReq = [ + { + blockNumber: BLOCK_NUMBER, + fieldIdx: 0, + } as Subquery, + { + blockNumber: BLOCK_NUMBER + 1, + fieldIdx: 1, + } as Subquery, + { + blockNumber: BLOCK_NUMBER, + addr: WETH_WHALE, + fieldIdx: AccountField.Nonce, + } as Subquery, + { + blockNumber: 17975259, + txIdx: 34, + // txHash: "0x47082a4eaba054312c652a21c6d75a44095b8be43c60bdaeffad03d38a8b1602", + fieldOrLogIdx: ReceiptField.CumulativeGas, + topicOrDataOrAddressIdx: 10, + eventSchema: ethers.ZeroHash, + } as Subquery, + ]; + const computeQueryReq: AxiomV2ComputeQuery = { + k: 14, + vkey, + computeProof, + }; + const callbackQuery = { + target: WETH_ADDR, + extraData: ethers.solidityPacked(["address"], [WETH_WHALE]), + }; + const options: AxiomV2QueryOptions = { + maxFeePerGas: BigInt(100000000).toString(), + }; + const axiom = new QueryBuilderClient(config, dataQueryReq, computeQueryReq, callbackQuery, options); + + const unbiltDq = axiom.getDataQuery(); + expect((unbiltDq?.[2] as AccountSubquery).addr).toEqual(WETH_WHALE); + + const { queryHash, dataQueryHash, dataQuery, computeQuery, callback } = await axiom.build(); + const builtDq = axiom.getBuiltQuery()?.dataQueryStruct; + if (builtDq === undefined) { + throw new Error("builtDq is undefined"); + } + + const axiom2 = new QueryBuilderClient(config); + axiom2.setBuiltDataQuery(builtDq); + axiom2.setComputeQuery(computeQueryReq); + axiom2.setCallback(callbackQuery); + const { + queryHash: queryHash2, + dataQueryHash: dataQueryHash2, + dataQuery: dataQuery2, + computeQuery: computeQuery2, + callback: callback2, + } = await axiom2.build(); + + expect(queryHash).toEqual(queryHash2); + expect(dataQueryHash).toEqual(dataQueryHash2); + expect(dataQuery).toEqual(dataQuery2); + expect(computeQuery).toEqual(computeQuery2); + expect(callback).toEqual(callback2); + }); + + test("Set a built empty DataQuery", async () => { + const computeQueryReq: AxiomV2ComputeQuery = { + k: 14, + vkey, + computeProof, + }; + const callbackQuery = { + target: WETH_ADDR, + extraData: ethers.solidityPacked(["address"], [WETH_WHALE]), + }; + const options: AxiomV2QueryOptions = { + maxFeePerGas: BigInt(100000000).toString(), + }; + const axiom = new QueryBuilderClient(config, undefined, computeQueryReq, callbackQuery, options); + axiom.setBuiltDataQuery({ + sourceChainId: "11155111", + subqueries: [], + }); + await axiom.build(); + const builtDq = axiom.getBuiltQuery()?.dataQueryStruct; + if (builtDq === undefined) { + throw new Error("builtDq is undefined"); + } + }); +}); diff --git a/harness/.env.example b/harness/.env.example index c5592175..ce72eae5 100644 --- a/harness/.env.example +++ b/harness/.env.example @@ -1,4 +1,4 @@ -PROVIDER_URI_GOERLI= -PROVIDER_URI_SEPOLIA= -PRIVATE_KEY_GOERLI= -PRIVATE_KEY_SEPOLIA= \ No newline at end of file +PROVIDER_URI_11155111= +PRIVATE_KEY_11155111= +PROVIDER_URI_84532= +PRIVATE_KEY_84532= \ No newline at end of file diff --git a/harness/README.md b/harness/README.md index 851f90c9..45ca5a6a 100644 --- a/harness/README.md +++ b/harness/README.md @@ -1,30 +1,45 @@ # axiom-client harness -Client harness that allows for easy circuit parameter generation +Client harness that allows for easy circuit parameter generation and testing. Uses standard Axiom `*.circuit.ts` files. -Run via: +## Integration test data generation scripts +### Generating test inputs + +We have a Solidity contract that can be deployed to generate transaction and receipt data of a particular size. Set `PROVIDER_URI` and `PRIVATE_KEY` to the provider and account private key of the chain that you would like to deploy on. + +```bash +pnpm deploy:inputs ``` -npx harness run -``` -Saves output to `./data/` unless a different output directory is specified. +Record the block number that the transactions occrred in. You can add them to a comma-separated list of block numbers in the harness search command below. + +### Getting chain data for integration tests + +To run the chain data search script: + +```bash +# When importing harness as a package +npx harness search --provider --include --output -## Javascript circuit format +# Inside this repo +node dist/cli/index.js search --provider --include --output +``` + +Where `--include` is optional and blocknumbers is a comma-separated list (single: `--include 1530001` multiple: `--include 1530001,1530005,1530011`). -Code and input should be in the same file, with input parameters specified as a Javascript object called `const input = {...}`. +## Setting test inputs -Example circuit.js file: +Test inputs can be set by adding a `//$` decorator followed by the chaindata object path to each input. ```javascript -for (let i = 0; i < 7; i++) { - const acct = getAccount(add(claimedBlockNumber, i), address); - const balance = await acct.balance(); - addToCallback(balance); -} - -const input = { - address: "0x897dDbe14c9C7736EbfDC58461355697FbF70048", - claimedBlockNumber: 9173677, -}; +blockNumber: 4000000, //$ account.eoa[8].blockNumber +``` + +## Running integration tests + +Prefix a `CHAIN_ID` environmental variable before running your test. Ensure that `PROVIDER_URI_${CHAIN_ID}` and `PRIVATE_KEY_${CHAIN_ID}` exist in `.env` before running. + +```bash +CHAIN_ID=11155111 pnpm jest test/integration/start.test.ts ``` diff --git a/harness/package.json b/harness/package.json index 3365f92b..2baee787 100644 --- a/harness/package.json +++ b/harness/package.json @@ -1,14 +1,16 @@ { "name": "@axiom-crypto/harness", - "version": "2.0.8", + "version": "2.0.9", "author": "Intrinsic Technologies", "license": "MIT", "description": "Circuit harness for axiom-client", "scripts": { "build": "rm -rf dist && node scripts/preBuild.js && tsc && node scripts/postBuild.js", "test": "jest", - "test:goerli": "jest test/unit/goerli.test.ts", - "test:sepolia": "jest test/unit/sepolia.test.ts" + "test:sepolia": "CHAIN_ID=11155111 jest test/integration/start.test.ts", + "test:base_sepolia": "CHAIN_ID=84532 jest test/integration/start.test.ts", + "chaindata": "./test/search_chaindata.sh", + "deploy:inputs": "./solidity_sized_tx_contract/script/start.sh" }, "bin": { "harness": "./cli/index.js" @@ -25,9 +27,10 @@ "crypto" ], "dependencies": { + "@axiom-crypto/tools": "2.1.1", "commander": "^11.1.0", - "ethers": "^6.8.1", - "viem": "^1.19.9" + "ethers": "^6.12.0", + "viem": "2.8.18" }, "devDependencies": { "@types/jest": "^29.5.11", diff --git a/harness/pnpm-lock.yaml b/harness/pnpm-lock.yaml index 8535c2b3..78a931b4 100644 --- a/harness/pnpm-lock.yaml +++ b/harness/pnpm-lock.yaml @@ -8,15 +8,18 @@ dependencies: '@axiom-crypto/client': specifier: link:../client/dist version: link:../client/dist + '@axiom-crypto/tools': + specifier: 2.1.1 + version: 2.1.1 commander: specifier: ^11.1.0 version: 11.1.0 ethers: - specifier: ^6.8.1 - version: 6.9.2 + specifier: ^6.12.0 + version: 6.12.0 viem: - specifier: ^1.19.9 - version: 1.21.4(typescript@5.3.3) + specifier: 2.8.18 + version: 2.8.18(typescript@5.3.3) devDependencies: '@types/jest': @@ -53,6 +56,10 @@ packages: resolution: {integrity: sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q==} dev: false + /@adraffy/ens-normalize@1.10.1: + resolution: {integrity: sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==} + dev: false + /@ampproject/remapping@2.2.1: resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} engines: {node: '>=6.0.0'} @@ -61,6 +68,19 @@ packages: '@jridgewell/trace-mapping': 0.3.20 dev: true + /@axiom-crypto/tools@2.1.1: + resolution: {integrity: sha512-JqKz+S8wIOqoa42h5TMoPCNxatLEoJwOYabFUB1GWSkQ/Ep3ZPDP5ydk/ky3VeDG/KFidBa0/uvVQk5EEK/Rpw==} + dependencies: + axios: 1.6.8 + bs58: 5.0.0 + ethers: 6.12.0 + form-data: 4.0.0 + transitivePeerDependencies: + - bufferutil + - debug + - utf-8-validate + dev: false + /@babel/code-frame@7.23.5: resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==} engines: {node: '>=6.9.0'} @@ -978,11 +998,11 @@ packages: '@types/yargs-parser': 21.0.3 dev: true - /abitype@0.9.8(typescript@5.3.3): - resolution: {integrity: sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ==} + /abitype@1.0.0(typescript@5.3.3): + resolution: {integrity: sha512-NMeMah//6bJ56H5XRj8QCV4AwuW6hB6zqz2LnhhLdcWVQOsXki6/Pn3APeqxCma62nXIcmZWdu1DlHWS74umVQ==} peerDependencies: typescript: '>=5.0.4' - zod: ^3 >=3.19.1 + zod: ^3 >=3.22.0 peerDependenciesMeta: typescript: optional: true @@ -1041,6 +1061,20 @@ packages: sprintf-js: 1.0.3 dev: true + /asynckit@0.4.0: + resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + dev: false + + /axios@1.6.8: + resolution: {integrity: sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==} + dependencies: + follow-redirects: 1.15.6 + form-data: 4.0.0 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + dev: false + /babel-jest@29.7.0(@babel/core@7.23.7): resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -1117,6 +1151,10 @@ packages: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} dev: true + /base-x@4.0.0: + resolution: {integrity: sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==} + dev: false + /brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} dependencies: @@ -1149,6 +1187,12 @@ packages: fast-json-stable-stringify: 2.1.0 dev: true + /bs58@5.0.0: + resolution: {integrity: sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==} + dependencies: + base-x: 4.0.0 + dev: false + /bser@2.1.1: resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} dependencies: @@ -1248,6 +1292,13 @@ packages: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} dev: true + /combined-stream@1.0.8: + resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} + engines: {node: '>= 0.8'} + dependencies: + delayed-stream: 1.0.0 + dev: false + /commander@11.1.0: resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==} engines: {node: '>=16'} @@ -1315,6 +1366,11 @@ packages: engines: {node: '>=0.10.0'} dev: true + /delayed-stream@1.0.0: + resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} + engines: {node: '>=0.4.0'} + dev: false + /detect-newline@3.1.0: resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} engines: {node: '>=8'} @@ -1410,11 +1466,11 @@ packages: hasBin: true dev: true - /ethers@6.9.2: - resolution: {integrity: sha512-YpkrtILnMQz5jSEsJQRTpduaGT/CXuLnUIuOYzHA0v/7c8IX91m2J48wSKjzGL5L9J/Us3tLoUdb+OwE3U+FFQ==} + /ethers@6.12.0: + resolution: {integrity: sha512-zL5NlOTjML239gIvtVJuaSk0N9GQLi1Hom3ZWUszE5lDTQE/IVB62mrPkQ2W1bGcZwVGSLaetQbWNQSvI4rGDQ==} engines: {node: '>=14.0.0'} dependencies: - '@adraffy/ens-normalize': 1.10.0 + '@adraffy/ens-normalize': 1.10.1 '@noble/curves': 1.2.0 '@noble/hashes': 1.3.2 '@types/node': 18.15.13 @@ -1482,6 +1538,25 @@ packages: path-exists: 4.0.0 dev: true + /follow-redirects@1.15.6: + resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + dev: false + + /form-data@4.0.0: + resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} + engines: {node: '>= 6'} + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + mime-types: 2.1.35 + dev: false + /fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} dev: true @@ -2201,6 +2276,18 @@ packages: picomatch: 2.3.1 dev: true + /mime-db@1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + dev: false + + /mime-types@2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + dependencies: + mime-db: 1.52.0 + dev: false + /mimic-fn@2.1.0: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} @@ -2346,6 +2433,10 @@ packages: sisteransi: 1.0.5 dev: true + /proxy-from-env@1.1.0: + resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + dev: false + /pure-rand@6.0.4: resolution: {integrity: sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==} dev: true @@ -2628,8 +2719,8 @@ packages: convert-source-map: 2.0.0 dev: true - /viem@1.21.4(typescript@5.3.3): - resolution: {integrity: sha512-BNVYdSaUjeS2zKQgPs+49e5JKocfo60Ib2yiXOWBT6LuVxY1I/6fFX3waEtpXvL1Xn4qu+BVitVtMh9lyThyhQ==} + /viem@2.8.18(typescript@5.3.3): + resolution: {integrity: sha512-Kq3kwkKziJ8rQeLkmdbSLheHDnA+tx2EdLKLmQ3N4FVtjKYjBP9tPL1r+fI6KltVUM1TDOhIHOdslDSp57VMMg==} peerDependencies: typescript: '>=5.0.4' peerDependenciesMeta: @@ -2641,7 +2732,7 @@ packages: '@noble/hashes': 1.3.2 '@scure/bip32': 1.3.2 '@scure/bip39': 1.2.1 - abitype: 0.9.8(typescript@5.3.3) + abitype: 1.0.0(typescript@5.3.3) isows: 1.0.3(ws@8.13.0) typescript: 5.3.3 ws: 8.13.0 diff --git a/harness/solidity_sized_tx_contract/.gitignore b/harness/solidity_sized_tx_contract/.gitignore new file mode 100644 index 00000000..ce0cbca9 --- /dev/null +++ b/harness/solidity_sized_tx_contract/.gitignore @@ -0,0 +1,16 @@ +# Compiler files +cache/ +out/ + +# Ignores development broadcast logs +!/broadcast +/broadcast/*/31337/ +/broadcast/**/dry-run/ + +# Docs +docs/ + +# Dotenv file +.env + +broadcast diff --git a/harness/solidity_sized_tx_contract/README.md b/harness/solidity_sized_tx_contract/README.md new file mode 100644 index 00000000..9265b455 --- /dev/null +++ b/harness/solidity_sized_tx_contract/README.md @@ -0,0 +1,66 @@ +## Foundry + +**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.** + +Foundry consists of: + +- **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools). +- **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data. +- **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network. +- **Chisel**: Fast, utilitarian, and verbose solidity REPL. + +## Documentation + +https://book.getfoundry.sh/ + +## Usage + +### Build + +```shell +$ forge build +``` + +### Test + +```shell +$ forge test +``` + +### Format + +```shell +$ forge fmt +``` + +### Gas Snapshots + +```shell +$ forge snapshot +``` + +### Anvil + +```shell +$ anvil +``` + +### Deploy + +```shell +$ forge script script/Counter.s.sol:CounterScript --rpc-url --private-key +``` + +### Cast + +```shell +$ cast +``` + +### Help + +```shell +$ forge --help +$ anvil --help +$ cast --help +``` diff --git a/harness/solidity_sized_tx_contract/foundry.toml b/harness/solidity_sized_tx_contract/foundry.toml new file mode 100644 index 00000000..25b918f9 --- /dev/null +++ b/harness/solidity_sized_tx_contract/foundry.toml @@ -0,0 +1,6 @@ +[profile.default] +src = "src" +out = "out" +libs = ["lib"] + +# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/.gitattributes b/harness/solidity_sized_tx_contract/lib/forge-std/.gitattributes new file mode 100644 index 00000000..27042d45 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/.gitattributes @@ -0,0 +1 @@ +src/Vm.sol linguist-generated diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/.github/workflows/ci.yml b/harness/solidity_sized_tx_contract/lib/forge-std/.github/workflows/ci.yml new file mode 100644 index 00000000..cb241ae7 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/.github/workflows/ci.yml @@ -0,0 +1,134 @@ +name: CI + +on: + workflow_dispatch: + pull_request: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install Foundry + uses: onbjerg/foundry-toolchain@v1 + with: + version: nightly + + - name: Print forge version + run: forge --version + + # Backwards compatibility checks: + # - the oldest and newest version of each supported minor version + # - versions with specific issues + - name: Check compatibility with latest + if: always() + run: | + output=$(forge build --skip test) + + if echo "$output" | grep -q "Warning"; then + echo "$output" + exit 1 + fi + + - name: Check compatibility with 0.8.0 + if: always() + run: | + output=$(forge build --skip test --use solc:0.8.0) + + if echo "$output" | grep -q "Warning"; then + echo "$output" + exit 1 + fi + + - name: Check compatibility with 0.7.6 + if: always() + run: | + output=$(forge build --skip test --use solc:0.7.6) + + if echo "$output" | grep -q "Warning"; then + echo "$output" + exit 1 + fi + + - name: Check compatibility with 0.7.0 + if: always() + run: | + output=$(forge build --skip test --use solc:0.7.0) + + if echo "$output" | grep -q "Warning"; then + echo "$output" + exit 1 + fi + + - name: Check compatibility with 0.6.12 + if: always() + run: | + output=$(forge build --skip test --use solc:0.6.12) + + if echo "$output" | grep -q "Warning"; then + echo "$output" + exit 1 + fi + + - name: Check compatibility with 0.6.2 + if: always() + run: | + output=$(forge build --skip test --use solc:0.6.2) + + if echo "$output" | grep -q "Warning"; then + echo "$output" + exit 1 + fi + + # via-ir compilation time checks. + - name: Measure compilation time of Test with 0.8.17 --via-ir + if: always() + run: forge build --skip test --contracts test/compilation/CompilationTest.sol --use solc:0.8.17 --via-ir + + - name: Measure compilation time of TestBase with 0.8.17 --via-ir + if: always() + run: forge build --skip test --contracts test/compilation/CompilationTestBase.sol --use solc:0.8.17 --via-ir + + - name: Measure compilation time of Script with 0.8.17 --via-ir + if: always() + run: forge build --skip test --contracts test/compilation/CompilationScript.sol --use solc:0.8.17 --via-ir + + - name: Measure compilation time of ScriptBase with 0.8.17 --via-ir + if: always() + run: forge build --skip test --contracts test/compilation/CompilationScriptBase.sol --use solc:0.8.17 --via-ir + + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install Foundry + uses: onbjerg/foundry-toolchain@v1 + with: + version: nightly + + - name: Print forge version + run: forge --version + + - name: Run tests + run: forge test -vvv + + fmt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install Foundry + uses: onbjerg/foundry-toolchain@v1 + with: + version: nightly + + - name: Print forge version + run: forge --version + + - name: Check formatting + run: forge fmt --check diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/.github/workflows/sync.yml b/harness/solidity_sized_tx_contract/lib/forge-std/.github/workflows/sync.yml new file mode 100644 index 00000000..5a9e9d59 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/.github/workflows/sync.yml @@ -0,0 +1,29 @@ +name: Sync Release Branch + +on: + release: + types: + - created + +jobs: + sync-release-branch: + runs-on: ubuntu-latest + if: startsWith(github.event.release.tag_name, 'v1') + steps: + - name: Check out the repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + ref: v1 + + - name: Configure Git + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + + - name: Sync Release Branch + run: | + git fetch --tags + git checkout v1 + git reset --hard ${GITHUB_REF} + git push --force diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/.gitignore b/harness/solidity_sized_tx_contract/lib/forge-std/.gitignore new file mode 100644 index 00000000..756106d3 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/.gitignore @@ -0,0 +1,4 @@ +cache/ +out/ +.vscode +.idea diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/.gitmodules b/harness/solidity_sized_tx_contract/lib/forge-std/.gitmodules new file mode 100644 index 00000000..e1247196 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/.gitmodules @@ -0,0 +1,3 @@ +[submodule "lib/ds-test"] + path = lib/ds-test + url = https://github.com/dapphub/ds-test diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/LICENSE-APACHE b/harness/solidity_sized_tx_contract/lib/forge-std/LICENSE-APACHE new file mode 100644 index 00000000..cf01a499 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/LICENSE-APACHE @@ -0,0 +1,203 @@ +Copyright Contributors to Forge Standard Library + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +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. diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/LICENSE-MIT b/harness/solidity_sized_tx_contract/lib/forge-std/LICENSE-MIT new file mode 100644 index 00000000..28f98304 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/LICENSE-MIT @@ -0,0 +1,25 @@ +Copyright Contributors to Forge Standard Library + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE O THE USE OR OTHER +DEALINGS IN THE SOFTWARE.R diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/README.md b/harness/solidity_sized_tx_contract/lib/forge-std/README.md new file mode 100644 index 00000000..8494a7dd --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/README.md @@ -0,0 +1,250 @@ +# Forge Standard Library • [![CI status](https://github.com/foundry-rs/forge-std/actions/workflows/ci.yml/badge.svg)](https://github.com/foundry-rs/forge-std/actions/workflows/ci.yml) + +Forge Standard Library is a collection of helpful contracts and libraries for use with [Forge and Foundry](https://github.com/foundry-rs/foundry). It leverages Forge's cheatcodes to make writing tests easier and faster, while improving the UX of cheatcodes. + +**Learn how to use Forge-Std with the [📖 Foundry Book (Forge-Std Guide)](https://book.getfoundry.sh/forge/forge-std.html).** + +## Install + +```bash +forge install foundry-rs/forge-std +``` + +## Contracts +### stdError + +This is a helper contract for errors and reverts. In Forge, this contract is particularly helpful for the `expectRevert` cheatcode, as it provides all compiler builtin errors. + +See the contract itself for all error codes. + +#### Example usage + +```solidity + +import "forge-std/Test.sol"; + +contract TestContract is Test { + ErrorsTest test; + + function setUp() public { + test = new ErrorsTest(); + } + + function testExpectArithmetic() public { + vm.expectRevert(stdError.arithmeticError); + test.arithmeticError(10); + } +} + +contract ErrorsTest { + function arithmeticError(uint256 a) public { + uint256 a = a - 100; + } +} +``` + +### stdStorage + +This is a rather large contract due to all of the overloading to make the UX decent. Primarily, it is a wrapper around the `record` and `accesses` cheatcodes. It can *always* find and write the storage slot(s) associated with a particular variable without knowing the storage layout. The one _major_ caveat to this is while a slot can be found for packed storage variables, we can't write to that variable safely. If a user tries to write to a packed slot, the execution throws an error, unless it is uninitialized (`bytes32(0)`). + +This works by recording all `SLOAD`s and `SSTORE`s during a function call. If there is a single slot read or written to, it immediately returns the slot. Otherwise, behind the scenes, we iterate through and check each one (assuming the user passed in a `depth` parameter). If the variable is a struct, you can pass in a `depth` parameter which is basically the field depth. + +I.e.: +```solidity +struct T { + // depth 0 + uint256 a; + // depth 1 + uint256 b; +} +``` + +#### Example usage + +```solidity +import "forge-std/Test.sol"; + +contract TestContract is Test { + using stdStorage for StdStorage; + + Storage test; + + function setUp() public { + test = new Storage(); + } + + function testFindExists() public { + // Lets say we want to find the slot for the public + // variable `exists`. We just pass in the function selector + // to the `find` command + uint256 slot = stdstore.target(address(test)).sig("exists()").find(); + assertEq(slot, 0); + } + + function testWriteExists() public { + // Lets say we want to write to the slot for the public + // variable `exists`. We just pass in the function selector + // to the `checked_write` command + stdstore.target(address(test)).sig("exists()").checked_write(100); + assertEq(test.exists(), 100); + } + + // It supports arbitrary storage layouts, like assembly based storage locations + function testFindHidden() public { + // `hidden` is a random hash of a bytes, iteration through slots would + // not find it. Our mechanism does + // Also, you can use the selector instead of a string + uint256 slot = stdstore.target(address(test)).sig(test.hidden.selector).find(); + assertEq(slot, uint256(keccak256("my.random.var"))); + } + + // If targeting a mapping, you have to pass in the keys necessary to perform the find + // i.e.: + function testFindMapping() public { + uint256 slot = stdstore + .target(address(test)) + .sig(test.map_addr.selector) + .with_key(address(this)) + .find(); + // in the `Storage` constructor, we wrote that this address' value was 1 in the map + // so when we load the slot, we expect it to be 1 + assertEq(uint(vm.load(address(test), bytes32(slot))), 1); + } + + // If the target is a struct, you can specify the field depth: + function testFindStruct() public { + // NOTE: see the depth parameter - 0 means 0th field, 1 means 1st field, etc. + uint256 slot_for_a_field = stdstore + .target(address(test)) + .sig(test.basicStruct.selector) + .depth(0) + .find(); + + uint256 slot_for_b_field = stdstore + .target(address(test)) + .sig(test.basicStruct.selector) + .depth(1) + .find(); + + assertEq(uint(vm.load(address(test), bytes32(slot_for_a_field))), 1); + assertEq(uint(vm.load(address(test), bytes32(slot_for_b_field))), 2); + } +} + +// A complex storage contract +contract Storage { + struct UnpackedStruct { + uint256 a; + uint256 b; + } + + constructor() { + map_addr[msg.sender] = 1; + } + + uint256 public exists = 1; + mapping(address => uint256) public map_addr; + // mapping(address => Packed) public map_packed; + mapping(address => UnpackedStruct) public map_struct; + mapping(address => mapping(address => uint256)) public deep_map; + mapping(address => mapping(address => UnpackedStruct)) public deep_map_struct; + UnpackedStruct public basicStruct = UnpackedStruct({ + a: 1, + b: 2 + }); + + function hidden() public view returns (bytes32 t) { + // an extremely hidden storage slot + bytes32 slot = keccak256("my.random.var"); + assembly { + t := sload(slot) + } + } +} +``` + +### stdCheats + +This is a wrapper over miscellaneous cheatcodes that need wrappers to be more dev friendly. Currently there are only functions related to `prank`. In general, users may expect ETH to be put into an address on `prank`, but this is not the case for safety reasons. Explicitly this `hoax` function should only be used for address that have expected balances as it will get overwritten. If an address already has ETH, you should just use `prank`. If you want to change that balance explicitly, just use `deal`. If you want to do both, `hoax` is also right for you. + + +#### Example usage: +```solidity + +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "forge-std/Test.sol"; + +// Inherit the stdCheats +contract StdCheatsTest is Test { + Bar test; + function setUp() public { + test = new Bar(); + } + + function testHoax() public { + // we call `hoax`, which gives the target address + // eth and then calls `prank` + hoax(address(1337)); + test.bar{value: 100}(address(1337)); + + // overloaded to allow you to specify how much eth to + // initialize the address with + hoax(address(1337), 1); + test.bar{value: 1}(address(1337)); + } + + function testStartHoax() public { + // we call `startHoax`, which gives the target address + // eth and then calls `startPrank` + // + // it is also overloaded so that you can specify an eth amount + startHoax(address(1337)); + test.bar{value: 100}(address(1337)); + test.bar{value: 100}(address(1337)); + vm.stopPrank(); + test.bar(address(this)); + } +} + +contract Bar { + function bar(address expectedSender) public payable { + require(msg.sender == expectedSender, "!prank"); + } +} +``` + +### Std Assertions + +Expand upon the assertion functions from the `DSTest` library. + +### `console.log` + +Usage follows the same format as [Hardhat](https://hardhat.org/hardhat-network/reference/#console-log). +It's recommended to use `console2.sol` as shown below, as this will show the decoded logs in Forge traces. + +```solidity +// import it indirectly via Test.sol +import "forge-std/Test.sol"; +// or directly import it +import "forge-std/console2.sol"; +... +console2.log(someValue); +``` + +If you need compatibility with Hardhat, you must use the standard `console.sol` instead. +Due to a bug in `console.sol`, logs that use `uint256` or `int256` types will not be properly decoded in Forge traces. + +```solidity +// import it indirectly via Test.sol +import "forge-std/Test.sol"; +// or directly import it +import "forge-std/console.sol"; +... +console.log(someValue); +``` + +## License + +Forge Standard Library is offered under either [MIT](LICENSE-MIT) or [Apache 2.0](LICENSE-APACHE) license. diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/foundry.toml b/harness/solidity_sized_tx_contract/lib/forge-std/foundry.toml new file mode 100644 index 00000000..f9679ee6 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/foundry.toml @@ -0,0 +1,21 @@ +[profile.default] +fs_permissions = [{ access = "read-write", path = "./"}] + +[rpc_endpoints] +# The RPC URLs are modified versions of the default for testing initialization. +mainnet = "https://mainnet.infura.io/v3/b1d3925804e74152b316ca7da97060d3" # Different API key. +optimism_goerli = "https://goerli.optimism.io/" # Adds a trailing slash. +arbitrum_one_goerli = "https://goerli-rollup.arbitrum.io/rpc/" # Adds a trailing slash. +needs_undefined_env_var = "${UNDEFINED_RPC_URL_PLACEHOLDER}" + +[fmt] +# These are all the `forge fmt` defaults. +line_length = 120 +tab_width = 4 +bracket_spacing = false +int_types = 'long' +multiline_func_header = 'attributes_first' +quote_style = 'double' +number_underscore = 'preserve' +single_line_statement_blocks = 'preserve' +ignore = ["src/console.sol", "src/console2.sol"] \ No newline at end of file diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/.github/workflows/build.yml b/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/.github/workflows/build.yml new file mode 100644 index 00000000..d2ff97db --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/.github/workflows/build.yml @@ -0,0 +1,41 @@ +name: "Build" +on: + pull_request: + push: +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: cachix/install-nix-action@v20 + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + + - name: setup dapp binary cache + uses: cachix/cachix-action@v12 + with: + name: dapp + + - name: install dapptools + run: nix profile install github:dapphub/dapptools#dapp --accept-flake-config + + - name: install foundry + uses: foundry-rs/foundry-toolchain@v1 + + - name: test with solc-0.5.17 + run: dapp --use solc-0.5.17 test -v + + - name: test with solc-0.6.11 + run: dapp --use solc-0.6.11 test -v + + - name: test with solc-0.7.6 + run: dapp --use solc-0.7.6 test -v + + - name: test with solc-0.8.18 + run: dapp --use solc-0.8.18 test -v + + - name: Run tests with foundry + run: forge test -vvv + diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/.gitignore b/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/.gitignore new file mode 100644 index 00000000..462a9949 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/.gitignore @@ -0,0 +1,4 @@ +/.dapple +/build +/out +/cache/ diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/LICENSE b/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/LICENSE new file mode 100644 index 00000000..94a9ed02 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/Makefile b/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/Makefile new file mode 100644 index 00000000..661dac48 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/Makefile @@ -0,0 +1,14 @@ +all:; dapp build + +test: + -dapp --use solc:0.4.23 build + -dapp --use solc:0.4.26 build + -dapp --use solc:0.5.17 build + -dapp --use solc:0.6.12 build + -dapp --use solc:0.7.5 build + +demo: + DAPP_SRC=demo dapp --use solc:0.7.5 build + -hevm dapp-test --verbose 3 + +.PHONY: test demo diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/default.nix b/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/default.nix new file mode 100644 index 00000000..cf65419a --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/default.nix @@ -0,0 +1,4 @@ +{ solidityPackage, dappsys }: solidityPackage { + name = "ds-test"; + src = ./src; +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/demo/demo.sol b/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/demo/demo.sol new file mode 100644 index 00000000..f3bb48e7 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/demo/demo.sol @@ -0,0 +1,222 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity >=0.5.0; + +import "../src/test.sol"; + +contract DemoTest is DSTest { + function test_this() public pure { + require(true); + } + function test_logs() public { + emit log("-- log(string)"); + emit log("a string"); + + emit log("-- log_named_uint(string, uint)"); + emit log_named_uint("uint", 512); + + emit log("-- log_named_int(string, int)"); + emit log_named_int("int", -512); + + emit log("-- log_named_address(string, address)"); + emit log_named_address("address", address(this)); + + emit log("-- log_named_bytes32(string, bytes32)"); + emit log_named_bytes32("bytes32", "a string"); + + emit log("-- log_named_bytes(string, bytes)"); + emit log_named_bytes("bytes", hex"cafefe"); + + emit log("-- log_named_string(string, string)"); + emit log_named_string("string", "a string"); + + emit log("-- log_named_decimal_uint(string, uint, uint)"); + emit log_named_decimal_uint("decimal uint", 1.0e18, 18); + + emit log("-- log_named_decimal_int(string, int, uint)"); + emit log_named_decimal_int("decimal int", -1.0e18, 18); + } + event log_old_named_uint(bytes32,uint); + function test_old_logs() public { + emit log_old_named_uint("key", 500); + emit log_named_bytes32("bkey", "val"); + } + function test_trace() public view { + this.echo("string 1", "string 2"); + } + function test_multiline() public { + emit log("a multiline\\nstring"); + emit log("a multiline string"); + emit log_bytes("a string"); + emit log_bytes("a multiline\nstring"); + emit log_bytes("a multiline\\nstring"); + emit logs(hex"0000"); + emit log_named_bytes("0x0000", hex"0000"); + emit logs(hex"ff"); + } + function echo(string memory s1, string memory s2) public pure + returns (string memory, string memory) + { + return (s1, s2); + } + + function prove_this(uint x) public { + emit log_named_uint("sym x", x); + assertGt(x + 1, 0); + } + + function test_logn() public { + assembly { + log0(0x01, 0x02) + log1(0x01, 0x02, 0x03) + log2(0x01, 0x02, 0x03, 0x04) + log3(0x01, 0x02, 0x03, 0x04, 0x05) + } + } + + event MyEvent(uint, uint indexed, uint, uint indexed); + function test_events() public { + emit MyEvent(1, 2, 3, 4); + } + + function test_asserts() public { + string memory err = "this test has failed!"; + emit log("## assertTrue(bool)\n"); + assertTrue(false); + emit log("\n"); + assertTrue(false, err); + + emit log("\n## assertEq(address,address)\n"); + assertEq(address(this), msg.sender); + emit log("\n"); + assertEq(address(this), msg.sender, err); + + emit log("\n## assertEq32(bytes32,bytes32)\n"); + assertEq32("bytes 1", "bytes 2"); + emit log("\n"); + assertEq32("bytes 1", "bytes 2", err); + + emit log("\n## assertEq(bytes32,bytes32)\n"); + assertEq32("bytes 1", "bytes 2"); + emit log("\n"); + assertEq32("bytes 1", "bytes 2", err); + + emit log("\n## assertEq(uint,uint)\n"); + assertEq(uint(0), 1); + emit log("\n"); + assertEq(uint(0), 1, err); + + emit log("\n## assertEq(int,int)\n"); + assertEq(-1, -2); + emit log("\n"); + assertEq(-1, -2, err); + + emit log("\n## assertEqDecimal(int,int,uint)\n"); + assertEqDecimal(-1.0e18, -1.1e18, 18); + emit log("\n"); + assertEqDecimal(-1.0e18, -1.1e18, 18, err); + + emit log("\n## assertEqDecimal(uint,uint,uint)\n"); + assertEqDecimal(uint(1.0e18), 1.1e18, 18); + emit log("\n"); + assertEqDecimal(uint(1.0e18), 1.1e18, 18, err); + + emit log("\n## assertGt(uint,uint)\n"); + assertGt(uint(0), 0); + emit log("\n"); + assertGt(uint(0), 0, err); + + emit log("\n## assertGt(int,int)\n"); + assertGt(-1, -1); + emit log("\n"); + assertGt(-1, -1, err); + + emit log("\n## assertGtDecimal(int,int,uint)\n"); + assertGtDecimal(-2.0e18, -1.1e18, 18); + emit log("\n"); + assertGtDecimal(-2.0e18, -1.1e18, 18, err); + + emit log("\n## assertGtDecimal(uint,uint,uint)\n"); + assertGtDecimal(uint(1.0e18), 1.1e18, 18); + emit log("\n"); + assertGtDecimal(uint(1.0e18), 1.1e18, 18, err); + + emit log("\n## assertGe(uint,uint)\n"); + assertGe(uint(0), 1); + emit log("\n"); + assertGe(uint(0), 1, err); + + emit log("\n## assertGe(int,int)\n"); + assertGe(-1, 0); + emit log("\n"); + assertGe(-1, 0, err); + + emit log("\n## assertGeDecimal(int,int,uint)\n"); + assertGeDecimal(-2.0e18, -1.1e18, 18); + emit log("\n"); + assertGeDecimal(-2.0e18, -1.1e18, 18, err); + + emit log("\n## assertGeDecimal(uint,uint,uint)\n"); + assertGeDecimal(uint(1.0e18), 1.1e18, 18); + emit log("\n"); + assertGeDecimal(uint(1.0e18), 1.1e18, 18, err); + + emit log("\n## assertLt(uint,uint)\n"); + assertLt(uint(0), 0); + emit log("\n"); + assertLt(uint(0), 0, err); + + emit log("\n## assertLt(int,int)\n"); + assertLt(-1, -1); + emit log("\n"); + assertLt(-1, -1, err); + + emit log("\n## assertLtDecimal(int,int,uint)\n"); + assertLtDecimal(-1.0e18, -1.1e18, 18); + emit log("\n"); + assertLtDecimal(-1.0e18, -1.1e18, 18, err); + + emit log("\n## assertLtDecimal(uint,uint,uint)\n"); + assertLtDecimal(uint(2.0e18), 1.1e18, 18); + emit log("\n"); + assertLtDecimal(uint(2.0e18), 1.1e18, 18, err); + + emit log("\n## assertLe(uint,uint)\n"); + assertLe(uint(1), 0); + emit log("\n"); + assertLe(uint(1), 0, err); + + emit log("\n## assertLe(int,int)\n"); + assertLe(0, -1); + emit log("\n"); + assertLe(0, -1, err); + + emit log("\n## assertLeDecimal(int,int,uint)\n"); + assertLeDecimal(-1.0e18, -1.1e18, 18); + emit log("\n"); + assertLeDecimal(-1.0e18, -1.1e18, 18, err); + + emit log("\n## assertLeDecimal(uint,uint,uint)\n"); + assertLeDecimal(uint(2.0e18), 1.1e18, 18); + emit log("\n"); + assertLeDecimal(uint(2.0e18), 1.1e18, 18, err); + + emit log("\n## assertEq(string,string)\n"); + string memory s1 = "string 1"; + string memory s2 = "string 2"; + assertEq(s1, s2); + emit log("\n"); + assertEq(s1, s2, err); + + emit log("\n## assertEq0(bytes,bytes)\n"); + assertEq0(hex"abcdef01", hex"abcdef02"); + emit log("\n"); + assertEq0(hex"abcdef01", hex"abcdef02", err); + } +} + +contract DemoTestWithSetUp { + function setUp() public { + } + function test_pass() public pure { + } +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/package.json b/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/package.json new file mode 100644 index 00000000..4802adaa --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/package.json @@ -0,0 +1,15 @@ +{ + "name": "ds-test", + "version": "1.0.0", + "description": "Assertions, equality checks and other test helpers ", + "bugs": "https://github.com/dapphub/ds-test/issues", + "license": "GPL-3.0", + "author": "Contributors to ds-test", + "files": [ + "src/*" + ], + "repository": { + "type": "git", + "url": "https://github.com/dapphub/ds-test.git" + } +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/src/test.sol b/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/src/test.sol new file mode 100644 index 00000000..2bf33756 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/src/test.sol @@ -0,0 +1,592 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +pragma solidity >=0.5.0; + +contract DSTest { + event log (string); + event logs (bytes); + + event log_address (address); + event log_bytes32 (bytes32); + event log_int (int); + event log_uint (uint); + event log_bytes (bytes); + event log_string (string); + + event log_named_address (string key, address val); + event log_named_bytes32 (string key, bytes32 val); + event log_named_decimal_int (string key, int val, uint decimals); + event log_named_decimal_uint (string key, uint val, uint decimals); + event log_named_int (string key, int val); + event log_named_uint (string key, uint val); + event log_named_bytes (string key, bytes val); + event log_named_string (string key, string val); + + bool public IS_TEST = true; + bool private _failed; + + address constant HEVM_ADDRESS = + address(bytes20(uint160(uint256(keccak256('hevm cheat code'))))); + + modifier mayRevert() { _; } + modifier testopts(string memory) { _; } + + function failed() public returns (bool) { + if (_failed) { + return _failed; + } else { + bool globalFailed = false; + if (hasHEVMContext()) { + (, bytes memory retdata) = HEVM_ADDRESS.call( + abi.encodePacked( + bytes4(keccak256("load(address,bytes32)")), + abi.encode(HEVM_ADDRESS, bytes32("failed")) + ) + ); + globalFailed = abi.decode(retdata, (bool)); + } + return globalFailed; + } + } + + function fail() internal virtual { + if (hasHEVMContext()) { + (bool status, ) = HEVM_ADDRESS.call( + abi.encodePacked( + bytes4(keccak256("store(address,bytes32,bytes32)")), + abi.encode(HEVM_ADDRESS, bytes32("failed"), bytes32(uint256(0x01))) + ) + ); + status; // Silence compiler warnings + } + _failed = true; + } + + function hasHEVMContext() internal view returns (bool) { + uint256 hevmCodeSize = 0; + assembly { + hevmCodeSize := extcodesize(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D) + } + return hevmCodeSize > 0; + } + + modifier logs_gas() { + uint startGas = gasleft(); + _; + uint endGas = gasleft(); + emit log_named_uint("gas", startGas - endGas); + } + + function assertTrue(bool condition) internal { + if (!condition) { + emit log("Error: Assertion Failed"); + fail(); + } + } + + function assertTrue(bool condition, string memory err) internal { + if (!condition) { + emit log_named_string("Error", err); + assertTrue(condition); + } + } + + function assertEq(address a, address b) internal { + if (a != b) { + emit log("Error: a == b not satisfied [address]"); + emit log_named_address(" Left", a); + emit log_named_address(" Right", b); + fail(); + } + } + function assertEq(address a, address b, string memory err) internal { + if (a != b) { + emit log_named_string ("Error", err); + assertEq(a, b); + } + } + + function assertEq(bytes32 a, bytes32 b) internal { + if (a != b) { + emit log("Error: a == b not satisfied [bytes32]"); + emit log_named_bytes32(" Left", a); + emit log_named_bytes32(" Right", b); + fail(); + } + } + function assertEq(bytes32 a, bytes32 b, string memory err) internal { + if (a != b) { + emit log_named_string ("Error", err); + assertEq(a, b); + } + } + function assertEq32(bytes32 a, bytes32 b) internal { + assertEq(a, b); + } + function assertEq32(bytes32 a, bytes32 b, string memory err) internal { + assertEq(a, b, err); + } + + function assertEq(int a, int b) internal { + if (a != b) { + emit log("Error: a == b not satisfied [int]"); + emit log_named_int(" Left", a); + emit log_named_int(" Right", b); + fail(); + } + } + function assertEq(int a, int b, string memory err) internal { + if (a != b) { + emit log_named_string("Error", err); + assertEq(a, b); + } + } + function assertEq(uint a, uint b) internal { + if (a != b) { + emit log("Error: a == b not satisfied [uint]"); + emit log_named_uint(" Left", a); + emit log_named_uint(" Right", b); + fail(); + } + } + function assertEq(uint a, uint b, string memory err) internal { + if (a != b) { + emit log_named_string("Error", err); + assertEq(a, b); + } + } + function assertEqDecimal(int a, int b, uint decimals) internal { + if (a != b) { + emit log("Error: a == b not satisfied [decimal int]"); + emit log_named_decimal_int(" Left", a, decimals); + emit log_named_decimal_int(" Right", b, decimals); + fail(); + } + } + function assertEqDecimal(int a, int b, uint decimals, string memory err) internal { + if (a != b) { + emit log_named_string("Error", err); + assertEqDecimal(a, b, decimals); + } + } + function assertEqDecimal(uint a, uint b, uint decimals) internal { + if (a != b) { + emit log("Error: a == b not satisfied [decimal uint]"); + emit log_named_decimal_uint(" Left", a, decimals); + emit log_named_decimal_uint(" Right", b, decimals); + fail(); + } + } + function assertEqDecimal(uint a, uint b, uint decimals, string memory err) internal { + if (a != b) { + emit log_named_string("Error", err); + assertEqDecimal(a, b, decimals); + } + } + + function assertNotEq(address a, address b) internal { + if (a == b) { + emit log("Error: a != b not satisfied [address]"); + emit log_named_address(" Left", a); + emit log_named_address(" Right", b); + fail(); + } + } + function assertNotEq(address a, address b, string memory err) internal { + if (a == b) { + emit log_named_string ("Error", err); + assertNotEq(a, b); + } + } + + function assertNotEq(bytes32 a, bytes32 b) internal { + if (a == b) { + emit log("Error: a != b not satisfied [bytes32]"); + emit log_named_bytes32(" Left", a); + emit log_named_bytes32(" Right", b); + fail(); + } + } + function assertNotEq(bytes32 a, bytes32 b, string memory err) internal { + if (a == b) { + emit log_named_string ("Error", err); + assertNotEq(a, b); + } + } + function assertNotEq32(bytes32 a, bytes32 b) internal { + assertNotEq(a, b); + } + function assertNotEq32(bytes32 a, bytes32 b, string memory err) internal { + assertNotEq(a, b, err); + } + + function assertNotEq(int a, int b) internal { + if (a == b) { + emit log("Error: a != b not satisfied [int]"); + emit log_named_int(" Left", a); + emit log_named_int(" Right", b); + fail(); + } + } + function assertNotEq(int a, int b, string memory err) internal { + if (a == b) { + emit log_named_string("Error", err); + assertNotEq(a, b); + } + } + function assertNotEq(uint a, uint b) internal { + if (a == b) { + emit log("Error: a != b not satisfied [uint]"); + emit log_named_uint(" Left", a); + emit log_named_uint(" Right", b); + fail(); + } + } + function assertNotEq(uint a, uint b, string memory err) internal { + if (a == b) { + emit log_named_string("Error", err); + assertNotEq(a, b); + } + } + function assertNotEqDecimal(int a, int b, uint decimals) internal { + if (a == b) { + emit log("Error: a != b not satisfied [decimal int]"); + emit log_named_decimal_int(" Left", a, decimals); + emit log_named_decimal_int(" Right", b, decimals); + fail(); + } + } + function assertNotEqDecimal(int a, int b, uint decimals, string memory err) internal { + if (a == b) { + emit log_named_string("Error", err); + assertNotEqDecimal(a, b, decimals); + } + } + function assertNotEqDecimal(uint a, uint b, uint decimals) internal { + if (a == b) { + emit log("Error: a != b not satisfied [decimal uint]"); + emit log_named_decimal_uint(" Left", a, decimals); + emit log_named_decimal_uint(" Right", b, decimals); + fail(); + } + } + function assertNotEqDecimal(uint a, uint b, uint decimals, string memory err) internal { + if (a == b) { + emit log_named_string("Error", err); + assertNotEqDecimal(a, b, decimals); + } + } + + function assertGt(uint a, uint b) internal { + if (a <= b) { + emit log("Error: a > b not satisfied [uint]"); + emit log_named_uint(" Value a", a); + emit log_named_uint(" Value b", b); + fail(); + } + } + function assertGt(uint a, uint b, string memory err) internal { + if (a <= b) { + emit log_named_string("Error", err); + assertGt(a, b); + } + } + function assertGt(int a, int b) internal { + if (a <= b) { + emit log("Error: a > b not satisfied [int]"); + emit log_named_int(" Value a", a); + emit log_named_int(" Value b", b); + fail(); + } + } + function assertGt(int a, int b, string memory err) internal { + if (a <= b) { + emit log_named_string("Error", err); + assertGt(a, b); + } + } + function assertGtDecimal(int a, int b, uint decimals) internal { + if (a <= b) { + emit log("Error: a > b not satisfied [decimal int]"); + emit log_named_decimal_int(" Value a", a, decimals); + emit log_named_decimal_int(" Value b", b, decimals); + fail(); + } + } + function assertGtDecimal(int a, int b, uint decimals, string memory err) internal { + if (a <= b) { + emit log_named_string("Error", err); + assertGtDecimal(a, b, decimals); + } + } + function assertGtDecimal(uint a, uint b, uint decimals) internal { + if (a <= b) { + emit log("Error: a > b not satisfied [decimal uint]"); + emit log_named_decimal_uint(" Value a", a, decimals); + emit log_named_decimal_uint(" Value b", b, decimals); + fail(); + } + } + function assertGtDecimal(uint a, uint b, uint decimals, string memory err) internal { + if (a <= b) { + emit log_named_string("Error", err); + assertGtDecimal(a, b, decimals); + } + } + + function assertGe(uint a, uint b) internal { + if (a < b) { + emit log("Error: a >= b not satisfied [uint]"); + emit log_named_uint(" Value a", a); + emit log_named_uint(" Value b", b); + fail(); + } + } + function assertGe(uint a, uint b, string memory err) internal { + if (a < b) { + emit log_named_string("Error", err); + assertGe(a, b); + } + } + function assertGe(int a, int b) internal { + if (a < b) { + emit log("Error: a >= b not satisfied [int]"); + emit log_named_int(" Value a", a); + emit log_named_int(" Value b", b); + fail(); + } + } + function assertGe(int a, int b, string memory err) internal { + if (a < b) { + emit log_named_string("Error", err); + assertGe(a, b); + } + } + function assertGeDecimal(int a, int b, uint decimals) internal { + if (a < b) { + emit log("Error: a >= b not satisfied [decimal int]"); + emit log_named_decimal_int(" Value a", a, decimals); + emit log_named_decimal_int(" Value b", b, decimals); + fail(); + } + } + function assertGeDecimal(int a, int b, uint decimals, string memory err) internal { + if (a < b) { + emit log_named_string("Error", err); + assertGeDecimal(a, b, decimals); + } + } + function assertGeDecimal(uint a, uint b, uint decimals) internal { + if (a < b) { + emit log("Error: a >= b not satisfied [decimal uint]"); + emit log_named_decimal_uint(" Value a", a, decimals); + emit log_named_decimal_uint(" Value b", b, decimals); + fail(); + } + } + function assertGeDecimal(uint a, uint b, uint decimals, string memory err) internal { + if (a < b) { + emit log_named_string("Error", err); + assertGeDecimal(a, b, decimals); + } + } + + function assertLt(uint a, uint b) internal { + if (a >= b) { + emit log("Error: a < b not satisfied [uint]"); + emit log_named_uint(" Value a", a); + emit log_named_uint(" Value b", b); + fail(); + } + } + function assertLt(uint a, uint b, string memory err) internal { + if (a >= b) { + emit log_named_string("Error", err); + assertLt(a, b); + } + } + function assertLt(int a, int b) internal { + if (a >= b) { + emit log("Error: a < b not satisfied [int]"); + emit log_named_int(" Value a", a); + emit log_named_int(" Value b", b); + fail(); + } + } + function assertLt(int a, int b, string memory err) internal { + if (a >= b) { + emit log_named_string("Error", err); + assertLt(a, b); + } + } + function assertLtDecimal(int a, int b, uint decimals) internal { + if (a >= b) { + emit log("Error: a < b not satisfied [decimal int]"); + emit log_named_decimal_int(" Value a", a, decimals); + emit log_named_decimal_int(" Value b", b, decimals); + fail(); + } + } + function assertLtDecimal(int a, int b, uint decimals, string memory err) internal { + if (a >= b) { + emit log_named_string("Error", err); + assertLtDecimal(a, b, decimals); + } + } + function assertLtDecimal(uint a, uint b, uint decimals) internal { + if (a >= b) { + emit log("Error: a < b not satisfied [decimal uint]"); + emit log_named_decimal_uint(" Value a", a, decimals); + emit log_named_decimal_uint(" Value b", b, decimals); + fail(); + } + } + function assertLtDecimal(uint a, uint b, uint decimals, string memory err) internal { + if (a >= b) { + emit log_named_string("Error", err); + assertLtDecimal(a, b, decimals); + } + } + + function assertLe(uint a, uint b) internal { + if (a > b) { + emit log("Error: a <= b not satisfied [uint]"); + emit log_named_uint(" Value a", a); + emit log_named_uint(" Value b", b); + fail(); + } + } + function assertLe(uint a, uint b, string memory err) internal { + if (a > b) { + emit log_named_string("Error", err); + assertLe(a, b); + } + } + function assertLe(int a, int b) internal { + if (a > b) { + emit log("Error: a <= b not satisfied [int]"); + emit log_named_int(" Value a", a); + emit log_named_int(" Value b", b); + fail(); + } + } + function assertLe(int a, int b, string memory err) internal { + if (a > b) { + emit log_named_string("Error", err); + assertLe(a, b); + } + } + function assertLeDecimal(int a, int b, uint decimals) internal { + if (a > b) { + emit log("Error: a <= b not satisfied [decimal int]"); + emit log_named_decimal_int(" Value a", a, decimals); + emit log_named_decimal_int(" Value b", b, decimals); + fail(); + } + } + function assertLeDecimal(int a, int b, uint decimals, string memory err) internal { + if (a > b) { + emit log_named_string("Error", err); + assertLeDecimal(a, b, decimals); + } + } + function assertLeDecimal(uint a, uint b, uint decimals) internal { + if (a > b) { + emit log("Error: a <= b not satisfied [decimal uint]"); + emit log_named_decimal_uint(" Value a", a, decimals); + emit log_named_decimal_uint(" Value b", b, decimals); + fail(); + } + } + function assertLeDecimal(uint a, uint b, uint decimals, string memory err) internal { + if (a > b) { + emit log_named_string("Error", err); + assertLeDecimal(a, b, decimals); + } + } + + function assertEq(string memory a, string memory b) internal { + if (keccak256(abi.encodePacked(a)) != keccak256(abi.encodePacked(b))) { + emit log("Error: a == b not satisfied [string]"); + emit log_named_string(" Left", a); + emit log_named_string(" Right", b); + fail(); + } + } + function assertEq(string memory a, string memory b, string memory err) internal { + if (keccak256(abi.encodePacked(a)) != keccak256(abi.encodePacked(b))) { + emit log_named_string("Error", err); + assertEq(a, b); + } + } + + function assertNotEq(string memory a, string memory b) internal { + if (keccak256(abi.encodePacked(a)) == keccak256(abi.encodePacked(b))) { + emit log("Error: a != b not satisfied [string]"); + emit log_named_string(" Left", a); + emit log_named_string(" Right", b); + fail(); + } + } + function assertNotEq(string memory a, string memory b, string memory err) internal { + if (keccak256(abi.encodePacked(a)) == keccak256(abi.encodePacked(b))) { + emit log_named_string("Error", err); + assertNotEq(a, b); + } + } + + function checkEq0(bytes memory a, bytes memory b) internal pure returns (bool ok) { + ok = true; + if (a.length == b.length) { + for (uint i = 0; i < a.length; i++) { + if (a[i] != b[i]) { + ok = false; + } + } + } else { + ok = false; + } + } + function assertEq0(bytes memory a, bytes memory b) internal { + if (!checkEq0(a, b)) { + emit log("Error: a == b not satisfied [bytes]"); + emit log_named_bytes(" Left", a); + emit log_named_bytes(" Right", b); + fail(); + } + } + function assertEq0(bytes memory a, bytes memory b, string memory err) internal { + if (!checkEq0(a, b)) { + emit log_named_string("Error", err); + assertEq0(a, b); + } + } + + function assertNotEq0(bytes memory a, bytes memory b) internal { + if (checkEq0(a, b)) { + emit log("Error: a != b not satisfied [bytes]"); + emit log_named_bytes(" Left", a); + emit log_named_bytes(" Right", b); + fail(); + } + } + function assertNotEq0(bytes memory a, bytes memory b, string memory err) internal { + if (checkEq0(a, b)) { + emit log_named_string("Error", err); + assertNotEq0(a, b); + } + } +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/src/test.t.sol b/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/src/test.t.sol new file mode 100644 index 00000000..d277a309 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/lib/ds-test/src/test.t.sol @@ -0,0 +1,417 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity >=0.5.0; + +import {DSTest} from "./test.sol"; + +contract DemoTest is DSTest { + + // --- assertTrue --- + + function testAssertTrue() public { + assertTrue(true, "msg"); + assertTrue(true); + } + function testFailAssertTrue() public { + assertTrue(false); + } + function testFailAssertTrueWithMsg() public { + assertTrue(false, "msg"); + } + + // --- assertEq (Addr) --- + + function testAssertEqAddr() public { + assertEq(address(0x0), address(0x0), "msg"); + assertEq(address(0x0), address(0x0)); + } + function testFailAssertEqAddr() public { + assertEq(address(0x0), address(0x1)); + } + function testFailAssertEqAddrWithMsg() public { + assertEq(address(0x0), address(0x1), "msg"); + } + + // --- assertEq (Bytes32) --- + + function testAssertEqBytes32() public { + assertEq(bytes32("hi"), bytes32("hi"), "msg"); + assertEq(bytes32("hi"), bytes32("hi")); + } + function testFailAssertEqBytes32() public { + assertEq(bytes32("hi"), bytes32("ho")); + } + function testFailAssertEqBytes32WithMsg() public { + assertEq(bytes32("hi"), bytes32("ho"), "msg"); + } + + // --- assertEq (Int) --- + + function testAssertEqInt() public { + assertEq(-1, -1, "msg"); + assertEq(-1, -1); + } + function testFailAssertEqInt() public { + assertEq(-1, -2); + } + function testFailAssertEqIntWithMsg() public { + assertEq(-1, -2, "msg"); + } + + // --- assertEq (UInt) --- + + function testAssertEqUInt() public { + assertEq(uint(1), uint(1), "msg"); + assertEq(uint(1), uint(1)); + } + function testFailAssertEqUInt() public { + assertEq(uint(1), uint(2)); + } + function testFailAssertEqUIntWithMsg() public { + assertEq(uint(1), uint(2), "msg"); + } + + // --- assertEqDecimal (Int) --- + + function testAssertEqDecimalInt() public { + assertEqDecimal(-1, -1, 18, "msg"); + assertEqDecimal(-1, -1, 18); + } + function testFailAssertEqDecimalInt() public { + assertEqDecimal(-1, -2, 18); + } + function testFailAssertEqDecimalIntWithMsg() public { + assertEqDecimal(-1, -2, 18, "msg"); + } + + // --- assertEqDecimal (UInt) --- + + function testAssertEqDecimalUInt() public { + assertEqDecimal(uint(1), uint(1), 18, "msg"); + assertEqDecimal(uint(1), uint(1), 18); + } + function testFailAssertEqDecimalUInt() public { + assertEqDecimal(uint(1), uint(2), 18); + } + function testFailAssertEqDecimalUIntWithMsg() public { + assertEqDecimal(uint(1), uint(2), 18, "msg"); + } + + // --- assertNotEq (Addr) --- + + function testAssertNotEqAddr() public { + assertNotEq(address(0x0), address(0x1), "msg"); + assertNotEq(address(0x0), address(0x1)); + } + function testFailAssertNotEqAddr() public { + assertNotEq(address(0x0), address(0x0)); + } + function testFailAssertNotEqAddrWithMsg() public { + assertNotEq(address(0x0), address(0x0), "msg"); + } + + // --- assertNotEq (Bytes32) --- + + function testAssertNotEqBytes32() public { + assertNotEq(bytes32("hi"), bytes32("ho"), "msg"); + assertNotEq(bytes32("hi"), bytes32("ho")); + } + function testFailAssertNotEqBytes32() public { + assertNotEq(bytes32("hi"), bytes32("hi")); + } + function testFailAssertNotEqBytes32WithMsg() public { + assertNotEq(bytes32("hi"), bytes32("hi"), "msg"); + } + + // --- assertNotEq (Int) --- + + function testAssertNotEqInt() public { + assertNotEq(-1, -2, "msg"); + assertNotEq(-1, -2); + } + function testFailAssertNotEqInt() public { + assertNotEq(-1, -1); + } + function testFailAssertNotEqIntWithMsg() public { + assertNotEq(-1, -1, "msg"); + } + + // --- assertNotEq (UInt) --- + + function testAssertNotEqUInt() public { + assertNotEq(uint(1), uint(2), "msg"); + assertNotEq(uint(1), uint(2)); + } + function testFailAssertNotEqUInt() public { + assertNotEq(uint(1), uint(1)); + } + function testFailAssertNotEqUIntWithMsg() public { + assertNotEq(uint(1), uint(1), "msg"); + } + + // --- assertNotEqDecimal (Int) --- + + function testAssertNotEqDecimalInt() public { + assertNotEqDecimal(-1, -2, 18, "msg"); + assertNotEqDecimal(-1, -2, 18); + } + function testFailAssertNotEqDecimalInt() public { + assertNotEqDecimal(-1, -1, 18); + } + function testFailAssertNotEqDecimalIntWithMsg() public { + assertNotEqDecimal(-1, -1, 18, "msg"); + } + + // --- assertNotEqDecimal (UInt) --- + + function testAssertNotEqDecimalUInt() public { + assertNotEqDecimal(uint(1), uint(2), 18, "msg"); + assertNotEqDecimal(uint(1), uint(2), 18); + } + function testFailAssertNotEqDecimalUInt() public { + assertNotEqDecimal(uint(1), uint(1), 18); + } + function testFailAssertNotEqDecimalUIntWithMsg() public { + assertNotEqDecimal(uint(1), uint(1), 18, "msg"); + } + + // --- assertGt (UInt) --- + + function testAssertGtUInt() public { + assertGt(uint(2), uint(1), "msg"); + assertGt(uint(3), uint(2)); + } + function testFailAssertGtUInt() public { + assertGt(uint(1), uint(2)); + } + function testFailAssertGtUIntWithMsg() public { + assertGt(uint(1), uint(2), "msg"); + } + + // --- assertGt (Int) --- + + function testAssertGtInt() public { + assertGt(-1, -2, "msg"); + assertGt(-1, -3); + } + function testFailAssertGtInt() public { + assertGt(-2, -1); + } + function testFailAssertGtIntWithMsg() public { + assertGt(-2, -1, "msg"); + } + + // --- assertGtDecimal (UInt) --- + + function testAssertGtDecimalUInt() public { + assertGtDecimal(uint(2), uint(1), 18, "msg"); + assertGtDecimal(uint(3), uint(2), 18); + } + function testFailAssertGtDecimalUInt() public { + assertGtDecimal(uint(1), uint(2), 18); + } + function testFailAssertGtDecimalUIntWithMsg() public { + assertGtDecimal(uint(1), uint(2), 18, "msg"); + } + + // --- assertGtDecimal (Int) --- + + function testAssertGtDecimalInt() public { + assertGtDecimal(-1, -2, 18, "msg"); + assertGtDecimal(-1, -3, 18); + } + function testFailAssertGtDecimalInt() public { + assertGtDecimal(-2, -1, 18); + } + function testFailAssertGtDecimalIntWithMsg() public { + assertGtDecimal(-2, -1, 18, "msg"); + } + + // --- assertGe (UInt) --- + + function testAssertGeUInt() public { + assertGe(uint(2), uint(1), "msg"); + assertGe(uint(2), uint(2)); + } + function testFailAssertGeUInt() public { + assertGe(uint(1), uint(2)); + } + function testFailAssertGeUIntWithMsg() public { + assertGe(uint(1), uint(2), "msg"); + } + + // --- assertGe (Int) --- + + function testAssertGeInt() public { + assertGe(-1, -2, "msg"); + assertGe(-1, -1); + } + function testFailAssertGeInt() public { + assertGe(-2, -1); + } + function testFailAssertGeIntWithMsg() public { + assertGe(-2, -1, "msg"); + } + + // --- assertGeDecimal (UInt) --- + + function testAssertGeDecimalUInt() public { + assertGeDecimal(uint(2), uint(1), 18, "msg"); + assertGeDecimal(uint(2), uint(2), 18); + } + function testFailAssertGeDecimalUInt() public { + assertGeDecimal(uint(1), uint(2), 18); + } + function testFailAssertGeDecimalUIntWithMsg() public { + assertGeDecimal(uint(1), uint(2), 18, "msg"); + } + + // --- assertGeDecimal (Int) --- + + function testAssertGeDecimalInt() public { + assertGeDecimal(-1, -2, 18, "msg"); + assertGeDecimal(-1, -2, 18); + } + function testFailAssertGeDecimalInt() public { + assertGeDecimal(-2, -1, 18); + } + function testFailAssertGeDecimalIntWithMsg() public { + assertGeDecimal(-2, -1, 18, "msg"); + } + + // --- assertLt (UInt) --- + + function testAssertLtUInt() public { + assertLt(uint(1), uint(2), "msg"); + assertLt(uint(1), uint(3)); + } + function testFailAssertLtUInt() public { + assertLt(uint(2), uint(2)); + } + function testFailAssertLtUIntWithMsg() public { + assertLt(uint(3), uint(2), "msg"); + } + + // --- assertLt (Int) --- + + function testAssertLtInt() public { + assertLt(-2, -1, "msg"); + assertLt(-1, 0); + } + function testFailAssertLtInt() public { + assertLt(-1, -2); + } + function testFailAssertLtIntWithMsg() public { + assertLt(-1, -1, "msg"); + } + + // --- assertLtDecimal (UInt) --- + + function testAssertLtDecimalUInt() public { + assertLtDecimal(uint(1), uint(2), 18, "msg"); + assertLtDecimal(uint(2), uint(3), 18); + } + function testFailAssertLtDecimalUInt() public { + assertLtDecimal(uint(1), uint(1), 18); + } + function testFailAssertLtDecimalUIntWithMsg() public { + assertLtDecimal(uint(2), uint(1), 18, "msg"); + } + + // --- assertLtDecimal (Int) --- + + function testAssertLtDecimalInt() public { + assertLtDecimal(-2, -1, 18, "msg"); + assertLtDecimal(-2, -1, 18); + } + function testFailAssertLtDecimalInt() public { + assertLtDecimal(-2, -2, 18); + } + function testFailAssertLtDecimalIntWithMsg() public { + assertLtDecimal(-1, -2, 18, "msg"); + } + + // --- assertLe (UInt) --- + + function testAssertLeUInt() public { + assertLe(uint(1), uint(2), "msg"); + assertLe(uint(1), uint(1)); + } + function testFailAssertLeUInt() public { + assertLe(uint(4), uint(2)); + } + function testFailAssertLeUIntWithMsg() public { + assertLe(uint(3), uint(2), "msg"); + } + + // --- assertLe (Int) --- + + function testAssertLeInt() public { + assertLe(-2, -1, "msg"); + assertLe(-1, -1); + } + function testFailAssertLeInt() public { + assertLe(-1, -2); + } + function testFailAssertLeIntWithMsg() public { + assertLe(-1, -3, "msg"); + } + + // --- assertLeDecimal (UInt) --- + + function testAssertLeDecimalUInt() public { + assertLeDecimal(uint(1), uint(2), 18, "msg"); + assertLeDecimal(uint(2), uint(2), 18); + } + function testFailAssertLeDecimalUInt() public { + assertLeDecimal(uint(1), uint(0), 18); + } + function testFailAssertLeDecimalUIntWithMsg() public { + assertLeDecimal(uint(1), uint(0), 18, "msg"); + } + + // --- assertLeDecimal (Int) --- + + function testAssertLeDecimalInt() public { + assertLeDecimal(-2, -1, 18, "msg"); + assertLeDecimal(-2, -2, 18); + } + function testFailAssertLeDecimalInt() public { + assertLeDecimal(-2, -3, 18); + } + function testFailAssertLeDecimalIntWithMsg() public { + assertLeDecimal(-1, -2, 18, "msg"); + } + + // --- assertNotEq (String) --- + + function testAssertNotEqString() public { + assertNotEq(new string(1), new string(2), "msg"); + assertNotEq(new string(1), new string(2)); + } + function testFailAssertNotEqString() public { + assertNotEq(new string(1), new string(1)); + } + function testFailAssertNotEqStringWithMsg() public { + assertNotEq(new string(1), new string(1), "msg"); + } + + // --- assertNotEq0 (Bytes) --- + + function testAssertNotEq0Bytes() public { + assertNotEq0(bytes("hi"), bytes("ho"), "msg"); + assertNotEq0(bytes("hi"), bytes("ho")); + } + function testFailAssertNotEq0Bytes() public { + assertNotEq0(bytes("hi"), bytes("hi")); + } + function testFailAssertNotEq0BytesWithMsg() public { + assertNotEq0(bytes("hi"), bytes("hi"), "msg"); + } + + // --- fail override --- + + // ensure that fail can be overridden + function fail() internal override { + super.fail(); + } +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/package.json b/harness/solidity_sized_tx_contract/lib/forge-std/package.json new file mode 100644 index 00000000..5b18b423 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/package.json @@ -0,0 +1,16 @@ +{ + "name": "forge-std", + "version": "1.7.5", + "description": "Forge Standard Library is a collection of helpful contracts and libraries for use with Forge and Foundry.", + "homepage": "https://book.getfoundry.sh/forge/forge-std", + "bugs": "https://github.com/foundry-rs/forge-std/issues", + "license": "(Apache-2.0 OR MIT)", + "author": "Contributors to Forge Standard Library", + "files": [ + "src/**/*" + ], + "repository": { + "type": "git", + "url": "https://github.com/foundry-rs/forge-std.git" + } +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/scripts/vm.py b/harness/solidity_sized_tx_contract/lib/forge-std/scripts/vm.py new file mode 100755 index 00000000..eefb4b7e --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/scripts/vm.py @@ -0,0 +1,666 @@ +#!/usr/bin/env python3 + +import copy +import json +import re +import subprocess +from enum import Enum as PyEnum +from typing import Callable +from urllib import request + +VoidFn = Callable[[], None] + +CHEATCODES_JSON_URL = "https://raw.githubusercontent.com/foundry-rs/foundry/master/crates/cheatcodes/assets/cheatcodes.json" +OUT_PATH = "src/Vm.sol" + +VM_SAFE_DOC = """\ +/// The `VmSafe` interface does not allow manipulation of the EVM state or other actions that may +/// result in Script simulations differing from on-chain execution. It is recommended to only use +/// these cheats in scripts. +""" + +VM_DOC = """\ +/// The `Vm` interface does allow manipulation of the EVM state. These are all intended to be used +/// in tests, but it is not recommended to use these cheats in scripts. +""" + + +def main(): + json_str = request.urlopen(CHEATCODES_JSON_URL).read().decode("utf-8") + contract = Cheatcodes.from_json(json_str) + + ccs = contract.cheatcodes + ccs = list(filter(lambda cc: cc.status != Status.EXPERIMENTAL, ccs)) + ccs.sort(key=lambda cc: cc.func.id) + + safe = list(filter(lambda cc: cc.safety == Safety.SAFE, ccs)) + safe.sort(key=CmpCheatcode) + unsafe = list(filter(lambda cc: cc.safety == Safety.UNSAFE, ccs)) + unsafe.sort(key=CmpCheatcode) + assert len(safe) + len(unsafe) == len(ccs) + + prefix_with_group_headers(safe) + prefix_with_group_headers(unsafe) + + out = "" + + out += "// Automatically @generated by scripts/vm.py. Do not modify manually.\n\n" + + pp = CheatcodesPrinter( + spdx_identifier="MIT OR Apache-2.0", + solidity_requirement=">=0.6.2 <0.9.0", + abicoder_pragma=True, + ) + pp.p_prelude() + pp.prelude = False + out += pp.finish() + + out += "\n\n" + out += VM_SAFE_DOC + vm_safe = Cheatcodes( + # TODO: Custom errors were introduced in 0.8.4 + errors=[], # contract.errors + events=contract.events, + enums=contract.enums, + structs=contract.structs, + cheatcodes=safe, + ) + pp.p_contract(vm_safe, "VmSafe") + out += pp.finish() + + out += "\n\n" + out += VM_DOC + vm_unsafe = Cheatcodes( + errors=[], + events=[], + enums=[], + structs=[], + cheatcodes=unsafe, + ) + pp.p_contract(vm_unsafe, "Vm", "VmSafe") + out += pp.finish() + + # Compatibility with <0.8.0 + def memory_to_calldata(m: re.Match) -> str: + return " calldata " + m.group(1) + + out = re.sub(r" memory (.*returns)", memory_to_calldata, out) + + with open(OUT_PATH, "w") as f: + f.write(out) + + forge_fmt = ["forge", "fmt", OUT_PATH] + res = subprocess.run(forge_fmt) + assert res.returncode == 0, f"command failed: {forge_fmt}" + + print(f"Wrote to {OUT_PATH}") + + +class CmpCheatcode: + cheatcode: "Cheatcode" + + def __init__(self, cheatcode: "Cheatcode"): + self.cheatcode = cheatcode + + def __lt__(self, other: "CmpCheatcode") -> bool: + return cmp_cheatcode(self.cheatcode, other.cheatcode) < 0 + + def __eq__(self, other: "CmpCheatcode") -> bool: + return cmp_cheatcode(self.cheatcode, other.cheatcode) == 0 + + def __gt__(self, other: "CmpCheatcode") -> bool: + return cmp_cheatcode(self.cheatcode, other.cheatcode) > 0 + + +def cmp_cheatcode(a: "Cheatcode", b: "Cheatcode") -> int: + if a.group != b.group: + return -1 if a.group < b.group else 1 + if a.status != b.status: + return -1 if a.status < b.status else 1 + if a.safety != b.safety: + return -1 if a.safety < b.safety else 1 + if a.func.id != b.func.id: + return -1 if a.func.id < b.func.id else 1 + return 0 + + +# HACK: A way to add group header comments without having to modify printer code +def prefix_with_group_headers(cheats: list["Cheatcode"]): + s = set() + for i, cheat in enumerate(cheats): + if cheat.group in s: + continue + + s.add(cheat.group) + + c = copy.deepcopy(cheat) + c.func.description = "" + c.func.declaration = f"// ======== {c.group} ========" + cheats.insert(i, c) + return cheats + + +class Status(PyEnum): + STABLE: str = "stable" + EXPERIMENTAL: str = "experimental" + DEPRECATED: str = "deprecated" + REMOVED: str = "removed" + + def __lt__(self, other: "Group") -> bool: + return self.value < other.value + + +class Group(PyEnum): + EVM: str = "evm" + TESTING: str = "testing" + SCRIPTING: str = "scripting" + FILESYSTEM: str = "filesystem" + ENVIRONMENT: str = "environment" + STRING: str = "string" + JSON: str = "json" + UTILITIES: str = "utilities" + + def __str__(self): + if self == Group.EVM: + return "EVM" + if self == Group.JSON: + return "JSON" + return self.value[0].upper() + self.value[1:] + + def __lt__(self, other: "Group") -> bool: + return self.value < other.value + + +class Safety(PyEnum): + UNSAFE: str = "unsafe" + SAFE: str = "safe" + + def __lt__(self, other: "Group") -> bool: + return self.value < other.value + + +class Visibility(PyEnum): + EXTERNAL: str = "external" + PUBLIC: str = "public" + INTERNAL: str = "internal" + PRIVATE: str = "private" + + def __str__(self): + return self.value + + +class Mutability(PyEnum): + PURE: str = "pure" + VIEW: str = "view" + NONE: str = "" + + def __str__(self): + return self.value + + +class Function: + id: str + description: str + declaration: str + visibility: Visibility + mutability: Mutability + signature: str + selector: str + selector_bytes: bytes + + def __init__( + self, + id: str, + description: str, + declaration: str, + visibility: Visibility, + mutability: Mutability, + signature: str, + selector: str, + selector_bytes: bytes, + ): + self.id = id + self.description = description + self.declaration = declaration + self.visibility = visibility + self.mutability = mutability + self.signature = signature + self.selector = selector + self.selector_bytes = selector_bytes + + @staticmethod + def from_dict(d: dict) -> "Function": + return Function( + d["id"], + d["description"], + d["declaration"], + Visibility(d["visibility"]), + Mutability(d["mutability"]), + d["signature"], + d["selector"], + bytes(d["selectorBytes"]), + ) + + +class Cheatcode: + func: Function + group: Group + status: Status + safety: Safety + + def __init__(self, func: Function, group: Group, status: Status, safety: Safety): + self.func = func + self.group = group + self.status = status + self.safety = safety + + @staticmethod + def from_dict(d: dict) -> "Cheatcode": + return Cheatcode( + Function.from_dict(d["func"]), + Group(d["group"]), + Status(d["status"]), + Safety(d["safety"]), + ) + + +class Error: + name: str + description: str + declaration: str + + def __init__(self, name: str, description: str, declaration: str): + self.name = name + self.description = description + self.declaration = declaration + + @staticmethod + def from_dict(d: dict) -> "Error": + return Error(**d) + + +class Event: + name: str + description: str + declaration: str + + def __init__(self, name: str, description: str, declaration: str): + self.name = name + self.description = description + self.declaration = declaration + + @staticmethod + def from_dict(d: dict) -> "Event": + return Event(**d) + + +class EnumVariant: + name: str + description: str + + def __init__(self, name: str, description: str): + self.name = name + self.description = description + + +class Enum: + name: str + description: str + variants: list[EnumVariant] + + def __init__(self, name: str, description: str, variants: list[EnumVariant]): + self.name = name + self.description = description + self.variants = variants + + @staticmethod + def from_dict(d: dict) -> "Enum": + return Enum( + d["name"], + d["description"], + list(map(lambda v: EnumVariant(**v), d["variants"])), + ) + + +class StructField: + name: str + ty: str + description: str + + def __init__(self, name: str, ty: str, description: str): + self.name = name + self.ty = ty + self.description = description + + +class Struct: + name: str + description: str + fields: list[StructField] + + def __init__(self, name: str, description: str, fields: list[StructField]): + self.name = name + self.description = description + self.fields = fields + + @staticmethod + def from_dict(d: dict) -> "Struct": + return Struct( + d["name"], + d["description"], + list(map(lambda f: StructField(**f), d["fields"])), + ) + + +class Cheatcodes: + errors: list[Error] + events: list[Event] + enums: list[Enum] + structs: list[Struct] + cheatcodes: list[Cheatcode] + + def __init__( + self, + errors: list[Error], + events: list[Event], + enums: list[Enum], + structs: list[Struct], + cheatcodes: list[Cheatcode], + ): + self.errors = errors + self.events = events + self.enums = enums + self.structs = structs + self.cheatcodes = cheatcodes + + @staticmethod + def from_dict(d: dict) -> "Cheatcodes": + return Cheatcodes( + errors=[Error.from_dict(e) for e in d["errors"]], + events=[Event.from_dict(e) for e in d["events"]], + enums=[Enum.from_dict(e) for e in d["enums"]], + structs=[Struct.from_dict(e) for e in d["structs"]], + cheatcodes=[Cheatcode.from_dict(e) for e in d["cheatcodes"]], + ) + + @staticmethod + def from_json(s) -> "Cheatcodes": + return Cheatcodes.from_dict(json.loads(s)) + + @staticmethod + def from_json_file(file_path: str) -> "Cheatcodes": + with open(file_path, "r") as f: + return Cheatcodes.from_dict(json.load(f)) + + +class Item(PyEnum): + ERROR: str = "error" + EVENT: str = "event" + ENUM: str = "enum" + STRUCT: str = "struct" + FUNCTION: str = "function" + + +class ItemOrder: + _list: list[Item] + + def __init__(self, list: list[Item]) -> None: + assert len(list) <= len(Item), "list must not contain more items than Item" + assert len(list) == len(set(list)), "list must not contain duplicates" + self._list = list + pass + + def get_list(self) -> list[Item]: + return self._list + + @staticmethod + def default() -> "ItemOrder": + return ItemOrder( + [ + Item.ERROR, + Item.EVENT, + Item.ENUM, + Item.STRUCT, + Item.FUNCTION, + ] + ) + + +class CheatcodesPrinter: + buffer: str + + prelude: bool + spdx_identifier: str + solidity_requirement: str + abicoder_v2: bool + + block_doc_style: bool + + indent_level: int + _indent_str: str + + nl_str: str + + items_order: ItemOrder + + def __init__( + self, + buffer: str = "", + prelude: bool = True, + spdx_identifier: str = "UNLICENSED", + solidity_requirement: str = "", + abicoder_pragma: bool = False, + block_doc_style: bool = False, + indent_level: int = 0, + indent_with: int | str = 4, + nl_str: str = "\n", + items_order: ItemOrder = ItemOrder.default(), + ): + self.prelude = prelude + self.spdx_identifier = spdx_identifier + self.solidity_requirement = solidity_requirement + self.abicoder_v2 = abicoder_pragma + self.block_doc_style = block_doc_style + self.buffer = buffer + self.indent_level = indent_level + self.nl_str = nl_str + + if isinstance(indent_with, int): + assert indent_with >= 0 + self._indent_str = " " * indent_with + elif isinstance(indent_with, str): + self._indent_str = indent_with + else: + assert False, "indent_with must be int or str" + + self.items_order = items_order + + def finish(self) -> str: + ret = self.buffer.rstrip() + self.buffer = "" + return ret + + def p_contract(self, contract: Cheatcodes, name: str, inherits: str = ""): + if self.prelude: + self.p_prelude(contract) + + self._p_str("interface ") + name = name.strip() + if name != "": + self._p_str(name) + self._p_str(" ") + if inherits != "": + self._p_str("is ") + self._p_str(inherits) + self._p_str(" ") + self._p_str("{") + self._p_nl() + self._with_indent(lambda: self._p_items(contract)) + self._p_str("}") + self._p_nl() + + def _p_items(self, contract: Cheatcodes): + for item in self.items_order.get_list(): + if item == Item.ERROR: + self.p_errors(contract.errors) + elif item == Item.EVENT: + self.p_events(contract.events) + elif item == Item.ENUM: + self.p_enums(contract.enums) + elif item == Item.STRUCT: + self.p_structs(contract.structs) + elif item == Item.FUNCTION: + self.p_functions(contract.cheatcodes) + else: + assert False, f"unknown item {item}" + + def p_prelude(self, contract: Cheatcodes | None = None): + self._p_str(f"// SPDX-License-Identifier: {self.spdx_identifier}") + self._p_nl() + + if self.solidity_requirement != "": + req = self.solidity_requirement + elif contract and len(contract.errors) > 0: + req = ">=0.8.4 <0.9.0" + else: + req = ">=0.6.0 <0.9.0" + self._p_str(f"pragma solidity {req};") + self._p_nl() + + if self.abicoder_v2: + self._p_str("pragma experimental ABIEncoderV2;") + self._p_nl() + + self._p_nl() + + def p_errors(self, errors: list[Error]): + for error in errors: + self._p_line(lambda: self.p_error(error)) + + def p_error(self, error: Error): + self._p_comment(error.description, doc=True) + self._p_line(lambda: self._p_str(error.declaration)) + + def p_events(self, events: list[Event]): + for event in events: + self._p_line(lambda: self.p_event(event)) + + def p_event(self, event: Event): + self._p_comment(event.description, doc=True) + self._p_line(lambda: self._p_str(event.declaration)) + + def p_enums(self, enums: list[Enum]): + for enum in enums: + self._p_line(lambda: self.p_enum(enum)) + + def p_enum(self, enum: Enum): + self._p_comment(enum.description, doc=True) + self._p_line(lambda: self._p_str(f"enum {enum.name} {{")) + self._with_indent(lambda: self.p_enum_variants(enum.variants)) + self._p_line(lambda: self._p_str("}")) + + def p_enum_variants(self, variants: list[EnumVariant]): + for i, variant in enumerate(variants): + self._p_indent() + self._p_comment(variant.description) + + self._p_indent() + self._p_str(variant.name) + if i < len(variants) - 1: + self._p_str(",") + self._p_nl() + + def p_structs(self, structs: list[Struct]): + for struct in structs: + self._p_line(lambda: self.p_struct(struct)) + + def p_struct(self, struct: Struct): + self._p_comment(struct.description, doc=True) + self._p_line(lambda: self._p_str(f"struct {struct.name} {{")) + self._with_indent(lambda: self.p_struct_fields(struct.fields)) + self._p_line(lambda: self._p_str("}")) + + def p_struct_fields(self, fields: list[StructField]): + for field in fields: + self._p_line(lambda: self.p_struct_field(field)) + + def p_struct_field(self, field: StructField): + self._p_comment(field.description) + self._p_indented(lambda: self._p_str(f"{field.ty} {field.name};")) + + def p_functions(self, cheatcodes: list[Cheatcode]): + for cheatcode in cheatcodes: + self._p_line(lambda: self.p_function(cheatcode.func)) + + def p_function(self, func: Function): + self._p_comment(func.description, doc=True) + self._p_line(lambda: self._p_str(func.declaration)) + + def _p_comment(self, s: str, doc: bool = False): + s = s.strip() + if s == "": + return + + s = map(lambda line: line.lstrip(), s.split("\n")) + if self.block_doc_style: + self._p_str("/*") + if doc: + self._p_str("*") + self._p_nl() + for line in s: + self._p_indent() + self._p_str(" ") + if doc: + self._p_str("* ") + self._p_str(line) + self._p_nl() + self._p_indent() + self._p_str(" */") + self._p_nl() + else: + first_line = True + for line in s: + if not first_line: + self._p_indent() + first_line = False + + if doc: + self._p_str("/// ") + else: + self._p_str("// ") + self._p_str(line) + self._p_nl() + + def _with_indent(self, f: VoidFn): + self._inc_indent() + f() + self._dec_indent() + + def _p_line(self, f: VoidFn): + self._p_indent() + f() + self._p_nl() + + def _p_indented(self, f: VoidFn): + self._p_indent() + f() + + def _p_indent(self): + for _ in range(self.indent_level): + self._p_str(self._indent_str) + + def _p_nl(self): + self._p_str(self.nl_str) + + def _p_str(self, txt: str): + self.buffer += txt + + def _inc_indent(self): + self.indent_level += 1 + + def _dec_indent(self): + self.indent_level -= 1 + + +if __name__ == "__main__": + main() diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/src/Base.sol b/harness/solidity_sized_tx_contract/lib/forge-std/src/Base.sol new file mode 100644 index 00000000..851ac0cd --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/src/Base.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.2 <0.9.0; + +import {StdStorage} from "./StdStorage.sol"; +import {Vm, VmSafe} from "./Vm.sol"; + +abstract contract CommonBase { + // Cheat code address, 0x7109709ECfa91a80626fF3989D68f67F5b1DD12D. + address internal constant VM_ADDRESS = address(uint160(uint256(keccak256("hevm cheat code")))); + // console.sol and console2.sol work by executing a staticcall to this address. + address internal constant CONSOLE = 0x000000000000000000636F6e736F6c652e6c6f67; + // Used when deploying with create2, https://github.com/Arachnid/deterministic-deployment-proxy. + address internal constant CREATE2_FACTORY = 0x4e59b44847b379578588920cA78FbF26c0B4956C; + // Default address for tx.origin and msg.sender, 0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38. + address internal constant DEFAULT_SENDER = address(uint160(uint256(keccak256("foundry default caller")))); + // Address of the test contract, deployed by the DEFAULT_SENDER. + address internal constant DEFAULT_TEST_CONTRACT = 0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f; + // Deterministic deployment address of the Multicall3 contract. + address internal constant MULTICALL3_ADDRESS = 0xcA11bde05977b3631167028862bE2a173976CA11; + // The order of the secp256k1 curve. + uint256 internal constant SECP256K1_ORDER = + 115792089237316195423570985008687907852837564279074904382605163141518161494337; + + uint256 internal constant UINT256_MAX = + 115792089237316195423570985008687907853269984665640564039457584007913129639935; + + Vm internal constant vm = Vm(VM_ADDRESS); + StdStorage internal stdstore; +} + +abstract contract TestBase is CommonBase {} + +abstract contract ScriptBase is CommonBase { + VmSafe internal constant vmSafe = VmSafe(VM_ADDRESS); +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/src/Script.sol b/harness/solidity_sized_tx_contract/lib/forge-std/src/Script.sol new file mode 100644 index 00000000..94e75f6c --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/src/Script.sol @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.2 <0.9.0; + +// 💬 ABOUT +// Forge Std's default Script. + +// 🧩 MODULES +import {console} from "./console.sol"; +import {console2} from "./console2.sol"; +import {safeconsole} from "./safeconsole.sol"; +import {StdChains} from "./StdChains.sol"; +import {StdCheatsSafe} from "./StdCheats.sol"; +import {stdJson} from "./StdJson.sol"; +import {stdMath} from "./StdMath.sol"; +import {StdStorage, stdStorageSafe} from "./StdStorage.sol"; +import {StdStyle} from "./StdStyle.sol"; +import {StdUtils} from "./StdUtils.sol"; +import {VmSafe} from "./Vm.sol"; + +// 📦 BOILERPLATE +import {ScriptBase} from "./Base.sol"; + +// ⭐️ SCRIPT +abstract contract Script is ScriptBase, StdChains, StdCheatsSafe, StdUtils { + // Note: IS_SCRIPT() must return true. + bool public IS_SCRIPT = true; +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/src/StdAssertions.sol b/harness/solidity_sized_tx_contract/lib/forge-std/src/StdAssertions.sol new file mode 100644 index 00000000..2778b3a0 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/src/StdAssertions.sol @@ -0,0 +1,376 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.2 <0.9.0; + +import {DSTest} from "ds-test/test.sol"; +import {stdMath} from "./StdMath.sol"; + +abstract contract StdAssertions is DSTest { + event log_array(uint256[] val); + event log_array(int256[] val); + event log_array(address[] val); + event log_named_array(string key, uint256[] val); + event log_named_array(string key, int256[] val); + event log_named_array(string key, address[] val); + + function fail(string memory err) internal virtual { + emit log_named_string("Error", err); + fail(); + } + + function assertFalse(bool data) internal virtual { + assertTrue(!data); + } + + function assertFalse(bool data, string memory err) internal virtual { + assertTrue(!data, err); + } + + function assertEq(bool a, bool b) internal virtual { + if (a != b) { + emit log("Error: a == b not satisfied [bool]"); + emit log_named_string(" Left", a ? "true" : "false"); + emit log_named_string(" Right", b ? "true" : "false"); + fail(); + } + } + + function assertEq(bool a, bool b, string memory err) internal virtual { + if (a != b) { + emit log_named_string("Error", err); + assertEq(a, b); + } + } + + function assertEq(bytes memory a, bytes memory b) internal virtual { + assertEq0(a, b); + } + + function assertEq(bytes memory a, bytes memory b, string memory err) internal virtual { + assertEq0(a, b, err); + } + + function assertEq(uint256[] memory a, uint256[] memory b) internal virtual { + if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { + emit log("Error: a == b not satisfied [uint[]]"); + emit log_named_array(" Left", a); + emit log_named_array(" Right", b); + fail(); + } + } + + function assertEq(int256[] memory a, int256[] memory b) internal virtual { + if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { + emit log("Error: a == b not satisfied [int[]]"); + emit log_named_array(" Left", a); + emit log_named_array(" Right", b); + fail(); + } + } + + function assertEq(address[] memory a, address[] memory b) internal virtual { + if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { + emit log("Error: a == b not satisfied [address[]]"); + emit log_named_array(" Left", a); + emit log_named_array(" Right", b); + fail(); + } + } + + function assertEq(uint256[] memory a, uint256[] memory b, string memory err) internal virtual { + if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { + emit log_named_string("Error", err); + assertEq(a, b); + } + } + + function assertEq(int256[] memory a, int256[] memory b, string memory err) internal virtual { + if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { + emit log_named_string("Error", err); + assertEq(a, b); + } + } + + function assertEq(address[] memory a, address[] memory b, string memory err) internal virtual { + if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { + emit log_named_string("Error", err); + assertEq(a, b); + } + } + + // Legacy helper + function assertEqUint(uint256 a, uint256 b) internal virtual { + assertEq(uint256(a), uint256(b)); + } + + function assertApproxEqAbs(uint256 a, uint256 b, uint256 maxDelta) internal virtual { + uint256 delta = stdMath.delta(a, b); + + if (delta > maxDelta) { + emit log("Error: a ~= b not satisfied [uint]"); + emit log_named_uint(" Left", a); + emit log_named_uint(" Right", b); + emit log_named_uint(" Max Delta", maxDelta); + emit log_named_uint(" Delta", delta); + fail(); + } + } + + function assertApproxEqAbs(uint256 a, uint256 b, uint256 maxDelta, string memory err) internal virtual { + uint256 delta = stdMath.delta(a, b); + + if (delta > maxDelta) { + emit log_named_string("Error", err); + assertApproxEqAbs(a, b, maxDelta); + } + } + + function assertApproxEqAbsDecimal(uint256 a, uint256 b, uint256 maxDelta, uint256 decimals) internal virtual { + uint256 delta = stdMath.delta(a, b); + + if (delta > maxDelta) { + emit log("Error: a ~= b not satisfied [uint]"); + emit log_named_decimal_uint(" Left", a, decimals); + emit log_named_decimal_uint(" Right", b, decimals); + emit log_named_decimal_uint(" Max Delta", maxDelta, decimals); + emit log_named_decimal_uint(" Delta", delta, decimals); + fail(); + } + } + + function assertApproxEqAbsDecimal(uint256 a, uint256 b, uint256 maxDelta, uint256 decimals, string memory err) + internal + virtual + { + uint256 delta = stdMath.delta(a, b); + + if (delta > maxDelta) { + emit log_named_string("Error", err); + assertApproxEqAbsDecimal(a, b, maxDelta, decimals); + } + } + + function assertApproxEqAbs(int256 a, int256 b, uint256 maxDelta) internal virtual { + uint256 delta = stdMath.delta(a, b); + + if (delta > maxDelta) { + emit log("Error: a ~= b not satisfied [int]"); + emit log_named_int(" Left", a); + emit log_named_int(" Right", b); + emit log_named_uint(" Max Delta", maxDelta); + emit log_named_uint(" Delta", delta); + fail(); + } + } + + function assertApproxEqAbs(int256 a, int256 b, uint256 maxDelta, string memory err) internal virtual { + uint256 delta = stdMath.delta(a, b); + + if (delta > maxDelta) { + emit log_named_string("Error", err); + assertApproxEqAbs(a, b, maxDelta); + } + } + + function assertApproxEqAbsDecimal(int256 a, int256 b, uint256 maxDelta, uint256 decimals) internal virtual { + uint256 delta = stdMath.delta(a, b); + + if (delta > maxDelta) { + emit log("Error: a ~= b not satisfied [int]"); + emit log_named_decimal_int(" Left", a, decimals); + emit log_named_decimal_int(" Right", b, decimals); + emit log_named_decimal_uint(" Max Delta", maxDelta, decimals); + emit log_named_decimal_uint(" Delta", delta, decimals); + fail(); + } + } + + function assertApproxEqAbsDecimal(int256 a, int256 b, uint256 maxDelta, uint256 decimals, string memory err) + internal + virtual + { + uint256 delta = stdMath.delta(a, b); + + if (delta > maxDelta) { + emit log_named_string("Error", err); + assertApproxEqAbsDecimal(a, b, maxDelta, decimals); + } + } + + function assertApproxEqRel( + uint256 a, + uint256 b, + uint256 maxPercentDelta // An 18 decimal fixed point number, where 1e18 == 100% + ) internal virtual { + if (b == 0) return assertEq(a, b); // If the left is 0, right must be too. + + uint256 percentDelta = stdMath.percentDelta(a, b); + + if (percentDelta > maxPercentDelta) { + emit log("Error: a ~= b not satisfied [uint]"); + emit log_named_uint(" Left", a); + emit log_named_uint(" Right", b); + emit log_named_decimal_uint(" Max % Delta", maxPercentDelta * 100, 18); + emit log_named_decimal_uint(" % Delta", percentDelta * 100, 18); + fail(); + } + } + + function assertApproxEqRel( + uint256 a, + uint256 b, + uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100% + string memory err + ) internal virtual { + if (b == 0) return assertEq(a, b, err); // If the left is 0, right must be too. + + uint256 percentDelta = stdMath.percentDelta(a, b); + + if (percentDelta > maxPercentDelta) { + emit log_named_string("Error", err); + assertApproxEqRel(a, b, maxPercentDelta); + } + } + + function assertApproxEqRelDecimal( + uint256 a, + uint256 b, + uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100% + uint256 decimals + ) internal virtual { + if (b == 0) return assertEq(a, b); // If the left is 0, right must be too. + + uint256 percentDelta = stdMath.percentDelta(a, b); + + if (percentDelta > maxPercentDelta) { + emit log("Error: a ~= b not satisfied [uint]"); + emit log_named_decimal_uint(" Left", a, decimals); + emit log_named_decimal_uint(" Right", b, decimals); + emit log_named_decimal_uint(" Max % Delta", maxPercentDelta * 100, 18); + emit log_named_decimal_uint(" % Delta", percentDelta * 100, 18); + fail(); + } + } + + function assertApproxEqRelDecimal( + uint256 a, + uint256 b, + uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100% + uint256 decimals, + string memory err + ) internal virtual { + if (b == 0) return assertEq(a, b, err); // If the left is 0, right must be too. + + uint256 percentDelta = stdMath.percentDelta(a, b); + + if (percentDelta > maxPercentDelta) { + emit log_named_string("Error", err); + assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals); + } + } + + function assertApproxEqRel(int256 a, int256 b, uint256 maxPercentDelta) internal virtual { + if (b == 0) return assertEq(a, b); // If the left is 0, right must be too. + + uint256 percentDelta = stdMath.percentDelta(a, b); + + if (percentDelta > maxPercentDelta) { + emit log("Error: a ~= b not satisfied [int]"); + emit log_named_int(" Left", a); + emit log_named_int(" Right", b); + emit log_named_decimal_uint(" Max % Delta", maxPercentDelta * 100, 18); + emit log_named_decimal_uint(" % Delta", percentDelta * 100, 18); + fail(); + } + } + + function assertApproxEqRel(int256 a, int256 b, uint256 maxPercentDelta, string memory err) internal virtual { + if (b == 0) return assertEq(a, b, err); // If the left is 0, right must be too. + + uint256 percentDelta = stdMath.percentDelta(a, b); + + if (percentDelta > maxPercentDelta) { + emit log_named_string("Error", err); + assertApproxEqRel(a, b, maxPercentDelta); + } + } + + function assertApproxEqRelDecimal(int256 a, int256 b, uint256 maxPercentDelta, uint256 decimals) internal virtual { + if (b == 0) return assertEq(a, b); // If the left is 0, right must be too. + + uint256 percentDelta = stdMath.percentDelta(a, b); + + if (percentDelta > maxPercentDelta) { + emit log("Error: a ~= b not satisfied [int]"); + emit log_named_decimal_int(" Left", a, decimals); + emit log_named_decimal_int(" Right", b, decimals); + emit log_named_decimal_uint(" Max % Delta", maxPercentDelta * 100, 18); + emit log_named_decimal_uint(" % Delta", percentDelta * 100, 18); + fail(); + } + } + + function assertApproxEqRelDecimal(int256 a, int256 b, uint256 maxPercentDelta, uint256 decimals, string memory err) + internal + virtual + { + if (b == 0) return assertEq(a, b, err); // If the left is 0, right must be too. + + uint256 percentDelta = stdMath.percentDelta(a, b); + + if (percentDelta > maxPercentDelta) { + emit log_named_string("Error", err); + assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals); + } + } + + function assertEqCall(address target, bytes memory callDataA, bytes memory callDataB) internal virtual { + assertEqCall(target, callDataA, target, callDataB, true); + } + + function assertEqCall(address targetA, bytes memory callDataA, address targetB, bytes memory callDataB) + internal + virtual + { + assertEqCall(targetA, callDataA, targetB, callDataB, true); + } + + function assertEqCall(address target, bytes memory callDataA, bytes memory callDataB, bool strictRevertData) + internal + virtual + { + assertEqCall(target, callDataA, target, callDataB, strictRevertData); + } + + function assertEqCall( + address targetA, + bytes memory callDataA, + address targetB, + bytes memory callDataB, + bool strictRevertData + ) internal virtual { + (bool successA, bytes memory returnDataA) = address(targetA).call(callDataA); + (bool successB, bytes memory returnDataB) = address(targetB).call(callDataB); + + if (successA && successB) { + assertEq(returnDataA, returnDataB, "Call return data does not match"); + } + + if (!successA && !successB && strictRevertData) { + assertEq(returnDataA, returnDataB, "Call revert data does not match"); + } + + if (!successA && successB) { + emit log("Error: Calls were not equal"); + emit log_named_bytes(" Left call revert data", returnDataA); + emit log_named_bytes(" Right call return data", returnDataB); + fail(); + } + + if (successA && !successB) { + emit log("Error: Calls were not equal"); + emit log_named_bytes(" Left call return data", returnDataA); + emit log_named_bytes(" Right call revert data", returnDataB); + fail(); + } + } +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/src/StdChains.sol b/harness/solidity_sized_tx_contract/lib/forge-std/src/StdChains.sol new file mode 100644 index 00000000..bdc1c561 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/src/StdChains.sol @@ -0,0 +1,248 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.2 <0.9.0; + +import {VmSafe} from "./Vm.sol"; + +/** + * StdChains provides information about EVM compatible chains that can be used in scripts/tests. + * For each chain, the chain's name, chain ID, and a default RPC URL are provided. Chains are + * identified by their alias, which is the same as the alias in the `[rpc_endpoints]` section of + * the `foundry.toml` file. For best UX, ensure the alias in the `foundry.toml` file match the + * alias used in this contract, which can be found as the first argument to the + * `setChainWithDefaultRpcUrl` call in the `initializeStdChains` function. + * + * There are two main ways to use this contract: + * 1. Set a chain with `setChain(string memory chainAlias, ChainData memory chain)` or + * `setChain(string memory chainAlias, Chain memory chain)` + * 2. Get a chain with `getChain(string memory chainAlias)` or `getChain(uint256 chainId)`. + * + * The first time either of those are used, chains are initialized with the default set of RPC URLs. + * This is done in `initializeStdChains`, which uses `setChainWithDefaultRpcUrl`. Defaults are recorded in + * `defaultRpcUrls`. + * + * The `setChain` function is straightforward, and it simply saves off the given chain data. + * + * The `getChain` methods use `getChainWithUpdatedRpcUrl` to return a chain. For example, let's say + * we want to retrieve the RPC URL for `mainnet`: + * - If you have specified data with `setChain`, it will return that. + * - If you have configured a mainnet RPC URL in `foundry.toml`, it will return the URL, provided it + * is valid (e.g. a URL is specified, or an environment variable is given and exists). + * - If neither of the above conditions is met, the default data is returned. + * + * Summarizing the above, the prioritization hierarchy is `setChain` -> `foundry.toml` -> environment variable -> defaults. + */ +abstract contract StdChains { + VmSafe private constant vm = VmSafe(address(uint160(uint256(keccak256("hevm cheat code"))))); + + bool private stdChainsInitialized; + + struct ChainData { + string name; + uint256 chainId; + string rpcUrl; + } + + struct Chain { + // The chain name. + string name; + // The chain's Chain ID. + uint256 chainId; + // The chain's alias. (i.e. what gets specified in `foundry.toml`). + string chainAlias; + // A default RPC endpoint for this chain. + // NOTE: This default RPC URL is included for convenience to facilitate quick tests and + // experimentation. Do not use this RPC URL for production test suites, CI, or other heavy + // usage as you will be throttled and this is a disservice to others who need this endpoint. + string rpcUrl; + } + + // Maps from the chain's alias (matching the alias in the `foundry.toml` file) to chain data. + mapping(string => Chain) private chains; + // Maps from the chain's alias to it's default RPC URL. + mapping(string => string) private defaultRpcUrls; + // Maps from a chain ID to it's alias. + mapping(uint256 => string) private idToAlias; + + bool private fallbackToDefaultRpcUrls = true; + + // The RPC URL will be fetched from config or defaultRpcUrls if possible. + function getChain(string memory chainAlias) internal virtual returns (Chain memory chain) { + require(bytes(chainAlias).length != 0, "StdChains getChain(string): Chain alias cannot be the empty string."); + + initializeStdChains(); + chain = chains[chainAlias]; + require( + chain.chainId != 0, + string(abi.encodePacked("StdChains getChain(string): Chain with alias \"", chainAlias, "\" not found.")) + ); + + chain = getChainWithUpdatedRpcUrl(chainAlias, chain); + } + + function getChain(uint256 chainId) internal virtual returns (Chain memory chain) { + require(chainId != 0, "StdChains getChain(uint256): Chain ID cannot be 0."); + initializeStdChains(); + string memory chainAlias = idToAlias[chainId]; + + chain = chains[chainAlias]; + + require( + chain.chainId != 0, + string(abi.encodePacked("StdChains getChain(uint256): Chain with ID ", vm.toString(chainId), " not found.")) + ); + + chain = getChainWithUpdatedRpcUrl(chainAlias, chain); + } + + // set chain info, with priority to argument's rpcUrl field. + function setChain(string memory chainAlias, ChainData memory chain) internal virtual { + require( + bytes(chainAlias).length != 0, + "StdChains setChain(string,ChainData): Chain alias cannot be the empty string." + ); + + require(chain.chainId != 0, "StdChains setChain(string,ChainData): Chain ID cannot be 0."); + + initializeStdChains(); + string memory foundAlias = idToAlias[chain.chainId]; + + require( + bytes(foundAlias).length == 0 || keccak256(bytes(foundAlias)) == keccak256(bytes(chainAlias)), + string( + abi.encodePacked( + "StdChains setChain(string,ChainData): Chain ID ", + vm.toString(chain.chainId), + " already used by \"", + foundAlias, + "\"." + ) + ) + ); + + uint256 oldChainId = chains[chainAlias].chainId; + delete idToAlias[oldChainId]; + + chains[chainAlias] = + Chain({name: chain.name, chainId: chain.chainId, chainAlias: chainAlias, rpcUrl: chain.rpcUrl}); + idToAlias[chain.chainId] = chainAlias; + } + + // set chain info, with priority to argument's rpcUrl field. + function setChain(string memory chainAlias, Chain memory chain) internal virtual { + setChain(chainAlias, ChainData({name: chain.name, chainId: chain.chainId, rpcUrl: chain.rpcUrl})); + } + + function _toUpper(string memory str) private pure returns (string memory) { + bytes memory strb = bytes(str); + bytes memory copy = new bytes(strb.length); + for (uint256 i = 0; i < strb.length; i++) { + bytes1 b = strb[i]; + if (b >= 0x61 && b <= 0x7A) { + copy[i] = bytes1(uint8(b) - 32); + } else { + copy[i] = b; + } + } + return string(copy); + } + + // lookup rpcUrl, in descending order of priority: + // current -> config (foundry.toml) -> environment variable -> default + function getChainWithUpdatedRpcUrl(string memory chainAlias, Chain memory chain) + private + view + returns (Chain memory) + { + if (bytes(chain.rpcUrl).length == 0) { + try vm.rpcUrl(chainAlias) returns (string memory configRpcUrl) { + chain.rpcUrl = configRpcUrl; + } catch (bytes memory err) { + string memory envName = string(abi.encodePacked(_toUpper(chainAlias), "_RPC_URL")); + if (fallbackToDefaultRpcUrls) { + chain.rpcUrl = vm.envOr(envName, defaultRpcUrls[chainAlias]); + } else { + chain.rpcUrl = vm.envString(envName); + } + // Distinguish 'not found' from 'cannot read' + // The upstream error thrown by forge for failing cheats changed so we check both the old and new versions + bytes memory oldNotFoundError = + abi.encodeWithSignature("CheatCodeError", string(abi.encodePacked("invalid rpc url ", chainAlias))); + bytes memory newNotFoundError = abi.encodeWithSignature( + "CheatcodeError(string)", string(abi.encodePacked("invalid rpc url: ", chainAlias)) + ); + bytes32 errHash = keccak256(err); + if ( + (errHash != keccak256(oldNotFoundError) && errHash != keccak256(newNotFoundError)) + || bytes(chain.rpcUrl).length == 0 + ) { + /// @solidity memory-safe-assembly + assembly { + revert(add(32, err), mload(err)) + } + } + } + } + return chain; + } + + function setFallbackToDefaultRpcUrls(bool useDefault) internal { + fallbackToDefaultRpcUrls = useDefault; + } + + function initializeStdChains() private { + if (stdChainsInitialized) return; + + stdChainsInitialized = true; + + // If adding an RPC here, make sure to test the default RPC URL in `testRpcs` + setChainWithDefaultRpcUrl("anvil", ChainData("Anvil", 31337, "http://127.0.0.1:8545")); + setChainWithDefaultRpcUrl( + "mainnet", ChainData("Mainnet", 1, "https://mainnet.infura.io/v3/b9794ad1ddf84dfb8c34d6bb5dca2001") + ); + setChainWithDefaultRpcUrl( + "goerli", ChainData("Goerli", 5, "https://goerli.infura.io/v3/b9794ad1ddf84dfb8c34d6bb5dca2001") + ); + setChainWithDefaultRpcUrl( + "sepolia", ChainData("Sepolia", 11155111, "https://sepolia.infura.io/v3/b9794ad1ddf84dfb8c34d6bb5dca2001") + ); + setChainWithDefaultRpcUrl("optimism", ChainData("Optimism", 10, "https://mainnet.optimism.io")); + setChainWithDefaultRpcUrl("optimism_goerli", ChainData("Optimism Goerli", 420, "https://goerli.optimism.io")); + setChainWithDefaultRpcUrl("arbitrum_one", ChainData("Arbitrum One", 42161, "https://arb1.arbitrum.io/rpc")); + setChainWithDefaultRpcUrl( + "arbitrum_one_goerli", ChainData("Arbitrum One Goerli", 421613, "https://goerli-rollup.arbitrum.io/rpc") + ); + setChainWithDefaultRpcUrl("arbitrum_nova", ChainData("Arbitrum Nova", 42170, "https://nova.arbitrum.io/rpc")); + setChainWithDefaultRpcUrl("polygon", ChainData("Polygon", 137, "https://polygon-rpc.com")); + setChainWithDefaultRpcUrl( + "polygon_mumbai", ChainData("Polygon Mumbai", 80001, "https://rpc-mumbai.maticvigil.com") + ); + setChainWithDefaultRpcUrl("avalanche", ChainData("Avalanche", 43114, "https://api.avax.network/ext/bc/C/rpc")); + setChainWithDefaultRpcUrl( + "avalanche_fuji", ChainData("Avalanche Fuji", 43113, "https://api.avax-test.network/ext/bc/C/rpc") + ); + setChainWithDefaultRpcUrl( + "bnb_smart_chain", ChainData("BNB Smart Chain", 56, "https://bsc-dataseed1.binance.org") + ); + setChainWithDefaultRpcUrl( + "bnb_smart_chain_testnet", + ChainData("BNB Smart Chain Testnet", 97, "https://rpc.ankr.com/bsc_testnet_chapel") + ); + setChainWithDefaultRpcUrl("gnosis_chain", ChainData("Gnosis Chain", 100, "https://rpc.gnosischain.com")); + setChainWithDefaultRpcUrl("moonbeam", ChainData("Moonbeam", 1284, "https://rpc.api.moonbeam.network")); + setChainWithDefaultRpcUrl( + "moonriver", ChainData("Moonriver", 1285, "https://rpc.api.moonriver.moonbeam.network") + ); + setChainWithDefaultRpcUrl("moonbase", ChainData("Moonbase", 1287, "https://rpc.testnet.moonbeam.network")); + setChainWithDefaultRpcUrl("base_goerli", ChainData("Base Goerli", 84531, "https://goerli.base.org")); + setChainWithDefaultRpcUrl("base", ChainData("Base", 8453, "https://mainnet.base.org")); + } + + // set chain info, with priority to chainAlias' rpc url in foundry.toml + function setChainWithDefaultRpcUrl(string memory chainAlias, ChainData memory chain) private { + string memory rpcUrl = chain.rpcUrl; + defaultRpcUrls[chainAlias] = rpcUrl; + chain.rpcUrl = ""; + setChain(chainAlias, chain); + chain.rpcUrl = rpcUrl; // restore argument + } +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/src/StdCheats.sol b/harness/solidity_sized_tx_contract/lib/forge-std/src/StdCheats.sol new file mode 100644 index 00000000..f2933139 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/src/StdCheats.sol @@ -0,0 +1,817 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.2 <0.9.0; + +pragma experimental ABIEncoderV2; + +import {StdStorage, stdStorage} from "./StdStorage.sol"; +import {console2} from "./console2.sol"; +import {Vm} from "./Vm.sol"; + +abstract contract StdCheatsSafe { + Vm private constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code"))))); + + uint256 private constant UINT256_MAX = + 115792089237316195423570985008687907853269984665640564039457584007913129639935; + + bool private gasMeteringOff; + + // Data structures to parse Transaction objects from the broadcast artifact + // that conform to EIP1559. The Raw structs is what is parsed from the JSON + // and then converted to the one that is used by the user for better UX. + + struct RawTx1559 { + string[] arguments; + address contractAddress; + string contractName; + // json value name = function + string functionSig; + bytes32 hash; + // json value name = tx + RawTx1559Detail txDetail; + // json value name = type + string opcode; + } + + struct RawTx1559Detail { + AccessList[] accessList; + bytes data; + address from; + bytes gas; + bytes nonce; + address to; + bytes txType; + bytes value; + } + + struct Tx1559 { + string[] arguments; + address contractAddress; + string contractName; + string functionSig; + bytes32 hash; + Tx1559Detail txDetail; + string opcode; + } + + struct Tx1559Detail { + AccessList[] accessList; + bytes data; + address from; + uint256 gas; + uint256 nonce; + address to; + uint256 txType; + uint256 value; + } + + // Data structures to parse Transaction objects from the broadcast artifact + // that DO NOT conform to EIP1559. The Raw structs is what is parsed from the JSON + // and then converted to the one that is used by the user for better UX. + + struct TxLegacy { + string[] arguments; + address contractAddress; + string contractName; + string functionSig; + string hash; + string opcode; + TxDetailLegacy transaction; + } + + struct TxDetailLegacy { + AccessList[] accessList; + uint256 chainId; + bytes data; + address from; + uint256 gas; + uint256 gasPrice; + bytes32 hash; + uint256 nonce; + bytes1 opcode; + bytes32 r; + bytes32 s; + uint256 txType; + address to; + uint8 v; + uint256 value; + } + + struct AccessList { + address accessAddress; + bytes32[] storageKeys; + } + + // Data structures to parse Receipt objects from the broadcast artifact. + // The Raw structs is what is parsed from the JSON + // and then converted to the one that is used by the user for better UX. + + struct RawReceipt { + bytes32 blockHash; + bytes blockNumber; + address contractAddress; + bytes cumulativeGasUsed; + bytes effectiveGasPrice; + address from; + bytes gasUsed; + RawReceiptLog[] logs; + bytes logsBloom; + bytes status; + address to; + bytes32 transactionHash; + bytes transactionIndex; + } + + struct Receipt { + bytes32 blockHash; + uint256 blockNumber; + address contractAddress; + uint256 cumulativeGasUsed; + uint256 effectiveGasPrice; + address from; + uint256 gasUsed; + ReceiptLog[] logs; + bytes logsBloom; + uint256 status; + address to; + bytes32 transactionHash; + uint256 transactionIndex; + } + + // Data structures to parse the entire broadcast artifact, assuming the + // transactions conform to EIP1559. + + struct EIP1559ScriptArtifact { + string[] libraries; + string path; + string[] pending; + Receipt[] receipts; + uint256 timestamp; + Tx1559[] transactions; + TxReturn[] txReturns; + } + + struct RawEIP1559ScriptArtifact { + string[] libraries; + string path; + string[] pending; + RawReceipt[] receipts; + TxReturn[] txReturns; + uint256 timestamp; + RawTx1559[] transactions; + } + + struct RawReceiptLog { + // json value = address + address logAddress; + bytes32 blockHash; + bytes blockNumber; + bytes data; + bytes logIndex; + bool removed; + bytes32[] topics; + bytes32 transactionHash; + bytes transactionIndex; + bytes transactionLogIndex; + } + + struct ReceiptLog { + // json value = address + address logAddress; + bytes32 blockHash; + uint256 blockNumber; + bytes data; + uint256 logIndex; + bytes32[] topics; + uint256 transactionIndex; + uint256 transactionLogIndex; + bool removed; + } + + struct TxReturn { + string internalType; + string value; + } + + struct Account { + address addr; + uint256 key; + } + + enum AddressType { + Payable, + NonPayable, + ZeroAddress, + Precompile, + ForgeAddress + } + + // Checks that `addr` is not blacklisted by token contracts that have a blacklist. + function assumeNotBlacklisted(address token, address addr) internal view virtual { + // Nothing to check if `token` is not a contract. + uint256 tokenCodeSize; + assembly { + tokenCodeSize := extcodesize(token) + } + require(tokenCodeSize > 0, "StdCheats assumeNotBlacklisted(address,address): Token address is not a contract."); + + bool success; + bytes memory returnData; + + // 4-byte selector for `isBlacklisted(address)`, used by USDC. + (success, returnData) = token.staticcall(abi.encodeWithSelector(0xfe575a87, addr)); + vm.assume(!success || abi.decode(returnData, (bool)) == false); + + // 4-byte selector for `isBlackListed(address)`, used by USDT. + (success, returnData) = token.staticcall(abi.encodeWithSelector(0xe47d6060, addr)); + vm.assume(!success || abi.decode(returnData, (bool)) == false); + } + + // Checks that `addr` is not blacklisted by token contracts that have a blacklist. + // This is identical to `assumeNotBlacklisted(address,address)` but with a different name, for + // backwards compatibility, since this name was used in the original PR which has already has + // a release. This function can be removed in a future release once we want a breaking change. + function assumeNoBlacklisted(address token, address addr) internal view virtual { + assumeNotBlacklisted(token, addr); + } + + function assumeAddressIsNot(address addr, AddressType addressType) internal virtual { + if (addressType == AddressType.Payable) { + assumeNotPayable(addr); + } else if (addressType == AddressType.NonPayable) { + assumePayable(addr); + } else if (addressType == AddressType.ZeroAddress) { + assumeNotZeroAddress(addr); + } else if (addressType == AddressType.Precompile) { + assumeNotPrecompile(addr); + } else if (addressType == AddressType.ForgeAddress) { + assumeNotForgeAddress(addr); + } + } + + function assumeAddressIsNot(address addr, AddressType addressType1, AddressType addressType2) internal virtual { + assumeAddressIsNot(addr, addressType1); + assumeAddressIsNot(addr, addressType2); + } + + function assumeAddressIsNot( + address addr, + AddressType addressType1, + AddressType addressType2, + AddressType addressType3 + ) internal virtual { + assumeAddressIsNot(addr, addressType1); + assumeAddressIsNot(addr, addressType2); + assumeAddressIsNot(addr, addressType3); + } + + function assumeAddressIsNot( + address addr, + AddressType addressType1, + AddressType addressType2, + AddressType addressType3, + AddressType addressType4 + ) internal virtual { + assumeAddressIsNot(addr, addressType1); + assumeAddressIsNot(addr, addressType2); + assumeAddressIsNot(addr, addressType3); + assumeAddressIsNot(addr, addressType4); + } + + // This function checks whether an address, `addr`, is payable. It works by sending 1 wei to + // `addr` and checking the `success` return value. + // NOTE: This function may result in state changes depending on the fallback/receive logic + // implemented by `addr`, which should be taken into account when this function is used. + function _isPayable(address addr) private returns (bool) { + require( + addr.balance < UINT256_MAX, + "StdCheats _isPayable(address): Balance equals max uint256, so it cannot receive any more funds" + ); + uint256 origBalanceTest = address(this).balance; + uint256 origBalanceAddr = address(addr).balance; + + vm.deal(address(this), 1); + (bool success,) = payable(addr).call{value: 1}(""); + + // reset balances + vm.deal(address(this), origBalanceTest); + vm.deal(addr, origBalanceAddr); + + return success; + } + + // NOTE: This function may result in state changes depending on the fallback/receive logic + // implemented by `addr`, which should be taken into account when this function is used. See the + // `_isPayable` method for more information. + function assumePayable(address addr) internal virtual { + vm.assume(_isPayable(addr)); + } + + function assumeNotPayable(address addr) internal virtual { + vm.assume(!_isPayable(addr)); + } + + function assumeNotZeroAddress(address addr) internal pure virtual { + vm.assume(addr != address(0)); + } + + function assumeNotPrecompile(address addr) internal pure virtual { + assumeNotPrecompile(addr, _pureChainId()); + } + + function assumeNotPrecompile(address addr, uint256 chainId) internal pure virtual { + // Note: For some chains like Optimism these are technically predeploys (i.e. bytecode placed at a specific + // address), but the same rationale for excluding them applies so we include those too. + + // These should be present on all EVM-compatible chains. + vm.assume(addr < address(0x1) || addr > address(0x9)); + + // forgefmt: disable-start + if (chainId == 10 || chainId == 420) { + // https://github.com/ethereum-optimism/optimism/blob/eaa371a0184b56b7ca6d9eb9cb0a2b78b2ccd864/op-bindings/predeploys/addresses.go#L6-L21 + vm.assume(addr < address(0x4200000000000000000000000000000000000000) || addr > address(0x4200000000000000000000000000000000000800)); + } else if (chainId == 42161 || chainId == 421613) { + // https://developer.arbitrum.io/useful-addresses#arbitrum-precompiles-l2-same-on-all-arb-chains + vm.assume(addr < address(0x0000000000000000000000000000000000000064) || addr > address(0x0000000000000000000000000000000000000068)); + } else if (chainId == 43114 || chainId == 43113) { + // https://github.com/ava-labs/subnet-evm/blob/47c03fd007ecaa6de2c52ea081596e0a88401f58/precompile/params.go#L18-L59 + vm.assume(addr < address(0x0100000000000000000000000000000000000000) || addr > address(0x01000000000000000000000000000000000000ff)); + vm.assume(addr < address(0x0200000000000000000000000000000000000000) || addr > address(0x02000000000000000000000000000000000000FF)); + vm.assume(addr < address(0x0300000000000000000000000000000000000000) || addr > address(0x03000000000000000000000000000000000000Ff)); + } + // forgefmt: disable-end + } + + function assumeNotForgeAddress(address addr) internal pure virtual { + // vm, console, and Create2Deployer addresses + vm.assume( + addr != address(vm) && addr != 0x000000000000000000636F6e736F6c652e6c6f67 + && addr != 0x4e59b44847b379578588920cA78FbF26c0B4956C + ); + } + + function readEIP1559ScriptArtifact(string memory path) + internal + view + virtual + returns (EIP1559ScriptArtifact memory) + { + string memory data = vm.readFile(path); + bytes memory parsedData = vm.parseJson(data); + RawEIP1559ScriptArtifact memory rawArtifact = abi.decode(parsedData, (RawEIP1559ScriptArtifact)); + EIP1559ScriptArtifact memory artifact; + artifact.libraries = rawArtifact.libraries; + artifact.path = rawArtifact.path; + artifact.timestamp = rawArtifact.timestamp; + artifact.pending = rawArtifact.pending; + artifact.txReturns = rawArtifact.txReturns; + artifact.receipts = rawToConvertedReceipts(rawArtifact.receipts); + artifact.transactions = rawToConvertedEIPTx1559s(rawArtifact.transactions); + return artifact; + } + + function rawToConvertedEIPTx1559s(RawTx1559[] memory rawTxs) internal pure virtual returns (Tx1559[] memory) { + Tx1559[] memory txs = new Tx1559[](rawTxs.length); + for (uint256 i; i < rawTxs.length; i++) { + txs[i] = rawToConvertedEIPTx1559(rawTxs[i]); + } + return txs; + } + + function rawToConvertedEIPTx1559(RawTx1559 memory rawTx) internal pure virtual returns (Tx1559 memory) { + Tx1559 memory transaction; + transaction.arguments = rawTx.arguments; + transaction.contractName = rawTx.contractName; + transaction.functionSig = rawTx.functionSig; + transaction.hash = rawTx.hash; + transaction.txDetail = rawToConvertedEIP1559Detail(rawTx.txDetail); + transaction.opcode = rawTx.opcode; + return transaction; + } + + function rawToConvertedEIP1559Detail(RawTx1559Detail memory rawDetail) + internal + pure + virtual + returns (Tx1559Detail memory) + { + Tx1559Detail memory txDetail; + txDetail.data = rawDetail.data; + txDetail.from = rawDetail.from; + txDetail.to = rawDetail.to; + txDetail.nonce = _bytesToUint(rawDetail.nonce); + txDetail.txType = _bytesToUint(rawDetail.txType); + txDetail.value = _bytesToUint(rawDetail.value); + txDetail.gas = _bytesToUint(rawDetail.gas); + txDetail.accessList = rawDetail.accessList; + return txDetail; + } + + function readTx1559s(string memory path) internal view virtual returns (Tx1559[] memory) { + string memory deployData = vm.readFile(path); + bytes memory parsedDeployData = vm.parseJson(deployData, ".transactions"); + RawTx1559[] memory rawTxs = abi.decode(parsedDeployData, (RawTx1559[])); + return rawToConvertedEIPTx1559s(rawTxs); + } + + function readTx1559(string memory path, uint256 index) internal view virtual returns (Tx1559 memory) { + string memory deployData = vm.readFile(path); + string memory key = string(abi.encodePacked(".transactions[", vm.toString(index), "]")); + bytes memory parsedDeployData = vm.parseJson(deployData, key); + RawTx1559 memory rawTx = abi.decode(parsedDeployData, (RawTx1559)); + return rawToConvertedEIPTx1559(rawTx); + } + + // Analogous to readTransactions, but for receipts. + function readReceipts(string memory path) internal view virtual returns (Receipt[] memory) { + string memory deployData = vm.readFile(path); + bytes memory parsedDeployData = vm.parseJson(deployData, ".receipts"); + RawReceipt[] memory rawReceipts = abi.decode(parsedDeployData, (RawReceipt[])); + return rawToConvertedReceipts(rawReceipts); + } + + function readReceipt(string memory path, uint256 index) internal view virtual returns (Receipt memory) { + string memory deployData = vm.readFile(path); + string memory key = string(abi.encodePacked(".receipts[", vm.toString(index), "]")); + bytes memory parsedDeployData = vm.parseJson(deployData, key); + RawReceipt memory rawReceipt = abi.decode(parsedDeployData, (RawReceipt)); + return rawToConvertedReceipt(rawReceipt); + } + + function rawToConvertedReceipts(RawReceipt[] memory rawReceipts) internal pure virtual returns (Receipt[] memory) { + Receipt[] memory receipts = new Receipt[](rawReceipts.length); + for (uint256 i; i < rawReceipts.length; i++) { + receipts[i] = rawToConvertedReceipt(rawReceipts[i]); + } + return receipts; + } + + function rawToConvertedReceipt(RawReceipt memory rawReceipt) internal pure virtual returns (Receipt memory) { + Receipt memory receipt; + receipt.blockHash = rawReceipt.blockHash; + receipt.to = rawReceipt.to; + receipt.from = rawReceipt.from; + receipt.contractAddress = rawReceipt.contractAddress; + receipt.effectiveGasPrice = _bytesToUint(rawReceipt.effectiveGasPrice); + receipt.cumulativeGasUsed = _bytesToUint(rawReceipt.cumulativeGasUsed); + receipt.gasUsed = _bytesToUint(rawReceipt.gasUsed); + receipt.status = _bytesToUint(rawReceipt.status); + receipt.transactionIndex = _bytesToUint(rawReceipt.transactionIndex); + receipt.blockNumber = _bytesToUint(rawReceipt.blockNumber); + receipt.logs = rawToConvertedReceiptLogs(rawReceipt.logs); + receipt.logsBloom = rawReceipt.logsBloom; + receipt.transactionHash = rawReceipt.transactionHash; + return receipt; + } + + function rawToConvertedReceiptLogs(RawReceiptLog[] memory rawLogs) + internal + pure + virtual + returns (ReceiptLog[] memory) + { + ReceiptLog[] memory logs = new ReceiptLog[](rawLogs.length); + for (uint256 i; i < rawLogs.length; i++) { + logs[i].logAddress = rawLogs[i].logAddress; + logs[i].blockHash = rawLogs[i].blockHash; + logs[i].blockNumber = _bytesToUint(rawLogs[i].blockNumber); + logs[i].data = rawLogs[i].data; + logs[i].logIndex = _bytesToUint(rawLogs[i].logIndex); + logs[i].topics = rawLogs[i].topics; + logs[i].transactionIndex = _bytesToUint(rawLogs[i].transactionIndex); + logs[i].transactionLogIndex = _bytesToUint(rawLogs[i].transactionLogIndex); + logs[i].removed = rawLogs[i].removed; + } + return logs; + } + + // Deploy a contract by fetching the contract bytecode from + // the artifacts directory + // e.g. `deployCode(code, abi.encode(arg1,arg2,arg3))` + function deployCode(string memory what, bytes memory args) internal virtual returns (address addr) { + bytes memory bytecode = abi.encodePacked(vm.getCode(what), args); + /// @solidity memory-safe-assembly + assembly { + addr := create(0, add(bytecode, 0x20), mload(bytecode)) + } + + require(addr != address(0), "StdCheats deployCode(string,bytes): Deployment failed."); + } + + function deployCode(string memory what) internal virtual returns (address addr) { + bytes memory bytecode = vm.getCode(what); + /// @solidity memory-safe-assembly + assembly { + addr := create(0, add(bytecode, 0x20), mload(bytecode)) + } + + require(addr != address(0), "StdCheats deployCode(string): Deployment failed."); + } + + /// @dev deploy contract with value on construction + function deployCode(string memory what, bytes memory args, uint256 val) internal virtual returns (address addr) { + bytes memory bytecode = abi.encodePacked(vm.getCode(what), args); + /// @solidity memory-safe-assembly + assembly { + addr := create(val, add(bytecode, 0x20), mload(bytecode)) + } + + require(addr != address(0), "StdCheats deployCode(string,bytes,uint256): Deployment failed."); + } + + function deployCode(string memory what, uint256 val) internal virtual returns (address addr) { + bytes memory bytecode = vm.getCode(what); + /// @solidity memory-safe-assembly + assembly { + addr := create(val, add(bytecode, 0x20), mload(bytecode)) + } + + require(addr != address(0), "StdCheats deployCode(string,uint256): Deployment failed."); + } + + // creates a labeled address and the corresponding private key + function makeAddrAndKey(string memory name) internal virtual returns (address addr, uint256 privateKey) { + privateKey = uint256(keccak256(abi.encodePacked(name))); + addr = vm.addr(privateKey); + vm.label(addr, name); + } + + // creates a labeled address + function makeAddr(string memory name) internal virtual returns (address addr) { + (addr,) = makeAddrAndKey(name); + } + + // Destroys an account immediately, sending the balance to beneficiary. + // Destroying means: balance will be zero, code will be empty, and nonce will be 0 + // This is similar to selfdestruct but not identical: selfdestruct destroys code and nonce + // only after tx ends, this will run immediately. + function destroyAccount(address who, address beneficiary) internal virtual { + uint256 currBalance = who.balance; + vm.etch(who, abi.encode()); + vm.deal(who, 0); + vm.resetNonce(who); + + uint256 beneficiaryBalance = beneficiary.balance; + vm.deal(beneficiary, currBalance + beneficiaryBalance); + } + + // creates a struct containing both a labeled address and the corresponding private key + function makeAccount(string memory name) internal virtual returns (Account memory account) { + (account.addr, account.key) = makeAddrAndKey(name); + } + + function deriveRememberKey(string memory mnemonic, uint32 index) + internal + virtual + returns (address who, uint256 privateKey) + { + privateKey = vm.deriveKey(mnemonic, index); + who = vm.rememberKey(privateKey); + } + + function _bytesToUint(bytes memory b) private pure returns (uint256) { + require(b.length <= 32, "StdCheats _bytesToUint(bytes): Bytes length exceeds 32."); + return abi.decode(abi.encodePacked(new bytes(32 - b.length), b), (uint256)); + } + + function isFork() internal view virtual returns (bool status) { + try vm.activeFork() { + status = true; + } catch (bytes memory) {} + } + + modifier skipWhenForking() { + if (!isFork()) { + _; + } + } + + modifier skipWhenNotForking() { + if (isFork()) { + _; + } + } + + modifier noGasMetering() { + vm.pauseGasMetering(); + // To prevent turning gas monitoring back on with nested functions that use this modifier, + // we check if gasMetering started in the off position. If it did, we don't want to turn + // it back on until we exit the top level function that used the modifier + // + // i.e. funcA() noGasMetering { funcB() }, where funcB has noGasMetering as well. + // funcA will have `gasStartedOff` as false, funcB will have it as true, + // so we only turn metering back on at the end of the funcA + bool gasStartedOff = gasMeteringOff; + gasMeteringOff = true; + + _; + + // if gas metering was on when this modifier was called, turn it back on at the end + if (!gasStartedOff) { + gasMeteringOff = false; + vm.resumeGasMetering(); + } + } + + // We use this complex approach of `_viewChainId` and `_pureChainId` to ensure there are no + // compiler warnings when accessing chain ID in any solidity version supported by forge-std. We + // can't simply access the chain ID in a normal view or pure function because the solc View Pure + // Checker changed `chainid` from pure to view in 0.8.0. + function _viewChainId() private view returns (uint256 chainId) { + // Assembly required since `block.chainid` was introduced in 0.8.0. + assembly { + chainId := chainid() + } + + address(this); // Silence warnings in older Solc versions. + } + + function _pureChainId() private pure returns (uint256 chainId) { + function() internal view returns (uint256) fnIn = _viewChainId; + function() internal pure returns (uint256) pureChainId; + assembly { + pureChainId := fnIn + } + chainId = pureChainId(); + } +} + +// Wrappers around cheatcodes to avoid footguns +abstract contract StdCheats is StdCheatsSafe { + using stdStorage for StdStorage; + + StdStorage private stdstore; + Vm private constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code"))))); + address private constant CONSOLE2_ADDRESS = 0x000000000000000000636F6e736F6c652e6c6f67; + + // Skip forward or rewind time by the specified number of seconds + function skip(uint256 time) internal virtual { + vm.warp(block.timestamp + time); + } + + function rewind(uint256 time) internal virtual { + vm.warp(block.timestamp - time); + } + + // Setup a prank from an address that has some ether + function hoax(address msgSender) internal virtual { + vm.deal(msgSender, 1 << 128); + vm.prank(msgSender); + } + + function hoax(address msgSender, uint256 give) internal virtual { + vm.deal(msgSender, give); + vm.prank(msgSender); + } + + function hoax(address msgSender, address origin) internal virtual { + vm.deal(msgSender, 1 << 128); + vm.prank(msgSender, origin); + } + + function hoax(address msgSender, address origin, uint256 give) internal virtual { + vm.deal(msgSender, give); + vm.prank(msgSender, origin); + } + + // Start perpetual prank from an address that has some ether + function startHoax(address msgSender) internal virtual { + vm.deal(msgSender, 1 << 128); + vm.startPrank(msgSender); + } + + function startHoax(address msgSender, uint256 give) internal virtual { + vm.deal(msgSender, give); + vm.startPrank(msgSender); + } + + // Start perpetual prank from an address that has some ether + // tx.origin is set to the origin parameter + function startHoax(address msgSender, address origin) internal virtual { + vm.deal(msgSender, 1 << 128); + vm.startPrank(msgSender, origin); + } + + function startHoax(address msgSender, address origin, uint256 give) internal virtual { + vm.deal(msgSender, give); + vm.startPrank(msgSender, origin); + } + + function changePrank(address msgSender) internal virtual { + console2_log_StdCheats("changePrank is deprecated. Please use vm.startPrank instead."); + vm.stopPrank(); + vm.startPrank(msgSender); + } + + function changePrank(address msgSender, address txOrigin) internal virtual { + vm.stopPrank(); + vm.startPrank(msgSender, txOrigin); + } + + // The same as Vm's `deal` + // Use the alternative signature for ERC20 tokens + function deal(address to, uint256 give) internal virtual { + vm.deal(to, give); + } + + // Set the balance of an account for any ERC20 token + // Use the alternative signature to update `totalSupply` + function deal(address token, address to, uint256 give) internal virtual { + deal(token, to, give, false); + } + + // Set the balance of an account for any ERC1155 token + // Use the alternative signature to update `totalSupply` + function dealERC1155(address token, address to, uint256 id, uint256 give) internal virtual { + dealERC1155(token, to, id, give, false); + } + + function deal(address token, address to, uint256 give, bool adjust) internal virtual { + // get current balance + (, bytes memory balData) = token.staticcall(abi.encodeWithSelector(0x70a08231, to)); + uint256 prevBal = abi.decode(balData, (uint256)); + + // update balance + stdstore.target(token).sig(0x70a08231).with_key(to).checked_write(give); + + // update total supply + if (adjust) { + (, bytes memory totSupData) = token.staticcall(abi.encodeWithSelector(0x18160ddd)); + uint256 totSup = abi.decode(totSupData, (uint256)); + if (give < prevBal) { + totSup -= (prevBal - give); + } else { + totSup += (give - prevBal); + } + stdstore.target(token).sig(0x18160ddd).checked_write(totSup); + } + } + + function dealERC1155(address token, address to, uint256 id, uint256 give, bool adjust) internal virtual { + // get current balance + (, bytes memory balData) = token.staticcall(abi.encodeWithSelector(0x00fdd58e, to, id)); + uint256 prevBal = abi.decode(balData, (uint256)); + + // update balance + stdstore.target(token).sig(0x00fdd58e).with_key(to).with_key(id).checked_write(give); + + // update total supply + if (adjust) { + (, bytes memory totSupData) = token.staticcall(abi.encodeWithSelector(0xbd85b039, id)); + require( + totSupData.length != 0, + "StdCheats deal(address,address,uint,uint,bool): target contract is not ERC1155Supply." + ); + uint256 totSup = abi.decode(totSupData, (uint256)); + if (give < prevBal) { + totSup -= (prevBal - give); + } else { + totSup += (give - prevBal); + } + stdstore.target(token).sig(0xbd85b039).with_key(id).checked_write(totSup); + } + } + + function dealERC721(address token, address to, uint256 id) internal virtual { + // check if token id is already minted and the actual owner. + (bool successMinted, bytes memory ownerData) = token.staticcall(abi.encodeWithSelector(0x6352211e, id)); + require(successMinted, "StdCheats deal(address,address,uint,bool): id not minted."); + + // get owner current balance + (, bytes memory fromBalData) = + token.staticcall(abi.encodeWithSelector(0x70a08231, abi.decode(ownerData, (address)))); + uint256 fromPrevBal = abi.decode(fromBalData, (uint256)); + + // get new user current balance + (, bytes memory toBalData) = token.staticcall(abi.encodeWithSelector(0x70a08231, to)); + uint256 toPrevBal = abi.decode(toBalData, (uint256)); + + // update balances + stdstore.target(token).sig(0x70a08231).with_key(abi.decode(ownerData, (address))).checked_write(--fromPrevBal); + stdstore.target(token).sig(0x70a08231).with_key(to).checked_write(++toPrevBal); + + // update owner + stdstore.target(token).sig(0x6352211e).with_key(id).checked_write(to); + } + + function deployCodeTo(string memory what, address where) internal virtual { + deployCodeTo(what, "", 0, where); + } + + function deployCodeTo(string memory what, bytes memory args, address where) internal virtual { + deployCodeTo(what, args, 0, where); + } + + function deployCodeTo(string memory what, bytes memory args, uint256 value, address where) internal virtual { + bytes memory creationCode = vm.getCode(what); + vm.etch(where, abi.encodePacked(creationCode, args)); + (bool success, bytes memory runtimeBytecode) = where.call{value: value}(""); + require(success, "StdCheats deployCodeTo(string,bytes,uint256,address): Failed to create runtime bytecode."); + vm.etch(where, runtimeBytecode); + } + + // Used to prevent the compilation of console, which shortens the compilation time when console is not used elsewhere. + function console2_log_StdCheats(string memory p0) private view { + (bool status,) = address(CONSOLE2_ADDRESS).staticcall(abi.encodeWithSignature("log(string)", p0)); + status; + } +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/src/StdError.sol b/harness/solidity_sized_tx_contract/lib/forge-std/src/StdError.sol new file mode 100644 index 00000000..a302191f --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/src/StdError.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT +// Panics work for versions >=0.8.0, but we lowered the pragma to make this compatible with Test +pragma solidity >=0.6.2 <0.9.0; + +library stdError { + bytes public constant assertionError = abi.encodeWithSignature("Panic(uint256)", 0x01); + bytes public constant arithmeticError = abi.encodeWithSignature("Panic(uint256)", 0x11); + bytes public constant divisionError = abi.encodeWithSignature("Panic(uint256)", 0x12); + bytes public constant enumConversionError = abi.encodeWithSignature("Panic(uint256)", 0x21); + bytes public constant encodeStorageError = abi.encodeWithSignature("Panic(uint256)", 0x22); + bytes public constant popError = abi.encodeWithSignature("Panic(uint256)", 0x31); + bytes public constant indexOOBError = abi.encodeWithSignature("Panic(uint256)", 0x32); + bytes public constant memOverflowError = abi.encodeWithSignature("Panic(uint256)", 0x41); + bytes public constant zeroVarError = abi.encodeWithSignature("Panic(uint256)", 0x51); +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/src/StdInvariant.sol b/harness/solidity_sized_tx_contract/lib/forge-std/src/StdInvariant.sol new file mode 100644 index 00000000..bcd9ac0a --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/src/StdInvariant.sol @@ -0,0 +1,107 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.2 <0.9.0; + +pragma experimental ABIEncoderV2; + +abstract contract StdInvariant { + struct FuzzSelector { + address addr; + bytes4[] selectors; + } + + struct FuzzInterface { + address addr; + string[] artifacts; + } + + address[] private _excludedContracts; + address[] private _excludedSenders; + address[] private _targetedContracts; + address[] private _targetedSenders; + + string[] private _excludedArtifacts; + string[] private _targetedArtifacts; + + FuzzSelector[] private _targetedArtifactSelectors; + FuzzSelector[] private _targetedSelectors; + + FuzzInterface[] private _targetedInterfaces; + + // Functions for users: + // These are intended to be called in tests. + + function excludeContract(address newExcludedContract_) internal { + _excludedContracts.push(newExcludedContract_); + } + + function excludeSender(address newExcludedSender_) internal { + _excludedSenders.push(newExcludedSender_); + } + + function excludeArtifact(string memory newExcludedArtifact_) internal { + _excludedArtifacts.push(newExcludedArtifact_); + } + + function targetArtifact(string memory newTargetedArtifact_) internal { + _targetedArtifacts.push(newTargetedArtifact_); + } + + function targetArtifactSelector(FuzzSelector memory newTargetedArtifactSelector_) internal { + _targetedArtifactSelectors.push(newTargetedArtifactSelector_); + } + + function targetContract(address newTargetedContract_) internal { + _targetedContracts.push(newTargetedContract_); + } + + function targetSelector(FuzzSelector memory newTargetedSelector_) internal { + _targetedSelectors.push(newTargetedSelector_); + } + + function targetSender(address newTargetedSender_) internal { + _targetedSenders.push(newTargetedSender_); + } + + function targetInterface(FuzzInterface memory newTargetedInterface_) internal { + _targetedInterfaces.push(newTargetedInterface_); + } + + // Functions for forge: + // These are called by forge to run invariant tests and don't need to be called in tests. + + function excludeArtifacts() public view returns (string[] memory excludedArtifacts_) { + excludedArtifacts_ = _excludedArtifacts; + } + + function excludeContracts() public view returns (address[] memory excludedContracts_) { + excludedContracts_ = _excludedContracts; + } + + function excludeSenders() public view returns (address[] memory excludedSenders_) { + excludedSenders_ = _excludedSenders; + } + + function targetArtifacts() public view returns (string[] memory targetedArtifacts_) { + targetedArtifacts_ = _targetedArtifacts; + } + + function targetArtifactSelectors() public view returns (FuzzSelector[] memory targetedArtifactSelectors_) { + targetedArtifactSelectors_ = _targetedArtifactSelectors; + } + + function targetContracts() public view returns (address[] memory targetedContracts_) { + targetedContracts_ = _targetedContracts; + } + + function targetSelectors() public view returns (FuzzSelector[] memory targetedSelectors_) { + targetedSelectors_ = _targetedSelectors; + } + + function targetSenders() public view returns (address[] memory targetedSenders_) { + targetedSenders_ = _targetedSenders; + } + + function targetInterfaces() public view returns (FuzzInterface[] memory targetedInterfaces_) { + targetedInterfaces_ = _targetedInterfaces; + } +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/src/StdJson.sol b/harness/solidity_sized_tx_contract/lib/forge-std/src/StdJson.sol new file mode 100644 index 00000000..42d9bb70 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/src/StdJson.sol @@ -0,0 +1,183 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.0 <0.9.0; + +pragma experimental ABIEncoderV2; + +import {VmSafe} from "./Vm.sol"; + +// Helpers for parsing and writing JSON files +// To parse: +// ``` +// using stdJson for string; +// string memory json = vm.readFile("some_peth"); +// json.parseUint(""); +// ``` +// To write: +// ``` +// using stdJson for string; +// string memory json = "deploymentArtifact"; +// Contract contract = new Contract(); +// json.serialize("contractAddress", address(contract)); +// json = json.serialize("deploymentTimes", uint(1)); +// // store the stringified JSON to the 'json' variable we have been using as a key +// // as we won't need it any longer +// string memory json2 = "finalArtifact"; +// string memory final = json2.serialize("depArtifact", json); +// final.write(""); +// ``` + +library stdJson { + VmSafe private constant vm = VmSafe(address(uint160(uint256(keccak256("hevm cheat code"))))); + + function parseRaw(string memory json, string memory key) internal pure returns (bytes memory) { + return vm.parseJson(json, key); + } + + function readUint(string memory json, string memory key) internal pure returns (uint256) { + return vm.parseJsonUint(json, key); + } + + function readUintArray(string memory json, string memory key) internal pure returns (uint256[] memory) { + return vm.parseJsonUintArray(json, key); + } + + function readInt(string memory json, string memory key) internal pure returns (int256) { + return vm.parseJsonInt(json, key); + } + + function readIntArray(string memory json, string memory key) internal pure returns (int256[] memory) { + return vm.parseJsonIntArray(json, key); + } + + function readBytes32(string memory json, string memory key) internal pure returns (bytes32) { + return vm.parseJsonBytes32(json, key); + } + + function readBytes32Array(string memory json, string memory key) internal pure returns (bytes32[] memory) { + return vm.parseJsonBytes32Array(json, key); + } + + function readString(string memory json, string memory key) internal pure returns (string memory) { + return vm.parseJsonString(json, key); + } + + function readStringArray(string memory json, string memory key) internal pure returns (string[] memory) { + return vm.parseJsonStringArray(json, key); + } + + function readAddress(string memory json, string memory key) internal pure returns (address) { + return vm.parseJsonAddress(json, key); + } + + function readAddressArray(string memory json, string memory key) internal pure returns (address[] memory) { + return vm.parseJsonAddressArray(json, key); + } + + function readBool(string memory json, string memory key) internal pure returns (bool) { + return vm.parseJsonBool(json, key); + } + + function readBoolArray(string memory json, string memory key) internal pure returns (bool[] memory) { + return vm.parseJsonBoolArray(json, key); + } + + function readBytes(string memory json, string memory key) internal pure returns (bytes memory) { + return vm.parseJsonBytes(json, key); + } + + function readBytesArray(string memory json, string memory key) internal pure returns (bytes[] memory) { + return vm.parseJsonBytesArray(json, key); + } + + function serialize(string memory jsonKey, string memory rootObject) internal returns (string memory) { + return vm.serializeJson(jsonKey, rootObject); + } + + function serialize(string memory jsonKey, string memory key, bool value) internal returns (string memory) { + return vm.serializeBool(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, bool[] memory value) + internal + returns (string memory) + { + return vm.serializeBool(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, uint256 value) internal returns (string memory) { + return vm.serializeUint(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, uint256[] memory value) + internal + returns (string memory) + { + return vm.serializeUint(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, int256 value) internal returns (string memory) { + return vm.serializeInt(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, int256[] memory value) + internal + returns (string memory) + { + return vm.serializeInt(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, address value) internal returns (string memory) { + return vm.serializeAddress(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, address[] memory value) + internal + returns (string memory) + { + return vm.serializeAddress(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, bytes32 value) internal returns (string memory) { + return vm.serializeBytes32(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, bytes32[] memory value) + internal + returns (string memory) + { + return vm.serializeBytes32(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, bytes memory value) internal returns (string memory) { + return vm.serializeBytes(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, bytes[] memory value) + internal + returns (string memory) + { + return vm.serializeBytes(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, string memory value) + internal + returns (string memory) + { + return vm.serializeString(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, string[] memory value) + internal + returns (string memory) + { + return vm.serializeString(jsonKey, key, value); + } + + function write(string memory jsonKey, string memory path) internal { + vm.writeJson(jsonKey, path); + } + + function write(string memory jsonKey, string memory path, string memory valueKey) internal { + vm.writeJson(jsonKey, path, valueKey); + } +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/src/StdMath.sol b/harness/solidity_sized_tx_contract/lib/forge-std/src/StdMath.sol new file mode 100644 index 00000000..459523bd --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/src/StdMath.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.2 <0.9.0; + +library stdMath { + int256 private constant INT256_MIN = -57896044618658097711785492504343953926634992332820282019728792003956564819968; + + function abs(int256 a) internal pure returns (uint256) { + // Required or it will fail when `a = type(int256).min` + if (a == INT256_MIN) { + return 57896044618658097711785492504343953926634992332820282019728792003956564819968; + } + + return uint256(a > 0 ? a : -a); + } + + function delta(uint256 a, uint256 b) internal pure returns (uint256) { + return a > b ? a - b : b - a; + } + + function delta(int256 a, int256 b) internal pure returns (uint256) { + // a and b are of the same sign + // this works thanks to two's complement, the left-most bit is the sign bit + if ((a ^ b) > -1) { + return delta(abs(a), abs(b)); + } + + // a and b are of opposite signs + return abs(a) + abs(b); + } + + function percentDelta(uint256 a, uint256 b) internal pure returns (uint256) { + uint256 absDelta = delta(a, b); + + return absDelta * 1e18 / b; + } + + function percentDelta(int256 a, int256 b) internal pure returns (uint256) { + uint256 absDelta = delta(a, b); + uint256 absB = abs(b); + + return absDelta * 1e18 / absB; + } +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/src/StdStorage.sol b/harness/solidity_sized_tx_contract/lib/forge-std/src/StdStorage.sol new file mode 100644 index 00000000..e5ded703 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/src/StdStorage.sol @@ -0,0 +1,378 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.2 <0.9.0; + +import {Vm} from "./Vm.sol"; + +struct StdStorage { + mapping(address => mapping(bytes4 => mapping(bytes32 => uint256))) slots; + mapping(address => mapping(bytes4 => mapping(bytes32 => bool))) finds; + bytes32[] _keys; + bytes4 _sig; + uint256 _depth; + address _target; + bytes32 _set; +} + +library stdStorageSafe { + event SlotFound(address who, bytes4 fsig, bytes32 keysHash, uint256 slot); + event WARNING_UninitedSlot(address who, uint256 slot); + + Vm private constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code"))))); + + function sigs(string memory sigStr) internal pure returns (bytes4) { + return bytes4(keccak256(bytes(sigStr))); + } + + /// @notice find an arbitrary storage slot given a function sig, input data, address of the contract and a value to check against + // slot complexity: + // if flat, will be bytes32(uint256(uint)); + // if map, will be keccak256(abi.encode(key, uint(slot))); + // if deep map, will be keccak256(abi.encode(key1, keccak256(abi.encode(key0, uint(slot))))); + // if map struct, will be bytes32(uint256(keccak256(abi.encode(key1, keccak256(abi.encode(key0, uint(slot)))))) + structFieldDepth); + function find(StdStorage storage self) internal returns (uint256) { + address who = self._target; + bytes4 fsig = self._sig; + uint256 field_depth = self._depth; + bytes32[] memory ins = self._keys; + + // calldata to test against + if (self.finds[who][fsig][keccak256(abi.encodePacked(ins, field_depth))]) { + return self.slots[who][fsig][keccak256(abi.encodePacked(ins, field_depth))]; + } + bytes memory cald = abi.encodePacked(fsig, flatten(ins)); + vm.record(); + bytes32 fdat; + { + (, bytes memory rdat) = who.staticcall(cald); + fdat = bytesToBytes32(rdat, 32 * field_depth); + } + + (bytes32[] memory reads,) = vm.accesses(address(who)); + if (reads.length == 1) { + bytes32 curr = vm.load(who, reads[0]); + if (curr == bytes32(0)) { + emit WARNING_UninitedSlot(who, uint256(reads[0])); + } + if (fdat != curr) { + require( + false, + "stdStorage find(StdStorage): Packed slot. This would cause dangerous overwriting and currently isn't supported." + ); + } + emit SlotFound(who, fsig, keccak256(abi.encodePacked(ins, field_depth)), uint256(reads[0])); + self.slots[who][fsig][keccak256(abi.encodePacked(ins, field_depth))] = uint256(reads[0]); + self.finds[who][fsig][keccak256(abi.encodePacked(ins, field_depth))] = true; + } else if (reads.length > 1) { + for (uint256 i = 0; i < reads.length; i++) { + bytes32 prev = vm.load(who, reads[i]); + if (prev == bytes32(0)) { + emit WARNING_UninitedSlot(who, uint256(reads[i])); + } + if (prev != fdat) { + continue; + } + bytes32 new_val = ~prev; + // store + vm.store(who, reads[i], new_val); + bool success; + { + bytes memory rdat; + (success, rdat) = who.staticcall(cald); + fdat = bytesToBytes32(rdat, 32 * field_depth); + } + + if (success && fdat == new_val) { + // we found which of the slots is the actual one + emit SlotFound(who, fsig, keccak256(abi.encodePacked(ins, field_depth)), uint256(reads[i])); + self.slots[who][fsig][keccak256(abi.encodePacked(ins, field_depth))] = uint256(reads[i]); + self.finds[who][fsig][keccak256(abi.encodePacked(ins, field_depth))] = true; + vm.store(who, reads[i], prev); + break; + } + vm.store(who, reads[i], prev); + } + } else { + revert("stdStorage find(StdStorage): No storage use detected for target."); + } + + require( + self.finds[who][fsig][keccak256(abi.encodePacked(ins, field_depth))], + "stdStorage find(StdStorage): Slot(s) not found." + ); + + delete self._target; + delete self._sig; + delete self._keys; + delete self._depth; + + return self.slots[who][fsig][keccak256(abi.encodePacked(ins, field_depth))]; + } + + function target(StdStorage storage self, address _target) internal returns (StdStorage storage) { + self._target = _target; + return self; + } + + function sig(StdStorage storage self, bytes4 _sig) internal returns (StdStorage storage) { + self._sig = _sig; + return self; + } + + function sig(StdStorage storage self, string memory _sig) internal returns (StdStorage storage) { + self._sig = sigs(_sig); + return self; + } + + function with_key(StdStorage storage self, address who) internal returns (StdStorage storage) { + self._keys.push(bytes32(uint256(uint160(who)))); + return self; + } + + function with_key(StdStorage storage self, uint256 amt) internal returns (StdStorage storage) { + self._keys.push(bytes32(amt)); + return self; + } + + function with_key(StdStorage storage self, bytes32 key) internal returns (StdStorage storage) { + self._keys.push(key); + return self; + } + + function depth(StdStorage storage self, uint256 _depth) internal returns (StdStorage storage) { + self._depth = _depth; + return self; + } + + function read(StdStorage storage self) private returns (bytes memory) { + address t = self._target; + uint256 s = find(self); + return abi.encode(vm.load(t, bytes32(s))); + } + + function read_bytes32(StdStorage storage self) internal returns (bytes32) { + return abi.decode(read(self), (bytes32)); + } + + function read_bool(StdStorage storage self) internal returns (bool) { + int256 v = read_int(self); + if (v == 0) return false; + if (v == 1) return true; + revert("stdStorage read_bool(StdStorage): Cannot decode. Make sure you are reading a bool."); + } + + function read_address(StdStorage storage self) internal returns (address) { + return abi.decode(read(self), (address)); + } + + function read_uint(StdStorage storage self) internal returns (uint256) { + return abi.decode(read(self), (uint256)); + } + + function read_int(StdStorage storage self) internal returns (int256) { + return abi.decode(read(self), (int256)); + } + + function parent(StdStorage storage self) internal returns (uint256, bytes32) { + address who = self._target; + uint256 field_depth = self._depth; + vm.startMappingRecording(); + uint256 child = find(self) - field_depth; + (bool found, bytes32 key, bytes32 parent_slot) = vm.getMappingKeyAndParentOf(who, bytes32(child)); + if (!found) { + revert( + "stdStorage read_bool(StdStorage): Cannot find parent. Make sure you give a slot and startMappingRecording() has been called." + ); + } + return (uint256(parent_slot), key); + } + + function root(StdStorage storage self) internal returns (uint256) { + address who = self._target; + uint256 field_depth = self._depth; + vm.startMappingRecording(); + uint256 child = find(self) - field_depth; + bool found; + bytes32 root_slot; + bytes32 parent_slot; + (found,, parent_slot) = vm.getMappingKeyAndParentOf(who, bytes32(child)); + if (!found) { + revert( + "stdStorage read_bool(StdStorage): Cannot find parent. Make sure you give a slot and startMappingRecording() has been called." + ); + } + while (found) { + root_slot = parent_slot; + (found,, parent_slot) = vm.getMappingKeyAndParentOf(who, bytes32(root_slot)); + } + return uint256(root_slot); + } + + function bytesToBytes32(bytes memory b, uint256 offset) private pure returns (bytes32) { + bytes32 out; + + uint256 max = b.length > 32 ? 32 : b.length; + for (uint256 i = 0; i < max; i++) { + out |= bytes32(b[offset + i] & 0xFF) >> (i * 8); + } + return out; + } + + function flatten(bytes32[] memory b) private pure returns (bytes memory) { + bytes memory result = new bytes(b.length * 32); + for (uint256 i = 0; i < b.length; i++) { + bytes32 k = b[i]; + /// @solidity memory-safe-assembly + assembly { + mstore(add(result, add(32, mul(32, i))), k) + } + } + + return result; + } +} + +library stdStorage { + Vm private constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code"))))); + + function sigs(string memory sigStr) internal pure returns (bytes4) { + return stdStorageSafe.sigs(sigStr); + } + + function find(StdStorage storage self) internal returns (uint256) { + return stdStorageSafe.find(self); + } + + function target(StdStorage storage self, address _target) internal returns (StdStorage storage) { + return stdStorageSafe.target(self, _target); + } + + function sig(StdStorage storage self, bytes4 _sig) internal returns (StdStorage storage) { + return stdStorageSafe.sig(self, _sig); + } + + function sig(StdStorage storage self, string memory _sig) internal returns (StdStorage storage) { + return stdStorageSafe.sig(self, _sig); + } + + function with_key(StdStorage storage self, address who) internal returns (StdStorage storage) { + return stdStorageSafe.with_key(self, who); + } + + function with_key(StdStorage storage self, uint256 amt) internal returns (StdStorage storage) { + return stdStorageSafe.with_key(self, amt); + } + + function with_key(StdStorage storage self, bytes32 key) internal returns (StdStorage storage) { + return stdStorageSafe.with_key(self, key); + } + + function depth(StdStorage storage self, uint256 _depth) internal returns (StdStorage storage) { + return stdStorageSafe.depth(self, _depth); + } + + function checked_write(StdStorage storage self, address who) internal { + checked_write(self, bytes32(uint256(uint160(who)))); + } + + function checked_write(StdStorage storage self, uint256 amt) internal { + checked_write(self, bytes32(amt)); + } + + function checked_write_int(StdStorage storage self, int256 val) internal { + checked_write(self, bytes32(uint256(val))); + } + + function checked_write(StdStorage storage self, bool write) internal { + bytes32 t; + /// @solidity memory-safe-assembly + assembly { + t := write + } + checked_write(self, t); + } + + function checked_write(StdStorage storage self, bytes32 set) internal { + address who = self._target; + bytes4 fsig = self._sig; + uint256 field_depth = self._depth; + bytes32[] memory ins = self._keys; + + bytes memory cald = abi.encodePacked(fsig, flatten(ins)); + if (!self.finds[who][fsig][keccak256(abi.encodePacked(ins, field_depth))]) { + find(self); + } + bytes32 slot = bytes32(self.slots[who][fsig][keccak256(abi.encodePacked(ins, field_depth))]); + + bytes32 fdat; + { + (, bytes memory rdat) = who.staticcall(cald); + fdat = bytesToBytes32(rdat, 32 * field_depth); + } + bytes32 curr = vm.load(who, slot); + + if (fdat != curr) { + require( + false, + "stdStorage find(StdStorage): Packed slot. This would cause dangerous overwriting and currently isn't supported." + ); + } + vm.store(who, slot, set); + delete self._target; + delete self._sig; + delete self._keys; + delete self._depth; + } + + function read_bytes32(StdStorage storage self) internal returns (bytes32) { + return stdStorageSafe.read_bytes32(self); + } + + function read_bool(StdStorage storage self) internal returns (bool) { + return stdStorageSafe.read_bool(self); + } + + function read_address(StdStorage storage self) internal returns (address) { + return stdStorageSafe.read_address(self); + } + + function read_uint(StdStorage storage self) internal returns (uint256) { + return stdStorageSafe.read_uint(self); + } + + function read_int(StdStorage storage self) internal returns (int256) { + return stdStorageSafe.read_int(self); + } + + function parent(StdStorage storage self) internal returns (uint256, bytes32) { + return stdStorageSafe.parent(self); + } + + function root(StdStorage storage self) internal returns (uint256) { + return stdStorageSafe.root(self); + } + + // Private function so needs to be copied over + function bytesToBytes32(bytes memory b, uint256 offset) private pure returns (bytes32) { + bytes32 out; + + uint256 max = b.length > 32 ? 32 : b.length; + for (uint256 i = 0; i < max; i++) { + out |= bytes32(b[offset + i] & 0xFF) >> (i * 8); + } + return out; + } + + // Private function so needs to be copied over + function flatten(bytes32[] memory b) private pure returns (bytes memory) { + bytes memory result = new bytes(b.length * 32); + for (uint256 i = 0; i < b.length; i++) { + bytes32 k = b[i]; + /// @solidity memory-safe-assembly + assembly { + mstore(add(result, add(32, mul(32, i))), k) + } + } + + return result; + } +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/src/StdStyle.sol b/harness/solidity_sized_tx_contract/lib/forge-std/src/StdStyle.sol new file mode 100644 index 00000000..d371e0c6 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/src/StdStyle.sol @@ -0,0 +1,333 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.4.22 <0.9.0; + +import {VmSafe} from "./Vm.sol"; + +library StdStyle { + VmSafe private constant vm = VmSafe(address(uint160(uint256(keccak256("hevm cheat code"))))); + + string constant RED = "\u001b[91m"; + string constant GREEN = "\u001b[92m"; + string constant YELLOW = "\u001b[93m"; + string constant BLUE = "\u001b[94m"; + string constant MAGENTA = "\u001b[95m"; + string constant CYAN = "\u001b[96m"; + string constant BOLD = "\u001b[1m"; + string constant DIM = "\u001b[2m"; + string constant ITALIC = "\u001b[3m"; + string constant UNDERLINE = "\u001b[4m"; + string constant INVERSE = "\u001b[7m"; + string constant RESET = "\u001b[0m"; + + function styleConcat(string memory style, string memory self) private pure returns (string memory) { + return string(abi.encodePacked(style, self, RESET)); + } + + function red(string memory self) internal pure returns (string memory) { + return styleConcat(RED, self); + } + + function red(uint256 self) internal pure returns (string memory) { + return red(vm.toString(self)); + } + + function red(int256 self) internal pure returns (string memory) { + return red(vm.toString(self)); + } + + function red(address self) internal pure returns (string memory) { + return red(vm.toString(self)); + } + + function red(bool self) internal pure returns (string memory) { + return red(vm.toString(self)); + } + + function redBytes(bytes memory self) internal pure returns (string memory) { + return red(vm.toString(self)); + } + + function redBytes32(bytes32 self) internal pure returns (string memory) { + return red(vm.toString(self)); + } + + function green(string memory self) internal pure returns (string memory) { + return styleConcat(GREEN, self); + } + + function green(uint256 self) internal pure returns (string memory) { + return green(vm.toString(self)); + } + + function green(int256 self) internal pure returns (string memory) { + return green(vm.toString(self)); + } + + function green(address self) internal pure returns (string memory) { + return green(vm.toString(self)); + } + + function green(bool self) internal pure returns (string memory) { + return green(vm.toString(self)); + } + + function greenBytes(bytes memory self) internal pure returns (string memory) { + return green(vm.toString(self)); + } + + function greenBytes32(bytes32 self) internal pure returns (string memory) { + return green(vm.toString(self)); + } + + function yellow(string memory self) internal pure returns (string memory) { + return styleConcat(YELLOW, self); + } + + function yellow(uint256 self) internal pure returns (string memory) { + return yellow(vm.toString(self)); + } + + function yellow(int256 self) internal pure returns (string memory) { + return yellow(vm.toString(self)); + } + + function yellow(address self) internal pure returns (string memory) { + return yellow(vm.toString(self)); + } + + function yellow(bool self) internal pure returns (string memory) { + return yellow(vm.toString(self)); + } + + function yellowBytes(bytes memory self) internal pure returns (string memory) { + return yellow(vm.toString(self)); + } + + function yellowBytes32(bytes32 self) internal pure returns (string memory) { + return yellow(vm.toString(self)); + } + + function blue(string memory self) internal pure returns (string memory) { + return styleConcat(BLUE, self); + } + + function blue(uint256 self) internal pure returns (string memory) { + return blue(vm.toString(self)); + } + + function blue(int256 self) internal pure returns (string memory) { + return blue(vm.toString(self)); + } + + function blue(address self) internal pure returns (string memory) { + return blue(vm.toString(self)); + } + + function blue(bool self) internal pure returns (string memory) { + return blue(vm.toString(self)); + } + + function blueBytes(bytes memory self) internal pure returns (string memory) { + return blue(vm.toString(self)); + } + + function blueBytes32(bytes32 self) internal pure returns (string memory) { + return blue(vm.toString(self)); + } + + function magenta(string memory self) internal pure returns (string memory) { + return styleConcat(MAGENTA, self); + } + + function magenta(uint256 self) internal pure returns (string memory) { + return magenta(vm.toString(self)); + } + + function magenta(int256 self) internal pure returns (string memory) { + return magenta(vm.toString(self)); + } + + function magenta(address self) internal pure returns (string memory) { + return magenta(vm.toString(self)); + } + + function magenta(bool self) internal pure returns (string memory) { + return magenta(vm.toString(self)); + } + + function magentaBytes(bytes memory self) internal pure returns (string memory) { + return magenta(vm.toString(self)); + } + + function magentaBytes32(bytes32 self) internal pure returns (string memory) { + return magenta(vm.toString(self)); + } + + function cyan(string memory self) internal pure returns (string memory) { + return styleConcat(CYAN, self); + } + + function cyan(uint256 self) internal pure returns (string memory) { + return cyan(vm.toString(self)); + } + + function cyan(int256 self) internal pure returns (string memory) { + return cyan(vm.toString(self)); + } + + function cyan(address self) internal pure returns (string memory) { + return cyan(vm.toString(self)); + } + + function cyan(bool self) internal pure returns (string memory) { + return cyan(vm.toString(self)); + } + + function cyanBytes(bytes memory self) internal pure returns (string memory) { + return cyan(vm.toString(self)); + } + + function cyanBytes32(bytes32 self) internal pure returns (string memory) { + return cyan(vm.toString(self)); + } + + function bold(string memory self) internal pure returns (string memory) { + return styleConcat(BOLD, self); + } + + function bold(uint256 self) internal pure returns (string memory) { + return bold(vm.toString(self)); + } + + function bold(int256 self) internal pure returns (string memory) { + return bold(vm.toString(self)); + } + + function bold(address self) internal pure returns (string memory) { + return bold(vm.toString(self)); + } + + function bold(bool self) internal pure returns (string memory) { + return bold(vm.toString(self)); + } + + function boldBytes(bytes memory self) internal pure returns (string memory) { + return bold(vm.toString(self)); + } + + function boldBytes32(bytes32 self) internal pure returns (string memory) { + return bold(vm.toString(self)); + } + + function dim(string memory self) internal pure returns (string memory) { + return styleConcat(DIM, self); + } + + function dim(uint256 self) internal pure returns (string memory) { + return dim(vm.toString(self)); + } + + function dim(int256 self) internal pure returns (string memory) { + return dim(vm.toString(self)); + } + + function dim(address self) internal pure returns (string memory) { + return dim(vm.toString(self)); + } + + function dim(bool self) internal pure returns (string memory) { + return dim(vm.toString(self)); + } + + function dimBytes(bytes memory self) internal pure returns (string memory) { + return dim(vm.toString(self)); + } + + function dimBytes32(bytes32 self) internal pure returns (string memory) { + return dim(vm.toString(self)); + } + + function italic(string memory self) internal pure returns (string memory) { + return styleConcat(ITALIC, self); + } + + function italic(uint256 self) internal pure returns (string memory) { + return italic(vm.toString(self)); + } + + function italic(int256 self) internal pure returns (string memory) { + return italic(vm.toString(self)); + } + + function italic(address self) internal pure returns (string memory) { + return italic(vm.toString(self)); + } + + function italic(bool self) internal pure returns (string memory) { + return italic(vm.toString(self)); + } + + function italicBytes(bytes memory self) internal pure returns (string memory) { + return italic(vm.toString(self)); + } + + function italicBytes32(bytes32 self) internal pure returns (string memory) { + return italic(vm.toString(self)); + } + + function underline(string memory self) internal pure returns (string memory) { + return styleConcat(UNDERLINE, self); + } + + function underline(uint256 self) internal pure returns (string memory) { + return underline(vm.toString(self)); + } + + function underline(int256 self) internal pure returns (string memory) { + return underline(vm.toString(self)); + } + + function underline(address self) internal pure returns (string memory) { + return underline(vm.toString(self)); + } + + function underline(bool self) internal pure returns (string memory) { + return underline(vm.toString(self)); + } + + function underlineBytes(bytes memory self) internal pure returns (string memory) { + return underline(vm.toString(self)); + } + + function underlineBytes32(bytes32 self) internal pure returns (string memory) { + return underline(vm.toString(self)); + } + + function inverse(string memory self) internal pure returns (string memory) { + return styleConcat(INVERSE, self); + } + + function inverse(uint256 self) internal pure returns (string memory) { + return inverse(vm.toString(self)); + } + + function inverse(int256 self) internal pure returns (string memory) { + return inverse(vm.toString(self)); + } + + function inverse(address self) internal pure returns (string memory) { + return inverse(vm.toString(self)); + } + + function inverse(bool self) internal pure returns (string memory) { + return inverse(vm.toString(self)); + } + + function inverseBytes(bytes memory self) internal pure returns (string memory) { + return inverse(vm.toString(self)); + } + + function inverseBytes32(bytes32 self) internal pure returns (string memory) { + return inverse(vm.toString(self)); + } +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/src/StdUtils.sol b/harness/solidity_sized_tx_contract/lib/forge-std/src/StdUtils.sol new file mode 100644 index 00000000..0f613057 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/src/StdUtils.sol @@ -0,0 +1,226 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.2 <0.9.0; + +pragma experimental ABIEncoderV2; + +import {IMulticall3} from "./interfaces/IMulticall3.sol"; +import {MockERC20} from "./mocks/MockERC20.sol"; +import {MockERC721} from "./mocks/MockERC721.sol"; +import {VmSafe} from "./Vm.sol"; + +abstract contract StdUtils { + /*////////////////////////////////////////////////////////////////////////// + CONSTANTS + //////////////////////////////////////////////////////////////////////////*/ + + IMulticall3 private constant multicall = IMulticall3(0xcA11bde05977b3631167028862bE2a173976CA11); + VmSafe private constant vm = VmSafe(address(uint160(uint256(keccak256("hevm cheat code"))))); + address private constant CONSOLE2_ADDRESS = 0x000000000000000000636F6e736F6c652e6c6f67; + uint256 private constant INT256_MIN_ABS = + 57896044618658097711785492504343953926634992332820282019728792003956564819968; + uint256 private constant SECP256K1_ORDER = + 115792089237316195423570985008687907852837564279074904382605163141518161494337; + uint256 private constant UINT256_MAX = + 115792089237316195423570985008687907853269984665640564039457584007913129639935; + + // Used by default when deploying with create2, https://github.com/Arachnid/deterministic-deployment-proxy. + address private constant CREATE2_FACTORY = 0x4e59b44847b379578588920cA78FbF26c0B4956C; + + /*////////////////////////////////////////////////////////////////////////// + INTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////////////////*/ + + function _bound(uint256 x, uint256 min, uint256 max) internal pure virtual returns (uint256 result) { + require(min <= max, "StdUtils bound(uint256,uint256,uint256): Max is less than min."); + // If x is between min and max, return x directly. This is to ensure that dictionary values + // do not get shifted if the min is nonzero. More info: https://github.com/foundry-rs/forge-std/issues/188 + if (x >= min && x <= max) return x; + + uint256 size = max - min + 1; + + // If the value is 0, 1, 2, 3, wrap that to min, min+1, min+2, min+3. Similarly for the UINT256_MAX side. + // This helps ensure coverage of the min/max values. + if (x <= 3 && size > x) return min + x; + if (x >= UINT256_MAX - 3 && size > UINT256_MAX - x) return max - (UINT256_MAX - x); + + // Otherwise, wrap x into the range [min, max], i.e. the range is inclusive. + if (x > max) { + uint256 diff = x - max; + uint256 rem = diff % size; + if (rem == 0) return max; + result = min + rem - 1; + } else if (x < min) { + uint256 diff = min - x; + uint256 rem = diff % size; + if (rem == 0) return min; + result = max - rem + 1; + } + } + + function bound(uint256 x, uint256 min, uint256 max) internal pure virtual returns (uint256 result) { + result = _bound(x, min, max); + console2_log_StdUtils("Bound Result", result); + } + + function _bound(int256 x, int256 min, int256 max) internal pure virtual returns (int256 result) { + require(min <= max, "StdUtils bound(int256,int256,int256): Max is less than min."); + + // Shifting all int256 values to uint256 to use _bound function. The range of two types are: + // int256 : -(2**255) ~ (2**255 - 1) + // uint256: 0 ~ (2**256 - 1) + // So, add 2**255, INT256_MIN_ABS to the integer values. + // + // If the given integer value is -2**255, we cannot use `-uint256(-x)` because of the overflow. + // So, use `~uint256(x) + 1` instead. + uint256 _x = x < 0 ? (INT256_MIN_ABS - ~uint256(x) - 1) : (uint256(x) + INT256_MIN_ABS); + uint256 _min = min < 0 ? (INT256_MIN_ABS - ~uint256(min) - 1) : (uint256(min) + INT256_MIN_ABS); + uint256 _max = max < 0 ? (INT256_MIN_ABS - ~uint256(max) - 1) : (uint256(max) + INT256_MIN_ABS); + + uint256 y = _bound(_x, _min, _max); + + // To move it back to int256 value, subtract INT256_MIN_ABS at here. + result = y < INT256_MIN_ABS ? int256(~(INT256_MIN_ABS - y) + 1) : int256(y - INT256_MIN_ABS); + } + + function bound(int256 x, int256 min, int256 max) internal pure virtual returns (int256 result) { + result = _bound(x, min, max); + console2_log_StdUtils("Bound result", vm.toString(result)); + } + + function boundPrivateKey(uint256 privateKey) internal pure virtual returns (uint256 result) { + result = _bound(privateKey, 1, SECP256K1_ORDER - 1); + } + + function bytesToUint(bytes memory b) internal pure virtual returns (uint256) { + require(b.length <= 32, "StdUtils bytesToUint(bytes): Bytes length exceeds 32."); + return abi.decode(abi.encodePacked(new bytes(32 - b.length), b), (uint256)); + } + + /// @dev Compute the address a contract will be deployed at for a given deployer address and nonce + /// @notice adapted from Solmate implementation (https://github.com/Rari-Capital/solmate/blob/main/src/utils/LibRLP.sol) + function computeCreateAddress(address deployer, uint256 nonce) internal pure virtual returns (address) { + console2_log_StdUtils("computeCreateAddress is deprecated. Please use vm.computeCreateAddress instead."); + return vm.computeCreateAddress(deployer, nonce); + } + + function computeCreate2Address(bytes32 salt, bytes32 initcodeHash, address deployer) + internal + pure + virtual + returns (address) + { + console2_log_StdUtils("computeCreate2Address is deprecated. Please use vm.computeCreate2Address instead."); + return vm.computeCreate2Address(salt, initcodeHash, deployer); + } + + /// @dev returns the address of a contract created with CREATE2 using the default CREATE2 deployer + function computeCreate2Address(bytes32 salt, bytes32 initCodeHash) internal pure returns (address) { + console2_log_StdUtils("computeCreate2Address is deprecated. Please use vm.computeCreate2Address instead."); + return vm.computeCreate2Address(salt, initCodeHash); + } + + /// @dev returns an initialized mock ERC20 contract + function deployMockERC20(string memory name, string memory symbol, uint8 decimals) + internal + returns (MockERC20 mock) + { + mock = new MockERC20(); + mock.initialize(name, symbol, decimals); + } + + /// @dev returns an initialized mock ERC721 contract + function deployMockERC721(string memory name, string memory symbol) internal returns (MockERC721 mock) { + mock = new MockERC721(); + mock.initialize(name, symbol); + } + + /// @dev returns the hash of the init code (creation code + no args) used in CREATE2 with no constructor arguments + /// @param creationCode the creation code of a contract C, as returned by type(C).creationCode + function hashInitCode(bytes memory creationCode) internal pure returns (bytes32) { + return hashInitCode(creationCode, ""); + } + + /// @dev returns the hash of the init code (creation code + ABI-encoded args) used in CREATE2 + /// @param creationCode the creation code of a contract C, as returned by type(C).creationCode + /// @param args the ABI-encoded arguments to the constructor of C + function hashInitCode(bytes memory creationCode, bytes memory args) internal pure returns (bytes32) { + return keccak256(abi.encodePacked(creationCode, args)); + } + + // Performs a single call with Multicall3 to query the ERC-20 token balances of the given addresses. + function getTokenBalances(address token, address[] memory addresses) + internal + virtual + returns (uint256[] memory balances) + { + uint256 tokenCodeSize; + assembly { + tokenCodeSize := extcodesize(token) + } + require(tokenCodeSize > 0, "StdUtils getTokenBalances(address,address[]): Token address is not a contract."); + + // ABI encode the aggregate call to Multicall3. + uint256 length = addresses.length; + IMulticall3.Call[] memory calls = new IMulticall3.Call[](length); + for (uint256 i = 0; i < length; ++i) { + // 0x70a08231 = bytes4("balanceOf(address)")) + calls[i] = IMulticall3.Call({target: token, callData: abi.encodeWithSelector(0x70a08231, (addresses[i]))}); + } + + // Make the aggregate call. + (, bytes[] memory returnData) = multicall.aggregate(calls); + + // ABI decode the return data and return the balances. + balances = new uint256[](length); + for (uint256 i = 0; i < length; ++i) { + balances[i] = abi.decode(returnData[i], (uint256)); + } + } + + /*////////////////////////////////////////////////////////////////////////// + PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////////////////*/ + + function addressFromLast20Bytes(bytes32 bytesValue) private pure returns (address) { + return address(uint160(uint256(bytesValue))); + } + + // This section is used to prevent the compilation of console, which shortens the compilation time when console is + // not used elsewhere. We also trick the compiler into letting us make the console log methods as `pure` to avoid + // any breaking changes to function signatures. + function _castLogPayloadViewToPure(function(bytes memory) internal view fnIn) + internal + pure + returns (function(bytes memory) internal pure fnOut) + { + assembly { + fnOut := fnIn + } + } + + function _sendLogPayload(bytes memory payload) internal pure { + _castLogPayloadViewToPure(_sendLogPayloadView)(payload); + } + + function _sendLogPayloadView(bytes memory payload) private view { + uint256 payloadLength = payload.length; + address consoleAddress = CONSOLE2_ADDRESS; + /// @solidity memory-safe-assembly + assembly { + let payloadStart := add(payload, 32) + let r := staticcall(gas(), consoleAddress, payloadStart, payloadLength, 0, 0) + } + } + + function console2_log_StdUtils(string memory p0) private pure { + _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); + } + + function console2_log_StdUtils(string memory p0, uint256 p1) private pure { + _sendLogPayload(abi.encodeWithSignature("log(string,uint256)", p0, p1)); + } + + function console2_log_StdUtils(string memory p0, string memory p1) private pure { + _sendLogPayload(abi.encodeWithSignature("log(string,string)", p0, p1)); + } +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/src/Test.sol b/harness/solidity_sized_tx_contract/lib/forge-std/src/Test.sol new file mode 100644 index 00000000..743c1834 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/src/Test.sol @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.2 <0.9.0; + +pragma experimental ABIEncoderV2; + +// 💬 ABOUT +// Forge Std's default Test. + +// 🧩 MODULES +import {console} from "./console.sol"; +import {console2} from "./console2.sol"; +import {safeconsole} from "./safeconsole.sol"; +import {StdAssertions} from "./StdAssertions.sol"; +import {StdChains} from "./StdChains.sol"; +import {StdCheats} from "./StdCheats.sol"; +import {stdError} from "./StdError.sol"; +import {StdInvariant} from "./StdInvariant.sol"; +import {stdJson} from "./StdJson.sol"; +import {stdMath} from "./StdMath.sol"; +import {StdStorage, stdStorage} from "./StdStorage.sol"; +import {StdStyle} from "./StdStyle.sol"; +import {StdUtils} from "./StdUtils.sol"; +import {Vm} from "./Vm.sol"; + +// 📦 BOILERPLATE +import {TestBase} from "./Base.sol"; +import {DSTest} from "ds-test/test.sol"; + +// ⭐️ TEST +abstract contract Test is TestBase, DSTest, StdAssertions, StdChains, StdCheats, StdInvariant, StdUtils { +// Note: IS_TEST() must return true. +// Note: Must have failure system, https://github.com/dapphub/ds-test/blob/cd98eff28324bfac652e63a239a60632a761790b/src/test.sol#L39-L76. +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/src/Vm.sol b/harness/solidity_sized_tx_contract/lib/forge-std/src/Vm.sol new file mode 100644 index 00000000..fffe0c6b --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/src/Vm.sol @@ -0,0 +1,1096 @@ +// Automatically @generated by scripts/vm.py. Do not modify manually. + +// SPDX-License-Identifier: MIT OR Apache-2.0 +pragma solidity >=0.6.2 <0.9.0; +pragma experimental ABIEncoderV2; + +/// The `VmSafe` interface does not allow manipulation of the EVM state or other actions that may +/// result in Script simulations differing from on-chain execution. It is recommended to only use +/// these cheats in scripts. +interface VmSafe { + /// A modification applied to either `msg.sender` or `tx.origin`. Returned by `readCallers`. + enum CallerMode { + // No caller modification is currently active. + None, + // A one time broadcast triggered by a `vm.broadcast()` call is currently active. + Broadcast, + // A recurrent broadcast triggered by a `vm.startBroadcast()` call is currently active. + RecurrentBroadcast, + // A one time prank triggered by a `vm.prank()` call is currently active. + Prank, + // A recurrent prank triggered by a `vm.startPrank()` call is currently active. + RecurrentPrank + } + + /// The kind of account access that occurred. + enum AccountAccessKind { + // The account was called. + Call, + // The account was called via delegatecall. + DelegateCall, + // The account was called via callcode. + CallCode, + // The account was called via staticcall. + StaticCall, + // The account was created. + Create, + // The account was selfdestructed. + SelfDestruct, + // Synthetic access indicating the current context has resumed after a previous sub-context (AccountAccess). + Resume, + // The account's balance was read. + Balance, + // The account's codesize was read. + Extcodesize, + // The account's codehash was read. + Extcodehash, + // The account's code was copied. + Extcodecopy + } + + /// An Ethereum log. Returned by `getRecordedLogs`. + struct Log { + // The topics of the log, including the signature, if any. + bytes32[] topics; + // The raw data of the log. + bytes data; + // The address of the log's emitter. + address emitter; + } + + /// An RPC URL and its alias. Returned by `rpcUrlStructs`. + struct Rpc { + // The alias of the RPC URL. + string key; + // The RPC URL. + string url; + } + + /// An RPC log object. Returned by `eth_getLogs`. + struct EthGetLogs { + // The address of the log's emitter. + address emitter; + // The topics of the log, including the signature, if any. + bytes32[] topics; + // The raw data of the log. + bytes data; + // The block hash. + bytes32 blockHash; + // The block number. + uint64 blockNumber; + // The transaction hash. + bytes32 transactionHash; + // The transaction index in the block. + uint64 transactionIndex; + // The log index. + uint256 logIndex; + // Whether the log was removed. + bool removed; + } + + /// A single entry in a directory listing. Returned by `readDir`. + struct DirEntry { + // The error message, if any. + string errorMessage; + // The path of the entry. + string path; + // The depth of the entry. + uint64 depth; + // Whether the entry is a directory. + bool isDir; + // Whether the entry is a symlink. + bool isSymlink; + } + + /// Metadata information about a file. + /// This structure is returned from the `fsMetadata` function and represents known + /// metadata about a file such as its permissions, size, modification + /// times, etc. + struct FsMetadata { + // True if this metadata is for a directory. + bool isDir; + // True if this metadata is for a symlink. + bool isSymlink; + // The size of the file, in bytes, this metadata is for. + uint256 length; + // True if this metadata is for a readonly (unwritable) file. + bool readOnly; + // The last modification time listed in this metadata. + uint256 modified; + // The last access time of this metadata. + uint256 accessed; + // The creation time listed in this metadata. + uint256 created; + } + + /// A wallet with a public and private key. + struct Wallet { + // The wallet's address. + address addr; + // The wallet's public key `X`. + uint256 publicKeyX; + // The wallet's public key `Y`. + uint256 publicKeyY; + // The wallet's private key. + uint256 privateKey; + } + + /// The result of a `tryFfi` call. + struct FfiResult { + // The exit code of the call. + int32 exitCode; + // The optionally hex-decoded `stdout` data. + bytes stdout; + // The `stderr` data. + bytes stderr; + } + + /// Information on the chain and fork. + struct ChainInfo { + // The fork identifier. Set to zero if no fork is active. + uint256 forkId; + // The chain ID of the current fork. + uint256 chainId; + } + + /// The result of a `stopAndReturnStateDiff` call. + struct AccountAccess { + // The chain and fork the access occurred. + ChainInfo chainInfo; + // The kind of account access that determines what the account is. + // If kind is Call, DelegateCall, StaticCall or CallCode, then the account is the callee. + // If kind is Create, then the account is the newly created account. + // If kind is SelfDestruct, then the account is the selfdestruct recipient. + // If kind is a Resume, then account represents a account context that has resumed. + AccountAccessKind kind; + // The account that was accessed. + // It's either the account created, callee or a selfdestruct recipient for CREATE, CALL or SELFDESTRUCT. + address account; + // What accessed the account. + address accessor; + // If the account was initialized or empty prior to the access. + // An account is considered initialized if it has code, a + // non-zero nonce, or a non-zero balance. + bool initialized; + // The previous balance of the accessed account. + uint256 oldBalance; + // The potential new balance of the accessed account. + // That is, all balance changes are recorded here, even if reverts occurred. + uint256 newBalance; + // Code of the account deployed by CREATE. + bytes deployedCode; + // Value passed along with the account access + uint256 value; + // Input data provided to the CREATE or CALL + bytes data; + // If this access reverted in either the current or parent context. + bool reverted; + // An ordered list of storage accesses made during an account access operation. + StorageAccess[] storageAccesses; + } + + /// The storage accessed during an `AccountAccess`. + struct StorageAccess { + // The account whose storage was accessed. + address account; + // The slot that was accessed. + bytes32 slot; + // If the access was a write. + bool isWrite; + // The previous value of the slot. + bytes32 previousValue; + // The new value of the slot. + bytes32 newValue; + // If the access was reverted. + bool reverted; + } + + // ======== Environment ======== + + /// Gets the environment variable `name` and parses it as `address`. + /// Reverts if the variable was not found or could not be parsed. + function envAddress(string calldata name) external view returns (address value); + + /// Gets the environment variable `name` and parses it as an array of `address`, delimited by `delim`. + /// Reverts if the variable was not found or could not be parsed. + function envAddress(string calldata name, string calldata delim) external view returns (address[] memory value); + + /// Gets the environment variable `name` and parses it as `bool`. + /// Reverts if the variable was not found or could not be parsed. + function envBool(string calldata name) external view returns (bool value); + + /// Gets the environment variable `name` and parses it as an array of `bool`, delimited by `delim`. + /// Reverts if the variable was not found or could not be parsed. + function envBool(string calldata name, string calldata delim) external view returns (bool[] memory value); + + /// Gets the environment variable `name` and parses it as `bytes32`. + /// Reverts if the variable was not found or could not be parsed. + function envBytes32(string calldata name) external view returns (bytes32 value); + + /// Gets the environment variable `name` and parses it as an array of `bytes32`, delimited by `delim`. + /// Reverts if the variable was not found or could not be parsed. + function envBytes32(string calldata name, string calldata delim) external view returns (bytes32[] memory value); + + /// Gets the environment variable `name` and parses it as `bytes`. + /// Reverts if the variable was not found or could not be parsed. + function envBytes(string calldata name) external view returns (bytes memory value); + + /// Gets the environment variable `name` and parses it as an array of `bytes`, delimited by `delim`. + /// Reverts if the variable was not found or could not be parsed. + function envBytes(string calldata name, string calldata delim) external view returns (bytes[] memory value); + + /// Gets the environment variable `name` and parses it as `int256`. + /// Reverts if the variable was not found or could not be parsed. + function envInt(string calldata name) external view returns (int256 value); + + /// Gets the environment variable `name` and parses it as an array of `int256`, delimited by `delim`. + /// Reverts if the variable was not found or could not be parsed. + function envInt(string calldata name, string calldata delim) external view returns (int256[] memory value); + + /// Gets the environment variable `name` and parses it as `bool`. + /// Reverts if the variable could not be parsed. + /// Returns `defaultValue` if the variable was not found. + function envOr(string calldata name, bool defaultValue) external view returns (bool value); + + /// Gets the environment variable `name` and parses it as `uint256`. + /// Reverts if the variable could not be parsed. + /// Returns `defaultValue` if the variable was not found. + function envOr(string calldata name, uint256 defaultValue) external view returns (uint256 value); + + /// Gets the environment variable `name` and parses it as an array of `address`, delimited by `delim`. + /// Reverts if the variable could not be parsed. + /// Returns `defaultValue` if the variable was not found. + function envOr(string calldata name, string calldata delim, address[] calldata defaultValue) + external + view + returns (address[] memory value); + + /// Gets the environment variable `name` and parses it as an array of `bytes32`, delimited by `delim`. + /// Reverts if the variable could not be parsed. + /// Returns `defaultValue` if the variable was not found. + function envOr(string calldata name, string calldata delim, bytes32[] calldata defaultValue) + external + view + returns (bytes32[] memory value); + + /// Gets the environment variable `name` and parses it as an array of `string`, delimited by `delim`. + /// Reverts if the variable could not be parsed. + /// Returns `defaultValue` if the variable was not found. + function envOr(string calldata name, string calldata delim, string[] calldata defaultValue) + external + view + returns (string[] memory value); + + /// Gets the environment variable `name` and parses it as an array of `bytes`, delimited by `delim`. + /// Reverts if the variable could not be parsed. + /// Returns `defaultValue` if the variable was not found. + function envOr(string calldata name, string calldata delim, bytes[] calldata defaultValue) + external + view + returns (bytes[] memory value); + + /// Gets the environment variable `name` and parses it as `int256`. + /// Reverts if the variable could not be parsed. + /// Returns `defaultValue` if the variable was not found. + function envOr(string calldata name, int256 defaultValue) external view returns (int256 value); + + /// Gets the environment variable `name` and parses it as `address`. + /// Reverts if the variable could not be parsed. + /// Returns `defaultValue` if the variable was not found. + function envOr(string calldata name, address defaultValue) external view returns (address value); + + /// Gets the environment variable `name` and parses it as `bytes32`. + /// Reverts if the variable could not be parsed. + /// Returns `defaultValue` if the variable was not found. + function envOr(string calldata name, bytes32 defaultValue) external view returns (bytes32 value); + + /// Gets the environment variable `name` and parses it as `string`. + /// Reverts if the variable could not be parsed. + /// Returns `defaultValue` if the variable was not found. + function envOr(string calldata name, string calldata defaultValue) external view returns (string memory value); + + /// Gets the environment variable `name` and parses it as `bytes`. + /// Reverts if the variable could not be parsed. + /// Returns `defaultValue` if the variable was not found. + function envOr(string calldata name, bytes calldata defaultValue) external view returns (bytes memory value); + + /// Gets the environment variable `name` and parses it as an array of `bool`, delimited by `delim`. + /// Reverts if the variable could not be parsed. + /// Returns `defaultValue` if the variable was not found. + function envOr(string calldata name, string calldata delim, bool[] calldata defaultValue) + external + view + returns (bool[] memory value); + + /// Gets the environment variable `name` and parses it as an array of `uint256`, delimited by `delim`. + /// Reverts if the variable could not be parsed. + /// Returns `defaultValue` if the variable was not found. + function envOr(string calldata name, string calldata delim, uint256[] calldata defaultValue) + external + view + returns (uint256[] memory value); + + /// Gets the environment variable `name` and parses it as an array of `int256`, delimited by `delim`. + /// Reverts if the variable could not be parsed. + /// Returns `defaultValue` if the variable was not found. + function envOr(string calldata name, string calldata delim, int256[] calldata defaultValue) + external + view + returns (int256[] memory value); + + /// Gets the environment variable `name` and parses it as `string`. + /// Reverts if the variable was not found or could not be parsed. + function envString(string calldata name) external view returns (string memory value); + + /// Gets the environment variable `name` and parses it as an array of `string`, delimited by `delim`. + /// Reverts if the variable was not found or could not be parsed. + function envString(string calldata name, string calldata delim) external view returns (string[] memory value); + + /// Gets the environment variable `name` and parses it as `uint256`. + /// Reverts if the variable was not found or could not be parsed. + function envUint(string calldata name) external view returns (uint256 value); + + /// Gets the environment variable `name` and parses it as an array of `uint256`, delimited by `delim`. + /// Reverts if the variable was not found or could not be parsed. + function envUint(string calldata name, string calldata delim) external view returns (uint256[] memory value); + + /// Sets environment variables. + function setEnv(string calldata name, string calldata value) external; + + // ======== EVM ======== + + /// Gets all accessed reads and write slot from a `vm.record` session, for a given address. + function accesses(address target) external returns (bytes32[] memory readSlots, bytes32[] memory writeSlots); + + /// Gets the address for a given private key. + function addr(uint256 privateKey) external pure returns (address keyAddr); + + /// Gets all the logs according to specified filter. + function eth_getLogs(uint256 fromBlock, uint256 toBlock, address target, bytes32[] calldata topics) + external + returns (EthGetLogs[] memory logs); + + /// Gets the current `block.number`. + /// You should use this instead of `block.number` if you use `vm.roll`, as `block.number` is assumed to be constant across a transaction, + /// and as a result will get optimized out by the compiler. + /// See https://github.com/foundry-rs/foundry/issues/6180 + function getBlockNumber() external view returns (uint256 height); + + /// Gets the current `block.timestamp`. + /// You should use this instead of `block.timestamp` if you use `vm.warp`, as `block.timestamp` is assumed to be constant across a transaction, + /// and as a result will get optimized out by the compiler. + /// See https://github.com/foundry-rs/foundry/issues/6180 + function getBlockTimestamp() external view returns (uint256 timestamp); + + /// Gets the map key and parent of a mapping at a given slot, for a given address. + function getMappingKeyAndParentOf(address target, bytes32 elementSlot) + external + returns (bool found, bytes32 key, bytes32 parent); + + /// Gets the number of elements in the mapping at the given slot, for a given address. + function getMappingLength(address target, bytes32 mappingSlot) external returns (uint256 length); + + /// Gets the elements at index idx of the mapping at the given slot, for a given address. The + /// index must be less than the length of the mapping (i.e. the number of keys in the mapping). + function getMappingSlotAt(address target, bytes32 mappingSlot, uint256 idx) external returns (bytes32 value); + + /// Gets the nonce of an account. + function getNonce(address account) external view returns (uint64 nonce); + + /// Gets all the recorded logs. + function getRecordedLogs() external returns (Log[] memory logs); + + /// Loads a storage slot from an address. + function load(address target, bytes32 slot) external view returns (bytes32 data); + + /// Pauses gas metering (i.e. gas usage is not counted). Noop if already paused. + function pauseGasMetering() external; + + /// Records all storage reads and writes. + function record() external; + + /// Record all the transaction logs. + function recordLogs() external; + + /// Resumes gas metering (i.e. gas usage is counted again). Noop if already on. + function resumeGasMetering() external; + + /// Performs an Ethereum JSON-RPC request to the current fork URL. + function rpc(string calldata method, string calldata params) external returns (bytes memory data); + + /// Signs data. + function sign(uint256 privateKey, bytes32 digest) external pure returns (uint8 v, bytes32 r, bytes32 s); + + /// Starts recording all map SSTOREs for later retrieval. + function startMappingRecording() external; + + /// Record all account accesses as part of CREATE, CALL or SELFDESTRUCT opcodes in order, + /// along with the context of the calls + function startStateDiffRecording() external; + + /// Returns an ordered array of all account accesses from a `vm.startStateDiffRecording` session. + function stopAndReturnStateDiff() external returns (AccountAccess[] memory accountAccesses); + + /// Stops recording all map SSTOREs for later retrieval and clears the recorded data. + function stopMappingRecording() external; + + // ======== Filesystem ======== + + /// Closes file for reading, resetting the offset and allowing to read it from beginning with readLine. + /// `path` is relative to the project root. + function closeFile(string calldata path) external; + + /// Copies the contents of one file to another. This function will **overwrite** the contents of `to`. + /// On success, the total number of bytes copied is returned and it is equal to the length of the `to` file as reported by `metadata`. + /// Both `from` and `to` are relative to the project root. + function copyFile(string calldata from, string calldata to) external returns (uint64 copied); + + /// Creates a new, empty directory at the provided path. + /// This cheatcode will revert in the following situations, but is not limited to just these cases: + /// - User lacks permissions to modify `path`. + /// - A parent of the given path doesn't exist and `recursive` is false. + /// - `path` already exists and `recursive` is false. + /// `path` is relative to the project root. + function createDir(string calldata path, bool recursive) external; + + /// Returns true if the given path points to an existing entity, else returns false. + function exists(string calldata path) external returns (bool result); + + /// Performs a foreign function call via the terminal. + function ffi(string[] calldata commandInput) external returns (bytes memory result); + + /// Given a path, query the file system to get information about a file, directory, etc. + function fsMetadata(string calldata path) external view returns (FsMetadata memory metadata); + + /// Gets the creation bytecode from an artifact file. Takes in the relative path to the json file. + function getCode(string calldata artifactPath) external view returns (bytes memory creationBytecode); + + /// Gets the deployed bytecode from an artifact file. Takes in the relative path to the json file. + function getDeployedCode(string calldata artifactPath) external view returns (bytes memory runtimeBytecode); + + /// Returns true if the path exists on disk and is pointing at a directory, else returns false. + function isDir(string calldata path) external returns (bool result); + + /// Returns true if the path exists on disk and is pointing at a regular file, else returns false. + function isFile(string calldata path) external returns (bool result); + + /// Get the path of the current project root. + function projectRoot() external view returns (string memory path); + + /// Reads the directory at the given path recursively, up to `maxDepth`. + /// `maxDepth` defaults to 1, meaning only the direct children of the given directory will be returned. + /// Follows symbolic links if `followLinks` is true. + function readDir(string calldata path) external view returns (DirEntry[] memory entries); + + /// See `readDir(string)`. + function readDir(string calldata path, uint64 maxDepth) external view returns (DirEntry[] memory entries); + + /// See `readDir(string)`. + function readDir(string calldata path, uint64 maxDepth, bool followLinks) + external + view + returns (DirEntry[] memory entries); + + /// Reads the entire content of file to string. `path` is relative to the project root. + function readFile(string calldata path) external view returns (string memory data); + + /// Reads the entire content of file as binary. `path` is relative to the project root. + function readFileBinary(string calldata path) external view returns (bytes memory data); + + /// Reads next line of file to string. + function readLine(string calldata path) external view returns (string memory line); + + /// Reads a symbolic link, returning the path that the link points to. + /// This cheatcode will revert in the following situations, but is not limited to just these cases: + /// - `path` is not a symbolic link. + /// - `path` does not exist. + function readLink(string calldata linkPath) external view returns (string memory targetPath); + + /// Removes a directory at the provided path. + /// This cheatcode will revert in the following situations, but is not limited to just these cases: + /// - `path` doesn't exist. + /// - `path` isn't a directory. + /// - User lacks permissions to modify `path`. + /// - The directory is not empty and `recursive` is false. + /// `path` is relative to the project root. + function removeDir(string calldata path, bool recursive) external; + + /// Removes a file from the filesystem. + /// This cheatcode will revert in the following situations, but is not limited to just these cases: + /// - `path` points to a directory. + /// - The file doesn't exist. + /// - The user lacks permissions to remove the file. + /// `path` is relative to the project root. + function removeFile(string calldata path) external; + + /// Performs a foreign function call via terminal and returns the exit code, stdout, and stderr. + function tryFfi(string[] calldata commandInput) external returns (FfiResult memory result); + + /// Returns the time since unix epoch in milliseconds. + function unixTime() external returns (uint256 milliseconds); + + /// Writes data to file, creating a file if it does not exist, and entirely replacing its contents if it does. + /// `path` is relative to the project root. + function writeFile(string calldata path, string calldata data) external; + + /// Writes binary data to a file, creating a file if it does not exist, and entirely replacing its contents if it does. + /// `path` is relative to the project root. + function writeFileBinary(string calldata path, bytes calldata data) external; + + /// Writes line to file, creating a file if it does not exist. + /// `path` is relative to the project root. + function writeLine(string calldata path, string calldata data) external; + + // ======== JSON ======== + + /// Checks if `key` exists in a JSON object. + function keyExists(string calldata json, string calldata key) external view returns (bool); + + /// Parses a string of JSON data at `key` and coerces it to `address`. + function parseJsonAddress(string calldata json, string calldata key) external pure returns (address); + + /// Parses a string of JSON data at `key` and coerces it to `address[]`. + function parseJsonAddressArray(string calldata json, string calldata key) + external + pure + returns (address[] memory); + + /// Parses a string of JSON data at `key` and coerces it to `bool`. + function parseJsonBool(string calldata json, string calldata key) external pure returns (bool); + + /// Parses a string of JSON data at `key` and coerces it to `bool[]`. + function parseJsonBoolArray(string calldata json, string calldata key) external pure returns (bool[] memory); + + /// Parses a string of JSON data at `key` and coerces it to `bytes`. + function parseJsonBytes(string calldata json, string calldata key) external pure returns (bytes memory); + + /// Parses a string of JSON data at `key` and coerces it to `bytes32`. + function parseJsonBytes32(string calldata json, string calldata key) external pure returns (bytes32); + + /// Parses a string of JSON data at `key` and coerces it to `bytes32[]`. + function parseJsonBytes32Array(string calldata json, string calldata key) + external + pure + returns (bytes32[] memory); + + /// Parses a string of JSON data at `key` and coerces it to `bytes[]`. + function parseJsonBytesArray(string calldata json, string calldata key) external pure returns (bytes[] memory); + + /// Parses a string of JSON data at `key` and coerces it to `int256`. + function parseJsonInt(string calldata json, string calldata key) external pure returns (int256); + + /// Parses a string of JSON data at `key` and coerces it to `int256[]`. + function parseJsonIntArray(string calldata json, string calldata key) external pure returns (int256[] memory); + + /// Returns an array of all the keys in a JSON object. + function parseJsonKeys(string calldata json, string calldata key) external pure returns (string[] memory keys); + + /// Parses a string of JSON data at `key` and coerces it to `string`. + function parseJsonString(string calldata json, string calldata key) external pure returns (string memory); + + /// Parses a string of JSON data at `key` and coerces it to `string[]`. + function parseJsonStringArray(string calldata json, string calldata key) external pure returns (string[] memory); + + /// Parses a string of JSON data at `key` and coerces it to `uint256`. + function parseJsonUint(string calldata json, string calldata key) external pure returns (uint256); + + /// Parses a string of JSON data at `key` and coerces it to `uint256[]`. + function parseJsonUintArray(string calldata json, string calldata key) external pure returns (uint256[] memory); + + /// ABI-encodes a JSON object. + function parseJson(string calldata json) external pure returns (bytes memory abiEncodedData); + + /// ABI-encodes a JSON object at `key`. + function parseJson(string calldata json, string calldata key) external pure returns (bytes memory abiEncodedData); + + /// See `serializeJson`. + function serializeAddress(string calldata objectKey, string calldata valueKey, address value) + external + returns (string memory json); + + /// See `serializeJson`. + function serializeAddress(string calldata objectKey, string calldata valueKey, address[] calldata values) + external + returns (string memory json); + + /// See `serializeJson`. + function serializeBool(string calldata objectKey, string calldata valueKey, bool value) + external + returns (string memory json); + + /// See `serializeJson`. + function serializeBool(string calldata objectKey, string calldata valueKey, bool[] calldata values) + external + returns (string memory json); + + /// See `serializeJson`. + function serializeBytes32(string calldata objectKey, string calldata valueKey, bytes32 value) + external + returns (string memory json); + + /// See `serializeJson`. + function serializeBytes32(string calldata objectKey, string calldata valueKey, bytes32[] calldata values) + external + returns (string memory json); + + /// See `serializeJson`. + function serializeBytes(string calldata objectKey, string calldata valueKey, bytes calldata value) + external + returns (string memory json); + + /// See `serializeJson`. + function serializeBytes(string calldata objectKey, string calldata valueKey, bytes[] calldata values) + external + returns (string memory json); + + /// See `serializeJson`. + function serializeInt(string calldata objectKey, string calldata valueKey, int256 value) + external + returns (string memory json); + + /// See `serializeJson`. + function serializeInt(string calldata objectKey, string calldata valueKey, int256[] calldata values) + external + returns (string memory json); + + /// Serializes a key and value to a JSON object stored in-memory that can be later written to a file. + /// Returns the stringified version of the specific JSON file up to that moment. + function serializeJson(string calldata objectKey, string calldata value) external returns (string memory json); + + /// See `serializeJson`. + function serializeString(string calldata objectKey, string calldata valueKey, string calldata value) + external + returns (string memory json); + + /// See `serializeJson`. + function serializeString(string calldata objectKey, string calldata valueKey, string[] calldata values) + external + returns (string memory json); + + /// See `serializeJson`. + function serializeUint(string calldata objectKey, string calldata valueKey, uint256 value) + external + returns (string memory json); + + /// See `serializeJson`. + function serializeUint(string calldata objectKey, string calldata valueKey, uint256[] calldata values) + external + returns (string memory json); + + /// Write a serialized JSON object to a file. If the file exists, it will be overwritten. + function writeJson(string calldata json, string calldata path) external; + + /// Write a serialized JSON object to an **existing** JSON file, replacing a value with key = + /// This is useful to replace a specific value of a JSON file, without having to parse the entire thing. + function writeJson(string calldata json, string calldata path, string calldata valueKey) external; + + // ======== Scripting ======== + + /// Using the address that calls the test contract, has the next call (at this call depth only) + /// create a transaction that can later be signed and sent onchain. + function broadcast() external; + + /// Has the next call (at this call depth only) create a transaction with the address provided + /// as the sender that can later be signed and sent onchain. + function broadcast(address signer) external; + + /// Has the next call (at this call depth only) create a transaction with the private key + /// provided as the sender that can later be signed and sent onchain. + function broadcast(uint256 privateKey) external; + + /// Using the address that calls the test contract, has all subsequent calls + /// (at this call depth only) create transactions that can later be signed and sent onchain. + function startBroadcast() external; + + /// Has all subsequent calls (at this call depth only) create transactions with the address + /// provided that can later be signed and sent onchain. + function startBroadcast(address signer) external; + + /// Has all subsequent calls (at this call depth only) create transactions with the private key + /// provided that can later be signed and sent onchain. + function startBroadcast(uint256 privateKey) external; + + /// Stops collecting onchain transactions. + function stopBroadcast() external; + + // ======== String ======== + + /// Parses the given `string` into an `address`. + function parseAddress(string calldata stringifiedValue) external pure returns (address parsedValue); + + /// Parses the given `string` into a `bool`. + function parseBool(string calldata stringifiedValue) external pure returns (bool parsedValue); + + /// Parses the given `string` into `bytes`. + function parseBytes(string calldata stringifiedValue) external pure returns (bytes memory parsedValue); + + /// Parses the given `string` into a `bytes32`. + function parseBytes32(string calldata stringifiedValue) external pure returns (bytes32 parsedValue); + + /// Parses the given `string` into a `int256`. + function parseInt(string calldata stringifiedValue) external pure returns (int256 parsedValue); + + /// Parses the given `string` into a `uint256`. + function parseUint(string calldata stringifiedValue) external pure returns (uint256 parsedValue); + + /// Converts the given value to a `string`. + function toString(address value) external pure returns (string memory stringifiedValue); + + /// Converts the given value to a `string`. + function toString(bytes calldata value) external pure returns (string memory stringifiedValue); + + /// Converts the given value to a `string`. + function toString(bytes32 value) external pure returns (string memory stringifiedValue); + + /// Converts the given value to a `string`. + function toString(bool value) external pure returns (string memory stringifiedValue); + + /// Converts the given value to a `string`. + function toString(uint256 value) external pure returns (string memory stringifiedValue); + + /// Converts the given value to a `string`. + function toString(int256 value) external pure returns (string memory stringifiedValue); + + // ======== Testing ======== + + /// If the condition is false, discard this run's fuzz inputs and generate new ones. + function assume(bool condition) external pure; + + /// Writes a breakpoint to jump to in the debugger. + function breakpoint(string calldata char) external; + + /// Writes a conditional breakpoint to jump to in the debugger. + function breakpoint(string calldata char, bool value) external; + + /// Returns the RPC url for the given alias. + function rpcUrl(string calldata rpcAlias) external view returns (string memory json); + + /// Returns all rpc urls and their aliases as structs. + function rpcUrlStructs() external view returns (Rpc[] memory urls); + + /// Returns all rpc urls and their aliases `[alias, url][]`. + function rpcUrls() external view returns (string[2][] memory urls); + + /// Suspends execution of the main thread for `duration` milliseconds. + function sleep(uint256 duration) external; + + // ======== Utilities ======== + + /// Compute the address of a contract created with CREATE2 using the given CREATE2 deployer. + function computeCreate2Address(bytes32 salt, bytes32 initCodeHash, address deployer) + external + pure + returns (address); + + /// Compute the address of a contract created with CREATE2 using the default CREATE2 deployer. + function computeCreate2Address(bytes32 salt, bytes32 initCodeHash) external pure returns (address); + + /// Compute the address a contract will be deployed at for a given deployer address and nonce. + function computeCreateAddress(address deployer, uint256 nonce) external pure returns (address); + + /// Derives a private key from the name, labels the account with that name, and returns the wallet. + function createWallet(string calldata walletLabel) external returns (Wallet memory wallet); + + /// Generates a wallet from the private key and returns the wallet. + function createWallet(uint256 privateKey) external returns (Wallet memory wallet); + + /// Generates a wallet from the private key, labels the account with that name, and returns the wallet. + function createWallet(uint256 privateKey, string calldata walletLabel) external returns (Wallet memory wallet); + + /// Derive a private key from a provided mnenomic string (or mnenomic file path) + /// at the derivation path `m/44'/60'/0'/0/{index}`. + function deriveKey(string calldata mnemonic, uint32 index) external pure returns (uint256 privateKey); + + /// Derive a private key from a provided mnenomic string (or mnenomic file path) + /// at `{derivationPath}{index}`. + function deriveKey(string calldata mnemonic, string calldata derivationPath, uint32 index) + external + pure + returns (uint256 privateKey); + + /// Derive a private key from a provided mnenomic string (or mnenomic file path) in the specified language + /// at the derivation path `m/44'/60'/0'/0/{index}`. + function deriveKey(string calldata mnemonic, uint32 index, string calldata language) + external + pure + returns (uint256 privateKey); + + /// Derive a private key from a provided mnenomic string (or mnenomic file path) in the specified language + /// at `{derivationPath}{index}`. + function deriveKey(string calldata mnemonic, string calldata derivationPath, uint32 index, string calldata language) + external + pure + returns (uint256 privateKey); + + /// Gets the label for the specified address. + function getLabel(address account) external view returns (string memory currentLabel); + + /// Get a `Wallet`'s nonce. + function getNonce(Wallet calldata wallet) external returns (uint64 nonce); + + /// Labels an address in call traces. + function label(address account, string calldata newLabel) external; + + /// Adds a private key to the local forge wallet and returns the address. + function rememberKey(uint256 privateKey) external returns (address keyAddr); + + /// Signs data with a `Wallet`. + function sign(Wallet calldata wallet, bytes32 digest) external returns (uint8 v, bytes32 r, bytes32 s); +} + +/// The `Vm` interface does allow manipulation of the EVM state. These are all intended to be used +/// in tests, but it is not recommended to use these cheats in scripts. +interface Vm is VmSafe { + // ======== EVM ======== + + /// Returns the identifier of the currently active fork. Reverts if no fork is currently active. + function activeFork() external view returns (uint256 forkId); + + /// In forking mode, explicitly grant the given address cheatcode access. + function allowCheatcodes(address account) external; + + /// Sets `block.chainid`. + function chainId(uint256 newChainId) external; + + /// Clears all mocked calls. + function clearMockedCalls() external; + + /// Sets `block.coinbase`. + function coinbase(address newCoinbase) external; + + /// Creates a new fork with the given endpoint and the _latest_ block and returns the identifier of the fork. + function createFork(string calldata urlOrAlias) external returns (uint256 forkId); + + /// Creates a new fork with the given endpoint and block and returns the identifier of the fork. + function createFork(string calldata urlOrAlias, uint256 blockNumber) external returns (uint256 forkId); + + /// Creates a new fork with the given endpoint and at the block the given transaction was mined in, + /// replays all transaction mined in the block before the transaction, and returns the identifier of the fork. + function createFork(string calldata urlOrAlias, bytes32 txHash) external returns (uint256 forkId); + + /// Creates and also selects a new fork with the given endpoint and the latest block and returns the identifier of the fork. + function createSelectFork(string calldata urlOrAlias) external returns (uint256 forkId); + + /// Creates and also selects a new fork with the given endpoint and block and returns the identifier of the fork. + function createSelectFork(string calldata urlOrAlias, uint256 blockNumber) external returns (uint256 forkId); + + /// Creates and also selects new fork with the given endpoint and at the block the given transaction was mined in, + /// replays all transaction mined in the block before the transaction, returns the identifier of the fork. + function createSelectFork(string calldata urlOrAlias, bytes32 txHash) external returns (uint256 forkId); + + /// Sets an address' balance. + function deal(address account, uint256 newBalance) external; + + /// Removes the snapshot with the given ID created by `snapshot`. + /// Takes the snapshot ID to delete. + /// Returns `true` if the snapshot was successfully deleted. + /// Returns `false` if the snapshot does not exist. + function deleteSnapshot(uint256 snapshotId) external returns (bool success); + + /// Removes _all_ snapshots previously created by `snapshot`. + function deleteSnapshots() external; + + /// Sets `block.difficulty`. + /// Not available on EVM versions from Paris onwards. Use `prevrandao` instead. + /// Reverts if used on unsupported EVM versions. + function difficulty(uint256 newDifficulty) external; + + /// Sets an address' code. + function etch(address target, bytes calldata newRuntimeBytecode) external; + + /// Sets `block.basefee`. + function fee(uint256 newBasefee) external; + + /// Returns true if the account is marked as persistent. + function isPersistent(address account) external view returns (bool persistent); + + /// Load a genesis JSON file's `allocs` into the in-memory revm state. + function loadAllocs(string calldata pathToAllocsJson) external; + + /// Marks that the account(s) should use persistent storage across fork swaps in a multifork setup + /// Meaning, changes made to the state of this account will be kept when switching forks. + function makePersistent(address account) external; + + /// See `makePersistent(address)`. + function makePersistent(address account0, address account1) external; + + /// See `makePersistent(address)`. + function makePersistent(address account0, address account1, address account2) external; + + /// See `makePersistent(address)`. + function makePersistent(address[] calldata accounts) external; + + /// Reverts a call to an address with specified revert data. + function mockCallRevert(address callee, bytes calldata data, bytes calldata revertData) external; + + /// Reverts a call to an address with a specific `msg.value`, with specified revert data. + function mockCallRevert(address callee, uint256 msgValue, bytes calldata data, bytes calldata revertData) + external; + + /// Mocks a call to an address, returning specified data. + /// Calldata can either be strict or a partial match, e.g. if you only + /// pass a Solidity selector to the expected calldata, then the entire Solidity + /// function will be mocked. + function mockCall(address callee, bytes calldata data, bytes calldata returnData) external; + + /// Mocks a call to an address with a specific `msg.value`, returning specified data. + /// Calldata match takes precedence over `msg.value` in case of ambiguity. + function mockCall(address callee, uint256 msgValue, bytes calldata data, bytes calldata returnData) external; + + /// Sets the *next* call's `msg.sender` to be the input address. + function prank(address msgSender) external; + + /// Sets the *next* call's `msg.sender` to be the input address, and the `tx.origin` to be the second input. + function prank(address msgSender, address txOrigin) external; + + /// Sets `block.prevrandao`. + /// Not available on EVM versions before Paris. Use `difficulty` instead. + /// If used on unsupported EVM versions it will revert. + function prevrandao(bytes32 newPrevrandao) external; + + /// Reads the current `msg.sender` and `tx.origin` from state and reports if there is any active caller modification. + function readCallers() external returns (CallerMode callerMode, address msgSender, address txOrigin); + + /// Resets the nonce of an account to 0 for EOAs and 1 for contract accounts. + function resetNonce(address account) external; + + /// Revert the state of the EVM to a previous snapshot + /// Takes the snapshot ID to revert to. + /// Returns `true` if the snapshot was successfully reverted. + /// Returns `false` if the snapshot does not exist. + /// **Note:** This does not automatically delete the snapshot. To delete the snapshot use `deleteSnapshot`. + function revertTo(uint256 snapshotId) external returns (bool success); + + /// Revert the state of the EVM to a previous snapshot and automatically deletes the snapshots + /// Takes the snapshot ID to revert to. + /// Returns `true` if the snapshot was successfully reverted and deleted. + /// Returns `false` if the snapshot does not exist. + function revertToAndDelete(uint256 snapshotId) external returns (bool success); + + /// Revokes persistent status from the address, previously added via `makePersistent`. + function revokePersistent(address account) external; + + /// See `revokePersistent(address)`. + function revokePersistent(address[] calldata accounts) external; + + /// Sets `block.height`. + function roll(uint256 newHeight) external; + + /// Updates the currently active fork to given block number + /// This is similar to `roll` but for the currently active fork. + function rollFork(uint256 blockNumber) external; + + /// Updates the currently active fork to given transaction. This will `rollFork` with the number + /// of the block the transaction was mined in and replays all transaction mined before it in the block. + function rollFork(bytes32 txHash) external; + + /// Updates the given fork to given block number. + function rollFork(uint256 forkId, uint256 blockNumber) external; + + /// Updates the given fork to block number of the given transaction and replays all transaction mined before it in the block. + function rollFork(uint256 forkId, bytes32 txHash) external; + + /// Takes a fork identifier created by `createFork` and sets the corresponding forked state as active. + function selectFork(uint256 forkId) external; + + /// Sets the nonce of an account. Must be higher than the current nonce of the account. + function setNonce(address account, uint64 newNonce) external; + + /// Sets the nonce of an account to an arbitrary value. + function setNonceUnsafe(address account, uint64 newNonce) external; + + /// Snapshot the current state of the evm. + /// Returns the ID of the snapshot that was created. + /// To revert a snapshot use `revertTo`. + function snapshot() external returns (uint256 snapshotId); + + /// Sets all subsequent calls' `msg.sender` to be the input address until `stopPrank` is called. + function startPrank(address msgSender) external; + + /// Sets all subsequent calls' `msg.sender` to be the input address until `stopPrank` is called, and the `tx.origin` to be the second input. + function startPrank(address msgSender, address txOrigin) external; + + /// Resets subsequent calls' `msg.sender` to be `address(this)`. + function stopPrank() external; + + /// Stores a value to an address' storage slot. + function store(address target, bytes32 slot, bytes32 value) external; + + /// Fetches the given transaction from the active fork and executes it on the current state. + function transact(bytes32 txHash) external; + + /// Fetches the given transaction from the given fork and executes it on the current state. + function transact(uint256 forkId, bytes32 txHash) external; + + /// Sets `tx.gasprice`. + function txGasPrice(uint256 newGasPrice) external; + + /// Sets `block.timestamp`. + function warp(uint256 newTimestamp) external; + + // ======== Testing ======== + + /// Expect a call to an address with the specified `msg.value` and calldata, and a *minimum* amount of gas. + function expectCallMinGas(address callee, uint256 msgValue, uint64 minGas, bytes calldata data) external; + + /// Expect given number of calls to an address with the specified `msg.value` and calldata, and a *minimum* amount of gas. + function expectCallMinGas(address callee, uint256 msgValue, uint64 minGas, bytes calldata data, uint64 count) + external; + + /// Expects a call to an address with the specified calldata. + /// Calldata can either be a strict or a partial match. + function expectCall(address callee, bytes calldata data) external; + + /// Expects given number of calls to an address with the specified calldata. + function expectCall(address callee, bytes calldata data, uint64 count) external; + + /// Expects a call to an address with the specified `msg.value` and calldata. + function expectCall(address callee, uint256 msgValue, bytes calldata data) external; + + /// Expects given number of calls to an address with the specified `msg.value` and calldata. + function expectCall(address callee, uint256 msgValue, bytes calldata data, uint64 count) external; + + /// Expect a call to an address with the specified `msg.value`, gas, and calldata. + function expectCall(address callee, uint256 msgValue, uint64 gas, bytes calldata data) external; + + /// Expects given number of calls to an address with the specified `msg.value`, gas, and calldata. + function expectCall(address callee, uint256 msgValue, uint64 gas, bytes calldata data, uint64 count) external; + + /// Prepare an expected log with (bool checkTopic1, bool checkTopic2, bool checkTopic3, bool checkData.). + /// Call this function, then emit an event, then call a function. Internally after the call, we check if + /// logs were emitted in the expected order with the expected topics and data (as specified by the booleans). + function expectEmit(bool checkTopic1, bool checkTopic2, bool checkTopic3, bool checkData) external; + + /// Same as the previous method, but also checks supplied address against emitting contract. + function expectEmit(bool checkTopic1, bool checkTopic2, bool checkTopic3, bool checkData, address emitter) + external; + + /// Prepare an expected log with all topic and data checks enabled. + /// Call this function, then emit an event, then call a function. Internally after the call, we check if + /// logs were emitted in the expected order with the expected topics and data. + function expectEmit() external; + + /// Same as the previous method, but also checks supplied address against emitting contract. + function expectEmit(address emitter) external; + + /// Expects an error on next call with any revert data. + function expectRevert() external; + + /// Expects an error on next call that starts with the revert data. + function expectRevert(bytes4 revertData) external; + + /// Expects an error on next call that exactly matches the revert data. + function expectRevert(bytes calldata revertData) external; + + /// Only allows memory writes to offsets [0x00, 0x60) ∪ [min, max) in the current subcontext. If any other + /// memory is written to, the test will fail. Can be called multiple times to add more ranges to the set. + function expectSafeMemory(uint64 min, uint64 max) external; + + /// Only allows memory writes to offsets [0x00, 0x60) ∪ [min, max) in the next created subcontext. + /// If any other memory is written to, the test will fail. Can be called multiple times to add more ranges + /// to the set. + function expectSafeMemoryCall(uint64 min, uint64 max) external; + + /// Marks a test as skipped. Must be called at the top of the test. + function skip(bool skipTest) external; +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/src/console.sol b/harness/solidity_sized_tx_contract/lib/forge-std/src/console.sol new file mode 100644 index 00000000..ad57e536 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/src/console.sol @@ -0,0 +1,1533 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.4.22 <0.9.0; + +library console { + address constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67); + + function _sendLogPayload(bytes memory payload) private view { + uint256 payloadLength = payload.length; + address consoleAddress = CONSOLE_ADDRESS; + /// @solidity memory-safe-assembly + assembly { + let payloadStart := add(payload, 32) + let r := staticcall(gas(), consoleAddress, payloadStart, payloadLength, 0, 0) + } + } + + function log() internal view { + _sendLogPayload(abi.encodeWithSignature("log()")); + } + + function logInt(int p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(int)", p0)); + } + + function logUint(uint p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint)", p0)); + } + + function logString(string memory p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); + } + + function logBool(bool p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); + } + + function logAddress(address p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); + } + + function logBytes(bytes memory p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes)", p0)); + } + + function logBytes1(bytes1 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes1)", p0)); + } + + function logBytes2(bytes2 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes2)", p0)); + } + + function logBytes3(bytes3 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes3)", p0)); + } + + function logBytes4(bytes4 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes4)", p0)); + } + + function logBytes5(bytes5 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes5)", p0)); + } + + function logBytes6(bytes6 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes6)", p0)); + } + + function logBytes7(bytes7 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes7)", p0)); + } + + function logBytes8(bytes8 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes8)", p0)); + } + + function logBytes9(bytes9 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes9)", p0)); + } + + function logBytes10(bytes10 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes10)", p0)); + } + + function logBytes11(bytes11 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes11)", p0)); + } + + function logBytes12(bytes12 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes12)", p0)); + } + + function logBytes13(bytes13 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes13)", p0)); + } + + function logBytes14(bytes14 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes14)", p0)); + } + + function logBytes15(bytes15 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes15)", p0)); + } + + function logBytes16(bytes16 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes16)", p0)); + } + + function logBytes17(bytes17 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes17)", p0)); + } + + function logBytes18(bytes18 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes18)", p0)); + } + + function logBytes19(bytes19 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes19)", p0)); + } + + function logBytes20(bytes20 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes20)", p0)); + } + + function logBytes21(bytes21 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes21)", p0)); + } + + function logBytes22(bytes22 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes22)", p0)); + } + + function logBytes23(bytes23 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes23)", p0)); + } + + function logBytes24(bytes24 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes24)", p0)); + } + + function logBytes25(bytes25 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes25)", p0)); + } + + function logBytes26(bytes26 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes26)", p0)); + } + + function logBytes27(bytes27 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes27)", p0)); + } + + function logBytes28(bytes28 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes28)", p0)); + } + + function logBytes29(bytes29 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes29)", p0)); + } + + function logBytes30(bytes30 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes30)", p0)); + } + + function logBytes31(bytes31 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes31)", p0)); + } + + function logBytes32(bytes32 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes32)", p0)); + } + + function log(uint p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint)", p0)); + } + + function log(string memory p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); + } + + function log(bool p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); + } + + function log(address p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); + } + + function log(uint p0, uint p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint)", p0, p1)); + } + + function log(uint p0, string memory p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string)", p0, p1)); + } + + function log(uint p0, bool p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool)", p0, p1)); + } + + function log(uint p0, address p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address)", p0, p1)); + } + + function log(string memory p0, uint p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint)", p0, p1)); + } + + function log(string memory p0, string memory p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string)", p0, p1)); + } + + function log(string memory p0, bool p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool)", p0, p1)); + } + + function log(string memory p0, address p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address)", p0, p1)); + } + + function log(bool p0, uint p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint)", p0, p1)); + } + + function log(bool p0, string memory p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string)", p0, p1)); + } + + function log(bool p0, bool p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool)", p0, p1)); + } + + function log(bool p0, address p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address)", p0, p1)); + } + + function log(address p0, uint p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint)", p0, p1)); + } + + function log(address p0, string memory p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string)", p0, p1)); + } + + function log(address p0, bool p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool)", p0, p1)); + } + + function log(address p0, address p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address)", p0, p1)); + } + + function log(uint p0, uint p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint)", p0, p1, p2)); + } + + function log(uint p0, uint p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string)", p0, p1, p2)); + } + + function log(uint p0, uint p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool)", p0, p1, p2)); + } + + function log(uint p0, uint p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address)", p0, p1, p2)); + } + + function log(uint p0, string memory p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint)", p0, p1, p2)); + } + + function log(uint p0, string memory p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,string)", p0, p1, p2)); + } + + function log(uint p0, string memory p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool)", p0, p1, p2)); + } + + function log(uint p0, string memory p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,address)", p0, p1, p2)); + } + + function log(uint p0, bool p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint)", p0, p1, p2)); + } + + function log(uint p0, bool p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string)", p0, p1, p2)); + } + + function log(uint p0, bool p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool)", p0, p1, p2)); + } + + function log(uint p0, bool p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address)", p0, p1, p2)); + } + + function log(uint p0, address p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint)", p0, p1, p2)); + } + + function log(uint p0, address p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,string)", p0, p1, p2)); + } + + function log(uint p0, address p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool)", p0, p1, p2)); + } + + function log(uint p0, address p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,address)", p0, p1, p2)); + } + + function log(string memory p0, uint p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint)", p0, p1, p2)); + } + + function log(string memory p0, uint p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,string)", p0, p1, p2)); + } + + function log(string memory p0, uint p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool)", p0, p1, p2)); + } + + function log(string memory p0, uint p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,address)", p0, p1, p2)); + } + + function log(string memory p0, string memory p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,uint)", p0, p1, p2)); + } + + function log(string memory p0, string memory p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,string)", p0, p1, p2)); + } + + function log(string memory p0, string memory p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,bool)", p0, p1, p2)); + } + + function log(string memory p0, string memory p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,address)", p0, p1, p2)); + } + + function log(string memory p0, bool p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint)", p0, p1, p2)); + } + + function log(string memory p0, bool p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,string)", p0, p1, p2)); + } + + function log(string memory p0, bool p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool)", p0, p1, p2)); + } + + function log(string memory p0, bool p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,address)", p0, p1, p2)); + } + + function log(string memory p0, address p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,uint)", p0, p1, p2)); + } + + function log(string memory p0, address p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,string)", p0, p1, p2)); + } + + function log(string memory p0, address p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,bool)", p0, p1, p2)); + } + + function log(string memory p0, address p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,address)", p0, p1, p2)); + } + + function log(bool p0, uint p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint)", p0, p1, p2)); + } + + function log(bool p0, uint p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string)", p0, p1, p2)); + } + + function log(bool p0, uint p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool)", p0, p1, p2)); + } + + function log(bool p0, uint p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address)", p0, p1, p2)); + } + + function log(bool p0, string memory p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint)", p0, p1, p2)); + } + + function log(bool p0, string memory p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,string)", p0, p1, p2)); + } + + function log(bool p0, string memory p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool)", p0, p1, p2)); + } + + function log(bool p0, string memory p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,address)", p0, p1, p2)); + } + + function log(bool p0, bool p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint)", p0, p1, p2)); + } + + function log(bool p0, bool p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string)", p0, p1, p2)); + } + + function log(bool p0, bool p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool)", p0, p1, p2)); + } + + function log(bool p0, bool p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address)", p0, p1, p2)); + } + + function log(bool p0, address p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint)", p0, p1, p2)); + } + + function log(bool p0, address p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,string)", p0, p1, p2)); + } + + function log(bool p0, address p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool)", p0, p1, p2)); + } + + function log(bool p0, address p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,address)", p0, p1, p2)); + } + + function log(address p0, uint p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint)", p0, p1, p2)); + } + + function log(address p0, uint p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,string)", p0, p1, p2)); + } + + function log(address p0, uint p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool)", p0, p1, p2)); + } + + function log(address p0, uint p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,address)", p0, p1, p2)); + } + + function log(address p0, string memory p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,uint)", p0, p1, p2)); + } + + function log(address p0, string memory p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,string)", p0, p1, p2)); + } + + function log(address p0, string memory p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,bool)", p0, p1, p2)); + } + + function log(address p0, string memory p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,address)", p0, p1, p2)); + } + + function log(address p0, bool p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint)", p0, p1, p2)); + } + + function log(address p0, bool p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,string)", p0, p1, p2)); + } + + function log(address p0, bool p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool)", p0, p1, p2)); + } + + function log(address p0, bool p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,address)", p0, p1, p2)); + } + + function log(address p0, address p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,uint)", p0, p1, p2)); + } + + function log(address p0, address p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,string)", p0, p1, p2)); + } + + function log(address p0, address p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,bool)", p0, p1, p2)); + } + + function log(address p0, address p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,address)", p0, p1, p2)); + } + + function log(uint p0, uint p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,string)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,address)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,string)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,address)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,string)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,address)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,string)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,address)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,string)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,address)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,string)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,address)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,string)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,address)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,string)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,address)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,string)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,address)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,string)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,address)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,string)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,address)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,string)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,address)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,string)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,address)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,string)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,address)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,string)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,address)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,string)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,string,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,string,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,string,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,string,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,address,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,address,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,address,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,address,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,string,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,string,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,string,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,string,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,address,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,address,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,address,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,address,address)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,string)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,address)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,string)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,address)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,string)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,address)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,string)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,address)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,string)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,address)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,string)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,address)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,string)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,address)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,string)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,address)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,string)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,address)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,string)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,address)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,string)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,address)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,string)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,address)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,string)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,address)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,string)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,address)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,string)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,address)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,string)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,address)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,uint)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,string)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,bool)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,address)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,uint)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,string)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,bool)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,address)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,uint)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,string)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,bool)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,address)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,uint)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,string)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,bool)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,address)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,uint)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,string)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,bool)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,address)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,string,uint)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,string,string)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,string,bool)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,string,address)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,uint)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,string)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,bool)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,address)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,address,uint)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,address,string)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,address,bool)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,address,address)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,uint)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,string)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,bool)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,address)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,uint)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,string)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,bool)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,address)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,uint)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,string)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,bool)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,address)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,uint)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,string)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,bool)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,address)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,uint)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,string)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,bool)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,address)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,string,uint)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,string,string)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,string,bool)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,string,address)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,uint)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,string)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,bool)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,address)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,address,uint)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,address,string)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,address,bool)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,address,address)", p0, p1, p2, p3)); + } + +} \ No newline at end of file diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/src/console2.sol b/harness/solidity_sized_tx_contract/lib/forge-std/src/console2.sol new file mode 100644 index 00000000..c1e2cd75 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/src/console2.sol @@ -0,0 +1,1558 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.4.22 <0.9.0; + +/// @dev The original console.sol uses `int` and `uint` for computing function selectors, but it should +/// use `int256` and `uint256`. This modified version fixes that. This version is recommended +/// over `console.sol` if you don't need compatibility with Hardhat as the logs will show up in +/// forge stack traces. If you do need compatibility with Hardhat, you must use `console.sol`. +/// Reference: https://github.com/NomicFoundation/hardhat/issues/2178 +library console2 { + address constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67); + + function _castLogPayloadViewToPure( + function(bytes memory) internal view fnIn + ) internal pure returns (function(bytes memory) internal pure fnOut) { + assembly { + fnOut := fnIn + } + } + + function _sendLogPayload(bytes memory payload) internal pure { + _castLogPayloadViewToPure(_sendLogPayloadView)(payload); + } + + function _sendLogPayloadView(bytes memory payload) private view { + uint256 payloadLength = payload.length; + address consoleAddress = CONSOLE_ADDRESS; + /// @solidity memory-safe-assembly + assembly { + let payloadStart := add(payload, 32) + let r := staticcall(gas(), consoleAddress, payloadStart, payloadLength, 0, 0) + } + } + + function log() internal pure { + _sendLogPayload(abi.encodeWithSignature("log()")); + } + + function logInt(int256 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(int256)", p0)); + } + + function logUint(uint256 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256)", p0)); + } + + function logString(string memory p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); + } + + function logBool(bool p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); + } + + function logAddress(address p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); + } + + function logBytes(bytes memory p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes)", p0)); + } + + function logBytes1(bytes1 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes1)", p0)); + } + + function logBytes2(bytes2 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes2)", p0)); + } + + function logBytes3(bytes3 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes3)", p0)); + } + + function logBytes4(bytes4 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes4)", p0)); + } + + function logBytes5(bytes5 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes5)", p0)); + } + + function logBytes6(bytes6 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes6)", p0)); + } + + function logBytes7(bytes7 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes7)", p0)); + } + + function logBytes8(bytes8 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes8)", p0)); + } + + function logBytes9(bytes9 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes9)", p0)); + } + + function logBytes10(bytes10 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes10)", p0)); + } + + function logBytes11(bytes11 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes11)", p0)); + } + + function logBytes12(bytes12 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes12)", p0)); + } + + function logBytes13(bytes13 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes13)", p0)); + } + + function logBytes14(bytes14 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes14)", p0)); + } + + function logBytes15(bytes15 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes15)", p0)); + } + + function logBytes16(bytes16 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes16)", p0)); + } + + function logBytes17(bytes17 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes17)", p0)); + } + + function logBytes18(bytes18 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes18)", p0)); + } + + function logBytes19(bytes19 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes19)", p0)); + } + + function logBytes20(bytes20 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes20)", p0)); + } + + function logBytes21(bytes21 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes21)", p0)); + } + + function logBytes22(bytes22 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes22)", p0)); + } + + function logBytes23(bytes23 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes23)", p0)); + } + + function logBytes24(bytes24 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes24)", p0)); + } + + function logBytes25(bytes25 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes25)", p0)); + } + + function logBytes26(bytes26 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes26)", p0)); + } + + function logBytes27(bytes27 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes27)", p0)); + } + + function logBytes28(bytes28 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes28)", p0)); + } + + function logBytes29(bytes29 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes29)", p0)); + } + + function logBytes30(bytes30 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes30)", p0)); + } + + function logBytes31(bytes31 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes31)", p0)); + } + + function logBytes32(bytes32 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bytes32)", p0)); + } + + function log(uint256 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256)", p0)); + } + + function log(int256 p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(int256)", p0)); + } + + function log(string memory p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); + } + + function log(bool p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); + } + + function log(address p0) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); + } + + function log(uint256 p0, uint256 p1) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256)", p0, p1)); + } + + function log(uint256 p0, string memory p1) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,string)", p0, p1)); + } + + function log(uint256 p0, bool p1) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,bool)", p0, p1)); + } + + function log(uint256 p0, address p1) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,address)", p0, p1)); + } + + function log(string memory p0, uint256 p1) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,uint256)", p0, p1)); + } + + function log(string memory p0, int256 p1) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,int256)", p0, p1)); + } + + function log(string memory p0, string memory p1) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,string)", p0, p1)); + } + + function log(string memory p0, bool p1) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,bool)", p0, p1)); + } + + function log(string memory p0, address p1) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,address)", p0, p1)); + } + + function log(bool p0, uint256 p1) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint256)", p0, p1)); + } + + function log(bool p0, string memory p1) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,string)", p0, p1)); + } + + function log(bool p0, bool p1) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool)", p0, p1)); + } + + function log(bool p0, address p1) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,address)", p0, p1)); + } + + function log(address p0, uint256 p1) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,uint256)", p0, p1)); + } + + function log(address p0, string memory p1) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,string)", p0, p1)); + } + + function log(address p0, bool p1) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,bool)", p0, p1)); + } + + function log(address p0, address p1) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,address)", p0, p1)); + } + + function log(uint256 p0, uint256 p1, uint256 p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,uint256)", p0, p1, p2)); + } + + function log(uint256 p0, uint256 p1, string memory p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,string)", p0, p1, p2)); + } + + function log(uint256 p0, uint256 p1, bool p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,bool)", p0, p1, p2)); + } + + function log(uint256 p0, uint256 p1, address p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,address)", p0, p1, p2)); + } + + function log(uint256 p0, string memory p1, uint256 p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,string,uint256)", p0, p1, p2)); + } + + function log(uint256 p0, string memory p1, string memory p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,string,string)", p0, p1, p2)); + } + + function log(uint256 p0, string memory p1, bool p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,string,bool)", p0, p1, p2)); + } + + function log(uint256 p0, string memory p1, address p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,string,address)", p0, p1, p2)); + } + + function log(uint256 p0, bool p1, uint256 p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,uint256)", p0, p1, p2)); + } + + function log(uint256 p0, bool p1, string memory p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,string)", p0, p1, p2)); + } + + function log(uint256 p0, bool p1, bool p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,bool)", p0, p1, p2)); + } + + function log(uint256 p0, bool p1, address p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,address)", p0, p1, p2)); + } + + function log(uint256 p0, address p1, uint256 p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,address,uint256)", p0, p1, p2)); + } + + function log(uint256 p0, address p1, string memory p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,address,string)", p0, p1, p2)); + } + + function log(uint256 p0, address p1, bool p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,address,bool)", p0, p1, p2)); + } + + function log(uint256 p0, address p1, address p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,address,address)", p0, p1, p2)); + } + + function log(string memory p0, uint256 p1, uint256 p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,uint256,uint256)", p0, p1, p2)); + } + + function log(string memory p0, uint256 p1, string memory p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,uint256,string)", p0, p1, p2)); + } + + function log(string memory p0, uint256 p1, bool p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,uint256,bool)", p0, p1, p2)); + } + + function log(string memory p0, uint256 p1, address p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,uint256,address)", p0, p1, p2)); + } + + function log(string memory p0, string memory p1, uint256 p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,string,uint256)", p0, p1, p2)); + } + + function log(string memory p0, string memory p1, string memory p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,string,string)", p0, p1, p2)); + } + + function log(string memory p0, string memory p1, bool p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,string,bool)", p0, p1, p2)); + } + + function log(string memory p0, string memory p1, address p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,string,address)", p0, p1, p2)); + } + + function log(string memory p0, bool p1, uint256 p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint256)", p0, p1, p2)); + } + + function log(string memory p0, bool p1, string memory p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,string)", p0, p1, p2)); + } + + function log(string memory p0, bool p1, bool p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool)", p0, p1, p2)); + } + + function log(string memory p0, bool p1, address p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,address)", p0, p1, p2)); + } + + function log(string memory p0, address p1, uint256 p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,address,uint256)", p0, p1, p2)); + } + + function log(string memory p0, address p1, string memory p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,address,string)", p0, p1, p2)); + } + + function log(string memory p0, address p1, bool p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,address,bool)", p0, p1, p2)); + } + + function log(string memory p0, address p1, address p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,address,address)", p0, p1, p2)); + } + + function log(bool p0, uint256 p1, uint256 p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,uint256)", p0, p1, p2)); + } + + function log(bool p0, uint256 p1, string memory p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,string)", p0, p1, p2)); + } + + function log(bool p0, uint256 p1, bool p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,bool)", p0, p1, p2)); + } + + function log(bool p0, uint256 p1, address p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,address)", p0, p1, p2)); + } + + function log(bool p0, string memory p1, uint256 p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint256)", p0, p1, p2)); + } + + function log(bool p0, string memory p1, string memory p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,string)", p0, p1, p2)); + } + + function log(bool p0, string memory p1, bool p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool)", p0, p1, p2)); + } + + function log(bool p0, string memory p1, address p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,address)", p0, p1, p2)); + } + + function log(bool p0, bool p1, uint256 p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint256)", p0, p1, p2)); + } + + function log(bool p0, bool p1, string memory p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string)", p0, p1, p2)); + } + + function log(bool p0, bool p1, bool p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool)", p0, p1, p2)); + } + + function log(bool p0, bool p1, address p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address)", p0, p1, p2)); + } + + function log(bool p0, address p1, uint256 p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint256)", p0, p1, p2)); + } + + function log(bool p0, address p1, string memory p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,string)", p0, p1, p2)); + } + + function log(bool p0, address p1, bool p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool)", p0, p1, p2)); + } + + function log(bool p0, address p1, address p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,address)", p0, p1, p2)); + } + + function log(address p0, uint256 p1, uint256 p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,uint256,uint256)", p0, p1, p2)); + } + + function log(address p0, uint256 p1, string memory p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,uint256,string)", p0, p1, p2)); + } + + function log(address p0, uint256 p1, bool p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,uint256,bool)", p0, p1, p2)); + } + + function log(address p0, uint256 p1, address p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,uint256,address)", p0, p1, p2)); + } + + function log(address p0, string memory p1, uint256 p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,string,uint256)", p0, p1, p2)); + } + + function log(address p0, string memory p1, string memory p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,string,string)", p0, p1, p2)); + } + + function log(address p0, string memory p1, bool p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,string,bool)", p0, p1, p2)); + } + + function log(address p0, string memory p1, address p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,string,address)", p0, p1, p2)); + } + + function log(address p0, bool p1, uint256 p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint256)", p0, p1, p2)); + } + + function log(address p0, bool p1, string memory p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,string)", p0, p1, p2)); + } + + function log(address p0, bool p1, bool p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool)", p0, p1, p2)); + } + + function log(address p0, bool p1, address p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,address)", p0, p1, p2)); + } + + function log(address p0, address p1, uint256 p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,address,uint256)", p0, p1, p2)); + } + + function log(address p0, address p1, string memory p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,address,string)", p0, p1, p2)); + } + + function log(address p0, address p1, bool p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,address,bool)", p0, p1, p2)); + } + + function log(address p0, address p1, address p2) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,address,address)", p0, p1, p2)); + } + + function log(uint256 p0, uint256 p1, uint256 p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,uint256,uint256)", p0, p1, p2, p3)); + } + + function log(uint256 p0, uint256 p1, uint256 p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,uint256,string)", p0, p1, p2, p3)); + } + + function log(uint256 p0, uint256 p1, uint256 p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,uint256,bool)", p0, p1, p2, p3)); + } + + function log(uint256 p0, uint256 p1, uint256 p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,uint256,address)", p0, p1, p2, p3)); + } + + function log(uint256 p0, uint256 p1, string memory p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,string,uint256)", p0, p1, p2, p3)); + } + + function log(uint256 p0, uint256 p1, string memory p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,string,string)", p0, p1, p2, p3)); + } + + function log(uint256 p0, uint256 p1, string memory p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,string,bool)", p0, p1, p2, p3)); + } + + function log(uint256 p0, uint256 p1, string memory p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,string,address)", p0, p1, p2, p3)); + } + + function log(uint256 p0, uint256 p1, bool p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,bool,uint256)", p0, p1, p2, p3)); + } + + function log(uint256 p0, uint256 p1, bool p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,bool,string)", p0, p1, p2, p3)); + } + + function log(uint256 p0, uint256 p1, bool p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,bool,bool)", p0, p1, p2, p3)); + } + + function log(uint256 p0, uint256 p1, bool p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,bool,address)", p0, p1, p2, p3)); + } + + function log(uint256 p0, uint256 p1, address p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,address,uint256)", p0, p1, p2, p3)); + } + + function log(uint256 p0, uint256 p1, address p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,address,string)", p0, p1, p2, p3)); + } + + function log(uint256 p0, uint256 p1, address p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,address,bool)", p0, p1, p2, p3)); + } + + function log(uint256 p0, uint256 p1, address p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,address,address)", p0, p1, p2, p3)); + } + + function log(uint256 p0, string memory p1, uint256 p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,string,uint256,uint256)", p0, p1, p2, p3)); + } + + function log(uint256 p0, string memory p1, uint256 p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,string,uint256,string)", p0, p1, p2, p3)); + } + + function log(uint256 p0, string memory p1, uint256 p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,string,uint256,bool)", p0, p1, p2, p3)); + } + + function log(uint256 p0, string memory p1, uint256 p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,string,uint256,address)", p0, p1, p2, p3)); + } + + function log(uint256 p0, string memory p1, string memory p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,string,string,uint256)", p0, p1, p2, p3)); + } + + function log(uint256 p0, string memory p1, string memory p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,string,string,string)", p0, p1, p2, p3)); + } + + function log(uint256 p0, string memory p1, string memory p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,string,string,bool)", p0, p1, p2, p3)); + } + + function log(uint256 p0, string memory p1, string memory p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,string,string,address)", p0, p1, p2, p3)); + } + + function log(uint256 p0, string memory p1, bool p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,string,bool,uint256)", p0, p1, p2, p3)); + } + + function log(uint256 p0, string memory p1, bool p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,string,bool,string)", p0, p1, p2, p3)); + } + + function log(uint256 p0, string memory p1, bool p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,string,bool,bool)", p0, p1, p2, p3)); + } + + function log(uint256 p0, string memory p1, bool p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,string,bool,address)", p0, p1, p2, p3)); + } + + function log(uint256 p0, string memory p1, address p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,string,address,uint256)", p0, p1, p2, p3)); + } + + function log(uint256 p0, string memory p1, address p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,string,address,string)", p0, p1, p2, p3)); + } + + function log(uint256 p0, string memory p1, address p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,string,address,bool)", p0, p1, p2, p3)); + } + + function log(uint256 p0, string memory p1, address p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,string,address,address)", p0, p1, p2, p3)); + } + + function log(uint256 p0, bool p1, uint256 p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,uint256,uint256)", p0, p1, p2, p3)); + } + + function log(uint256 p0, bool p1, uint256 p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,uint256,string)", p0, p1, p2, p3)); + } + + function log(uint256 p0, bool p1, uint256 p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,uint256,bool)", p0, p1, p2, p3)); + } + + function log(uint256 p0, bool p1, uint256 p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,uint256,address)", p0, p1, p2, p3)); + } + + function log(uint256 p0, bool p1, string memory p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,string,uint256)", p0, p1, p2, p3)); + } + + function log(uint256 p0, bool p1, string memory p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,string,string)", p0, p1, p2, p3)); + } + + function log(uint256 p0, bool p1, string memory p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,string,bool)", p0, p1, p2, p3)); + } + + function log(uint256 p0, bool p1, string memory p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,string,address)", p0, p1, p2, p3)); + } + + function log(uint256 p0, bool p1, bool p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,bool,uint256)", p0, p1, p2, p3)); + } + + function log(uint256 p0, bool p1, bool p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,bool,string)", p0, p1, p2, p3)); + } + + function log(uint256 p0, bool p1, bool p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,bool,bool)", p0, p1, p2, p3)); + } + + function log(uint256 p0, bool p1, bool p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,bool,address)", p0, p1, p2, p3)); + } + + function log(uint256 p0, bool p1, address p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,address,uint256)", p0, p1, p2, p3)); + } + + function log(uint256 p0, bool p1, address p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,address,string)", p0, p1, p2, p3)); + } + + function log(uint256 p0, bool p1, address p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,address,bool)", p0, p1, p2, p3)); + } + + function log(uint256 p0, bool p1, address p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,address,address)", p0, p1, p2, p3)); + } + + function log(uint256 p0, address p1, uint256 p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,address,uint256,uint256)", p0, p1, p2, p3)); + } + + function log(uint256 p0, address p1, uint256 p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,address,uint256,string)", p0, p1, p2, p3)); + } + + function log(uint256 p0, address p1, uint256 p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,address,uint256,bool)", p0, p1, p2, p3)); + } + + function log(uint256 p0, address p1, uint256 p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,address,uint256,address)", p0, p1, p2, p3)); + } + + function log(uint256 p0, address p1, string memory p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,address,string,uint256)", p0, p1, p2, p3)); + } + + function log(uint256 p0, address p1, string memory p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,address,string,string)", p0, p1, p2, p3)); + } + + function log(uint256 p0, address p1, string memory p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,address,string,bool)", p0, p1, p2, p3)); + } + + function log(uint256 p0, address p1, string memory p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,address,string,address)", p0, p1, p2, p3)); + } + + function log(uint256 p0, address p1, bool p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,address,bool,uint256)", p0, p1, p2, p3)); + } + + function log(uint256 p0, address p1, bool p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,address,bool,string)", p0, p1, p2, p3)); + } + + function log(uint256 p0, address p1, bool p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,address,bool,bool)", p0, p1, p2, p3)); + } + + function log(uint256 p0, address p1, bool p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,address,bool,address)", p0, p1, p2, p3)); + } + + function log(uint256 p0, address p1, address p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,address,address,uint256)", p0, p1, p2, p3)); + } + + function log(uint256 p0, address p1, address p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,address,address,string)", p0, p1, p2, p3)); + } + + function log(uint256 p0, address p1, address p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,address,address,bool)", p0, p1, p2, p3)); + } + + function log(uint256 p0, address p1, address p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(uint256,address,address,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint256 p1, uint256 p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,uint256,uint256,uint256)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint256 p1, uint256 p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,uint256,uint256,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint256 p1, uint256 p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,uint256,uint256,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint256 p1, uint256 p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,uint256,uint256,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint256 p1, string memory p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,uint256,string,uint256)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint256 p1, string memory p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,uint256,string,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint256 p1, string memory p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,uint256,string,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint256 p1, string memory p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,uint256,string,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint256 p1, bool p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,uint256,bool,uint256)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint256 p1, bool p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,uint256,bool,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint256 p1, bool p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,uint256,bool,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint256 p1, bool p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,uint256,bool,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint256 p1, address p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,uint256,address,uint256)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint256 p1, address p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,uint256,address,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint256 p1, address p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,uint256,address,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint256 p1, address p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,uint256,address,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, uint256 p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,string,uint256,uint256)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, uint256 p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,string,uint256,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, uint256 p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,string,uint256,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, uint256 p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,string,uint256,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, string memory p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,string,string,uint256)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, string memory p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,string,string,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, string memory p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,string,string,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, string memory p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,string,string,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, bool p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,uint256)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, bool p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, bool p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, bool p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, address p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,string,address,uint256)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, address p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,string,address,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, address p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,string,address,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, address p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,string,address,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, uint256 p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint256,uint256)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, uint256 p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint256,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, uint256 p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint256,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, uint256 p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint256,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, string memory p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,uint256)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, string memory p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, string memory p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, string memory p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, bool p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,uint256)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, bool p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, bool p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, bool p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, address p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,uint256)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, address p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, address p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, address p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, uint256 p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,address,uint256,uint256)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, uint256 p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,address,uint256,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, uint256 p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,address,uint256,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, uint256 p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,address,uint256,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, string memory p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,address,string,uint256)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, string memory p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,address,string,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, string memory p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,address,string,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, string memory p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,address,string,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, bool p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,uint256)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, bool p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, bool p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, bool p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, address p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,address,address,uint256)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, address p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,address,address,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, address p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,address,address,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, address p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(string,address,address,address)", p0, p1, p2, p3)); + } + + function log(bool p0, uint256 p1, uint256 p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,uint256,uint256)", p0, p1, p2, p3)); + } + + function log(bool p0, uint256 p1, uint256 p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,uint256,string)", p0, p1, p2, p3)); + } + + function log(bool p0, uint256 p1, uint256 p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,uint256,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, uint256 p1, uint256 p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,uint256,address)", p0, p1, p2, p3)); + } + + function log(bool p0, uint256 p1, string memory p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,string,uint256)", p0, p1, p2, p3)); + } + + function log(bool p0, uint256 p1, string memory p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,string,string)", p0, p1, p2, p3)); + } + + function log(bool p0, uint256 p1, string memory p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,string,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, uint256 p1, string memory p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,string,address)", p0, p1, p2, p3)); + } + + function log(bool p0, uint256 p1, bool p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,bool,uint256)", p0, p1, p2, p3)); + } + + function log(bool p0, uint256 p1, bool p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,bool,string)", p0, p1, p2, p3)); + } + + function log(bool p0, uint256 p1, bool p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,bool,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, uint256 p1, bool p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,bool,address)", p0, p1, p2, p3)); + } + + function log(bool p0, uint256 p1, address p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,address,uint256)", p0, p1, p2, p3)); + } + + function log(bool p0, uint256 p1, address p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,address,string)", p0, p1, p2, p3)); + } + + function log(bool p0, uint256 p1, address p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,address,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, uint256 p1, address p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,address,address)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, uint256 p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint256,uint256)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, uint256 p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint256,string)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, uint256 p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint256,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, uint256 p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint256,address)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, string memory p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,uint256)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, string memory p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,string)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, string memory p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, string memory p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,address)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, bool p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,uint256)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, bool p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,string)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, bool p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, bool p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,address)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, address p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,uint256)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, address p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,string)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, address p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, address p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,address)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, uint256 p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint256,uint256)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, uint256 p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint256,string)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, uint256 p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint256,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, uint256 p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint256,address)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, string memory p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,uint256)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, string memory p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,string)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, string memory p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, string memory p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,address)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, bool p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,uint256)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, bool p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,string)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, bool p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, bool p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,address)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, address p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,uint256)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, address p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,string)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, address p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, address p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,address)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, uint256 p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint256,uint256)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, uint256 p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint256,string)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, uint256 p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint256,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, uint256 p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint256,address)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, string memory p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,uint256)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, string memory p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,string)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, string memory p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, string memory p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,address)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, bool p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,uint256)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, bool p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,string)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, bool p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, bool p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,address)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, address p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,uint256)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, address p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,string)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, address p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, address p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,address)", p0, p1, p2, p3)); + } + + function log(address p0, uint256 p1, uint256 p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,uint256,uint256,uint256)", p0, p1, p2, p3)); + } + + function log(address p0, uint256 p1, uint256 p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,uint256,uint256,string)", p0, p1, p2, p3)); + } + + function log(address p0, uint256 p1, uint256 p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,uint256,uint256,bool)", p0, p1, p2, p3)); + } + + function log(address p0, uint256 p1, uint256 p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,uint256,uint256,address)", p0, p1, p2, p3)); + } + + function log(address p0, uint256 p1, string memory p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,uint256,string,uint256)", p0, p1, p2, p3)); + } + + function log(address p0, uint256 p1, string memory p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,uint256,string,string)", p0, p1, p2, p3)); + } + + function log(address p0, uint256 p1, string memory p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,uint256,string,bool)", p0, p1, p2, p3)); + } + + function log(address p0, uint256 p1, string memory p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,uint256,string,address)", p0, p1, p2, p3)); + } + + function log(address p0, uint256 p1, bool p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,uint256,bool,uint256)", p0, p1, p2, p3)); + } + + function log(address p0, uint256 p1, bool p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,uint256,bool,string)", p0, p1, p2, p3)); + } + + function log(address p0, uint256 p1, bool p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,uint256,bool,bool)", p0, p1, p2, p3)); + } + + function log(address p0, uint256 p1, bool p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,uint256,bool,address)", p0, p1, p2, p3)); + } + + function log(address p0, uint256 p1, address p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,uint256,address,uint256)", p0, p1, p2, p3)); + } + + function log(address p0, uint256 p1, address p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,uint256,address,string)", p0, p1, p2, p3)); + } + + function log(address p0, uint256 p1, address p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,uint256,address,bool)", p0, p1, p2, p3)); + } + + function log(address p0, uint256 p1, address p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,uint256,address,address)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, uint256 p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,string,uint256,uint256)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, uint256 p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,string,uint256,string)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, uint256 p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,string,uint256,bool)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, uint256 p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,string,uint256,address)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, string memory p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,string,string,uint256)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, string memory p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,string,string,string)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, string memory p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,string,string,bool)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, string memory p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,string,string,address)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, bool p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,uint256)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, bool p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,string)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, bool p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,bool)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, bool p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,address)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, address p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,string,address,uint256)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, address p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,string,address,string)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, address p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,string,address,bool)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, address p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,string,address,address)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, uint256 p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint256,uint256)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, uint256 p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint256,string)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, uint256 p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint256,bool)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, uint256 p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint256,address)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, string memory p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,uint256)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, string memory p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,string)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, string memory p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,bool)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, string memory p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,address)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, bool p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,uint256)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, bool p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,string)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, bool p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,bool)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, bool p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,address)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, address p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,uint256)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, address p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,string)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, address p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,bool)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, address p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,address)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, uint256 p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,address,uint256,uint256)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, uint256 p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,address,uint256,string)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, uint256 p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,address,uint256,bool)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, uint256 p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,address,uint256,address)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, string memory p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,address,string,uint256)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, string memory p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,address,string,string)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, string memory p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,address,string,bool)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, string memory p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,address,string,address)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, bool p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,uint256)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, bool p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,string)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, bool p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,bool)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, bool p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,address)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, address p2, uint256 p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,address,address,uint256)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, address p2, string memory p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,address,address,string)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, address p2, bool p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,address,address,bool)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, address p2, address p3) internal pure { + _sendLogPayload(abi.encodeWithSignature("log(address,address,address,address)", p0, p1, p2, p3)); + } + +} \ No newline at end of file diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/src/interfaces/IERC1155.sol b/harness/solidity_sized_tx_contract/lib/forge-std/src/interfaces/IERC1155.sol new file mode 100644 index 00000000..f7dd2b41 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/src/interfaces/IERC1155.sol @@ -0,0 +1,105 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.2; + +import "./IERC165.sol"; + +/// @title ERC-1155 Multi Token Standard +/// @dev See https://eips.ethereum.org/EIPS/eip-1155 +/// Note: The ERC-165 identifier for this interface is 0xd9b67a26. +interface IERC1155 is IERC165 { + /// @dev + /// - Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard). + /// - The `_operator` argument MUST be the address of an account/contract that is approved to make the transfer (SHOULD be msg.sender). + /// - The `_from` argument MUST be the address of the holder whose balance is decreased. + /// - The `_to` argument MUST be the address of the recipient whose balance is increased. + /// - The `_id` argument MUST be the token type being transferred. + /// - The `_value` argument MUST be the number of tokens the holder balance is decreased by and match what the recipient balance is increased by. + /// - When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address). + /// - When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address). + event TransferSingle( + address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _value + ); + + /// @dev + /// - Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard). + /// - The `_operator` argument MUST be the address of an account/contract that is approved to make the transfer (SHOULD be msg.sender). + /// - The `_from` argument MUST be the address of the holder whose balance is decreased. + /// - The `_to` argument MUST be the address of the recipient whose balance is increased. + /// - The `_ids` argument MUST be the list of tokens being transferred. + /// - The `_values` argument MUST be the list of number of tokens (matching the list and order of tokens specified in _ids) the holder balance is decreased by and match what the recipient balance is increased by. + /// - When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address). + /// - When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address). + event TransferBatch( + address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _values + ); + + /// @dev MUST emit when approval for a second party/operator address to manage all tokens for an owner address is enabled or disabled (absence of an event assumes disabled). + event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); + + /// @dev MUST emit when the URI is updated for a token ID. URIs are defined in RFC 3986. + /// The URI MUST point to a JSON file that conforms to the "ERC-1155 Metadata URI JSON Schema". + event URI(string _value, uint256 indexed _id); + + /// @notice Transfers `_value` amount of an `_id` from the `_from` address to the `_to` address specified (with safety call). + /// @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard). + /// - MUST revert if `_to` is the zero address. + /// - MUST revert if balance of holder for token `_id` is lower than the `_value` sent. + /// - MUST revert on any other error. + /// - MUST emit the `TransferSingle` event to reflect the balance change (see "Safe Transfer Rules" section of the standard). + /// - After the above conditions are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call `onERC1155Received` on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard). + /// @param _from Source address + /// @param _to Target address + /// @param _id ID of the token type + /// @param _value Transfer amount + /// @param _data Additional data with no specified format, MUST be sent unaltered in call to `onERC1155Received` on `_to` + function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _value, bytes calldata _data) external; + + /// @notice Transfers `_values` amount(s) of `_ids` from the `_from` address to the `_to` address specified (with safety call). + /// @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard). + /// - MUST revert if `_to` is the zero address. + /// - MUST revert if length of `_ids` is not the same as length of `_values`. + /// - MUST revert if any of the balance(s) of the holder(s) for token(s) in `_ids` is lower than the respective amount(s) in `_values` sent to the recipient. + /// - MUST revert on any other error. + /// - MUST emit `TransferSingle` or `TransferBatch` event(s) such that all the balance changes are reflected (see "Safe Transfer Rules" section of the standard). + /// - Balance changes and events MUST follow the ordering of the arrays (_ids[0]/_values[0] before _ids[1]/_values[1], etc). + /// - After the above conditions for the transfer(s) in the batch are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call the relevant `ERC1155TokenReceiver` hook(s) on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard). + /// @param _from Source address + /// @param _to Target address + /// @param _ids IDs of each token type (order and length must match _values array) + /// @param _values Transfer amounts per token type (order and length must match _ids array) + /// @param _data Additional data with no specified format, MUST be sent unaltered in call to the `ERC1155TokenReceiver` hook(s) on `_to` + function safeBatchTransferFrom( + address _from, + address _to, + uint256[] calldata _ids, + uint256[] calldata _values, + bytes calldata _data + ) external; + + /// @notice Get the balance of an account's tokens. + /// @param _owner The address of the token holder + /// @param _id ID of the token + /// @return The _owner's balance of the token type requested + function balanceOf(address _owner, uint256 _id) external view returns (uint256); + + /// @notice Get the balance of multiple account/token pairs + /// @param _owners The addresses of the token holders + /// @param _ids ID of the tokens + /// @return The _owner's balance of the token types requested (i.e. balance for each (owner, id) pair) + function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) + external + view + returns (uint256[] memory); + + /// @notice Enable or disable approval for a third party ("operator") to manage all of the caller's tokens. + /// @dev MUST emit the ApprovalForAll event on success. + /// @param _operator Address to add to the set of authorized operators + /// @param _approved True if the operator is approved, false to revoke approval + function setApprovalForAll(address _operator, bool _approved) external; + + /// @notice Queries the approval status of an operator for a given owner. + /// @param _owner The owner of the tokens + /// @param _operator Address of authorized operator + /// @return True if the operator is approved, false if not + function isApprovedForAll(address _owner, address _operator) external view returns (bool); +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/src/interfaces/IERC165.sol b/harness/solidity_sized_tx_contract/lib/forge-std/src/interfaces/IERC165.sol new file mode 100644 index 00000000..9af4bf80 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/src/interfaces/IERC165.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.2; + +interface IERC165 { + /// @notice Query if a contract implements an interface + /// @param interfaceID The interface identifier, as specified in ERC-165 + /// @dev Interface identification is specified in ERC-165. This function + /// uses less than 30,000 gas. + /// @return `true` if the contract implements `interfaceID` and + /// `interfaceID` is not 0xffffffff, `false` otherwise + function supportsInterface(bytes4 interfaceID) external view returns (bool); +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/src/interfaces/IERC20.sol b/harness/solidity_sized_tx_contract/lib/forge-std/src/interfaces/IERC20.sol new file mode 100644 index 00000000..ba40806c --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/src/interfaces/IERC20.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.2; + +/// @dev Interface of the ERC20 standard as defined in the EIP. +/// @dev This includes the optional name, symbol, and decimals metadata. +interface IERC20 { + /// @dev Emitted when `value` tokens are moved from one account (`from`) to another (`to`). + event Transfer(address indexed from, address indexed to, uint256 value); + + /// @dev Emitted when the allowance of a `spender` for an `owner` is set, where `value` + /// is the new allowance. + event Approval(address indexed owner, address indexed spender, uint256 value); + + /// @notice Returns the amount of tokens in existence. + function totalSupply() external view returns (uint256); + + /// @notice Returns the amount of tokens owned by `account`. + function balanceOf(address account) external view returns (uint256); + + /// @notice Moves `amount` tokens from the caller's account to `to`. + function transfer(address to, uint256 amount) external returns (bool); + + /// @notice Returns the remaining number of tokens that `spender` is allowed + /// to spend on behalf of `owner` + function allowance(address owner, address spender) external view returns (uint256); + + /// @notice Sets `amount` as the allowance of `spender` over the caller's tokens. + /// @dev Be aware of front-running risks: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 + function approve(address spender, uint256 amount) external returns (bool); + + /// @notice Moves `amount` tokens from `from` to `to` using the allowance mechanism. + /// `amount` is then deducted from the caller's allowance. + function transferFrom(address from, address to, uint256 amount) external returns (bool); + + /// @notice Returns the name of the token. + function name() external view returns (string memory); + + /// @notice Returns the symbol of the token. + function symbol() external view returns (string memory); + + /// @notice Returns the decimals places of the token. + function decimals() external view returns (uint8); +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/src/interfaces/IERC4626.sol b/harness/solidity_sized_tx_contract/lib/forge-std/src/interfaces/IERC4626.sol new file mode 100644 index 00000000..bfe3a115 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/src/interfaces/IERC4626.sol @@ -0,0 +1,190 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.2; + +import "./IERC20.sol"; + +/// @dev Interface of the ERC4626 "Tokenized Vault Standard", as defined in +/// https://eips.ethereum.org/EIPS/eip-4626 +interface IERC4626 is IERC20 { + event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares); + + event Withdraw( + address indexed sender, address indexed receiver, address indexed owner, uint256 assets, uint256 shares + ); + + /// @notice Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing. + /// @dev + /// - MUST be an ERC-20 token contract. + /// - MUST NOT revert. + function asset() external view returns (address assetTokenAddress); + + /// @notice Returns the total amount of the underlying asset that is “managed” by Vault. + /// @dev + /// - SHOULD include any compounding that occurs from yield. + /// - MUST be inclusive of any fees that are charged against assets in the Vault. + /// - MUST NOT revert. + function totalAssets() external view returns (uint256 totalManagedAssets); + + /// @notice Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal + /// scenario where all the conditions are met. + /// @dev + /// - MUST NOT be inclusive of any fees that are charged against assets in the Vault. + /// - MUST NOT show any variations depending on the caller. + /// - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange. + /// - MUST NOT revert. + /// + /// NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the + /// “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and + /// from. + function convertToShares(uint256 assets) external view returns (uint256 shares); + + /// @notice Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal + /// scenario where all the conditions are met. + /// @dev + /// - MUST NOT be inclusive of any fees that are charged against assets in the Vault. + /// - MUST NOT show any variations depending on the caller. + /// - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange. + /// - MUST NOT revert. + /// + /// NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the + /// “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and + /// from. + function convertToAssets(uint256 shares) external view returns (uint256 assets); + + /// @notice Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver, + /// through a deposit call. + /// @dev + /// - MUST return a limited value if receiver is subject to some deposit limit. + /// - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited. + /// - MUST NOT revert. + function maxDeposit(address receiver) external view returns (uint256 maxAssets); + + /// @notice Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given + /// current on-chain conditions. + /// @dev + /// - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit + /// call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called + /// in the same transaction. + /// - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the + /// deposit would be accepted, regardless if the user has enough tokens approved, etc. + /// - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees. + /// - MUST NOT revert. + /// + /// NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in + /// share price or some other type of condition, meaning the depositor will lose assets by depositing. + function previewDeposit(uint256 assets) external view returns (uint256 shares); + + /// @notice Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens. + /// @dev + /// - MUST emit the Deposit event. + /// - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the + /// deposit execution, and are accounted for during deposit. + /// - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not + /// approving enough underlying tokens to the Vault contract, etc). + /// + /// NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token. + function deposit(uint256 assets, address receiver) external returns (uint256 shares); + + /// @notice Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call. + /// @dev + /// - MUST return a limited value if receiver is subject to some mint limit. + /// - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted. + /// - MUST NOT revert. + function maxMint(address receiver) external view returns (uint256 maxShares); + + /// @notice Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given + /// current on-chain conditions. + /// @dev + /// - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call + /// in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the + /// same transaction. + /// - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint + /// would be accepted, regardless if the user has enough tokens approved, etc. + /// - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees. + /// - MUST NOT revert. + /// + /// NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in + /// share price or some other type of condition, meaning the depositor will lose assets by minting. + function previewMint(uint256 shares) external view returns (uint256 assets); + + /// @notice Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens. + /// @dev + /// - MUST emit the Deposit event. + /// - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint + /// execution, and are accounted for during mint. + /// - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not + /// approving enough underlying tokens to the Vault contract, etc). + /// + /// NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token. + function mint(uint256 shares, address receiver) external returns (uint256 assets); + + /// @notice Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the + /// Vault, through a withdraw call. + /// @dev + /// - MUST return a limited value if owner is subject to some withdrawal limit or timelock. + /// - MUST NOT revert. + function maxWithdraw(address owner) external view returns (uint256 maxAssets); + + /// @notice Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block, + /// given current on-chain conditions. + /// @dev + /// - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw + /// call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if + /// called + /// in the same transaction. + /// - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though + /// the withdrawal would be accepted, regardless if the user has enough shares, etc. + /// - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees. + /// - MUST NOT revert. + /// + /// NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in + /// share price or some other type of condition, meaning the depositor will lose assets by depositing. + function previewWithdraw(uint256 assets) external view returns (uint256 shares); + + /// @notice Burns shares from owner and sends exactly assets of underlying tokens to receiver. + /// @dev + /// - MUST emit the Withdraw event. + /// - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the + /// withdraw execution, and are accounted for during withdraw. + /// - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner + /// not having enough shares, etc). + /// + /// Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed. + /// Those methods should be performed separately. + function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares); + + /// @notice Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault, + /// through a redeem call. + /// @dev + /// - MUST return a limited value if owner is subject to some withdrawal limit or timelock. + /// - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock. + /// - MUST NOT revert. + function maxRedeem(address owner) external view returns (uint256 maxShares); + + /// @notice Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block, + /// given current on-chain conditions. + /// @dev + /// - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call + /// in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the + /// same transaction. + /// - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the + /// redemption would be accepted, regardless if the user has enough shares, etc. + /// - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees. + /// - MUST NOT revert. + /// + /// NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in + /// share price or some other type of condition, meaning the depositor will lose assets by redeeming. + function previewRedeem(uint256 shares) external view returns (uint256 assets); + + /// @notice Burns exactly shares from owner and sends assets of underlying tokens to receiver. + /// @dev + /// - MUST emit the Withdraw event. + /// - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the + /// redeem execution, and are accounted for during redeem. + /// - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner + /// not having enough shares, etc). + /// + /// NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed. + /// Those methods should be performed separately. + function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets); +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/src/interfaces/IERC721.sol b/harness/solidity_sized_tx_contract/lib/forge-std/src/interfaces/IERC721.sol new file mode 100644 index 00000000..0a16f45c --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/src/interfaces/IERC721.sol @@ -0,0 +1,164 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.2; + +import "./IERC165.sol"; + +/// @title ERC-721 Non-Fungible Token Standard +/// @dev See https://eips.ethereum.org/EIPS/eip-721 +/// Note: the ERC-165 identifier for this interface is 0x80ac58cd. +interface IERC721 is IERC165 { + /// @dev This emits when ownership of any NFT changes by any mechanism. + /// This event emits when NFTs are created (`from` == 0) and destroyed + /// (`to` == 0). Exception: during contract creation, any number of NFTs + /// may be created and assigned without emitting Transfer. At the time of + /// any transfer, the approved address for that NFT (if any) is reset to none. + event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId); + + /// @dev This emits when the approved address for an NFT is changed or + /// reaffirmed. The zero address indicates there is no approved address. + /// When a Transfer event emits, this also indicates that the approved + /// address for that NFT (if any) is reset to none. + event Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId); + + /// @dev This emits when an operator is enabled or disabled for an owner. + /// The operator can manage all NFTs of the owner. + event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); + + /// @notice Count all NFTs assigned to an owner + /// @dev NFTs assigned to the zero address are considered invalid, and this + /// function throws for queries about the zero address. + /// @param _owner An address for whom to query the balance + /// @return The number of NFTs owned by `_owner`, possibly zero + function balanceOf(address _owner) external view returns (uint256); + + /// @notice Find the owner of an NFT + /// @dev NFTs assigned to zero address are considered invalid, and queries + /// about them do throw. + /// @param _tokenId The identifier for an NFT + /// @return The address of the owner of the NFT + function ownerOf(uint256 _tokenId) external view returns (address); + + /// @notice Transfers the ownership of an NFT from one address to another address + /// @dev Throws unless `msg.sender` is the current owner, an authorized + /// operator, or the approved address for this NFT. Throws if `_from` is + /// not the current owner. Throws if `_to` is the zero address. Throws if + /// `_tokenId` is not a valid NFT. When transfer is complete, this function + /// checks if `_to` is a smart contract (code size > 0). If so, it calls + /// `onERC721Received` on `_to` and throws if the return value is not + /// `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`. + /// @param _from The current owner of the NFT + /// @param _to The new owner + /// @param _tokenId The NFT to transfer + /// @param data Additional data with no specified format, sent in call to `_to` + function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes calldata data) external payable; + + /// @notice Transfers the ownership of an NFT from one address to another address + /// @dev This works identically to the other function with an extra data parameter, + /// except this function just sets data to "". + /// @param _from The current owner of the NFT + /// @param _to The new owner + /// @param _tokenId The NFT to transfer + function safeTransferFrom(address _from, address _to, uint256 _tokenId) external payable; + + /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE + /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE + /// THEY MAY BE PERMANENTLY LOST + /// @dev Throws unless `msg.sender` is the current owner, an authorized + /// operator, or the approved address for this NFT. Throws if `_from` is + /// not the current owner. Throws if `_to` is the zero address. Throws if + /// `_tokenId` is not a valid NFT. + /// @param _from The current owner of the NFT + /// @param _to The new owner + /// @param _tokenId The NFT to transfer + function transferFrom(address _from, address _to, uint256 _tokenId) external payable; + + /// @notice Change or reaffirm the approved address for an NFT + /// @dev The zero address indicates there is no approved address. + /// Throws unless `msg.sender` is the current NFT owner, or an authorized + /// operator of the current owner. + /// @param _approved The new approved NFT controller + /// @param _tokenId The NFT to approve + function approve(address _approved, uint256 _tokenId) external payable; + + /// @notice Enable or disable approval for a third party ("operator") to manage + /// all of `msg.sender`'s assets + /// @dev Emits the ApprovalForAll event. The contract MUST allow + /// multiple operators per owner. + /// @param _operator Address to add to the set of authorized operators + /// @param _approved True if the operator is approved, false to revoke approval + function setApprovalForAll(address _operator, bool _approved) external; + + /// @notice Get the approved address for a single NFT + /// @dev Throws if `_tokenId` is not a valid NFT. + /// @param _tokenId The NFT to find the approved address for + /// @return The approved address for this NFT, or the zero address if there is none + function getApproved(uint256 _tokenId) external view returns (address); + + /// @notice Query if an address is an authorized operator for another address + /// @param _owner The address that owns the NFTs + /// @param _operator The address that acts on behalf of the owner + /// @return True if `_operator` is an approved operator for `_owner`, false otherwise + function isApprovedForAll(address _owner, address _operator) external view returns (bool); +} + +/// @dev Note: the ERC-165 identifier for this interface is 0x150b7a02. +interface IERC721TokenReceiver { + /// @notice Handle the receipt of an NFT + /// @dev The ERC721 smart contract calls this function on the recipient + /// after a `transfer`. This function MAY throw to revert and reject the + /// transfer. Return of other than the magic value MUST result in the + /// transaction being reverted. + /// Note: the contract address is always the message sender. + /// @param _operator The address which called `safeTransferFrom` function + /// @param _from The address which previously owned the token + /// @param _tokenId The NFT identifier which is being transferred + /// @param _data Additional data with no specified format + /// @return `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` + /// unless throwing + function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes calldata _data) + external + returns (bytes4); +} + +/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension +/// @dev See https://eips.ethereum.org/EIPS/eip-721 +/// Note: the ERC-165 identifier for this interface is 0x5b5e139f. +interface IERC721Metadata is IERC721 { + /// @notice A descriptive name for a collection of NFTs in this contract + function name() external view returns (string memory _name); + + /// @notice An abbreviated name for NFTs in this contract + function symbol() external view returns (string memory _symbol); + + /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. + /// @dev Throws if `_tokenId` is not a valid NFT. URIs are defined in RFC + /// 3986. The URI may point to a JSON file that conforms to the "ERC721 + /// Metadata JSON Schema". + function tokenURI(uint256 _tokenId) external view returns (string memory); +} + +/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension +/// @dev See https://eips.ethereum.org/EIPS/eip-721 +/// Note: the ERC-165 identifier for this interface is 0x780e9d63. +interface IERC721Enumerable is IERC721 { + /// @notice Count NFTs tracked by this contract + /// @return A count of valid NFTs tracked by this contract, where each one of + /// them has an assigned and queryable owner not equal to the zero address + function totalSupply() external view returns (uint256); + + /// @notice Enumerate valid NFTs + /// @dev Throws if `_index` >= `totalSupply()`. + /// @param _index A counter less than `totalSupply()` + /// @return The token identifier for the `_index`th NFT, + /// (sort order not specified) + function tokenByIndex(uint256 _index) external view returns (uint256); + + /// @notice Enumerate NFTs assigned to an owner + /// @dev Throws if `_index` >= `balanceOf(_owner)` or if + /// `_owner` is the zero address, representing invalid NFTs. + /// @param _owner An address where we are interested in NFTs owned by them + /// @param _index A counter less than `balanceOf(_owner)` + /// @return The token identifier for the `_index`th NFT assigned to `_owner`, + /// (sort order not specified) + function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256); +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/src/interfaces/IMulticall3.sol b/harness/solidity_sized_tx_contract/lib/forge-std/src/interfaces/IMulticall3.sol new file mode 100644 index 00000000..0d031b71 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/src/interfaces/IMulticall3.sol @@ -0,0 +1,73 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.2 <0.9.0; + +pragma experimental ABIEncoderV2; + +interface IMulticall3 { + struct Call { + address target; + bytes callData; + } + + struct Call3 { + address target; + bool allowFailure; + bytes callData; + } + + struct Call3Value { + address target; + bool allowFailure; + uint256 value; + bytes callData; + } + + struct Result { + bool success; + bytes returnData; + } + + function aggregate(Call[] calldata calls) + external + payable + returns (uint256 blockNumber, bytes[] memory returnData); + + function aggregate3(Call3[] calldata calls) external payable returns (Result[] memory returnData); + + function aggregate3Value(Call3Value[] calldata calls) external payable returns (Result[] memory returnData); + + function blockAndAggregate(Call[] calldata calls) + external + payable + returns (uint256 blockNumber, bytes32 blockHash, Result[] memory returnData); + + function getBasefee() external view returns (uint256 basefee); + + function getBlockHash(uint256 blockNumber) external view returns (bytes32 blockHash); + + function getBlockNumber() external view returns (uint256 blockNumber); + + function getChainId() external view returns (uint256 chainid); + + function getCurrentBlockCoinbase() external view returns (address coinbase); + + function getCurrentBlockDifficulty() external view returns (uint256 difficulty); + + function getCurrentBlockGasLimit() external view returns (uint256 gaslimit); + + function getCurrentBlockTimestamp() external view returns (uint256 timestamp); + + function getEthBalance(address addr) external view returns (uint256 balance); + + function getLastBlockHash() external view returns (bytes32 blockHash); + + function tryAggregate(bool requireSuccess, Call[] calldata calls) + external + payable + returns (Result[] memory returnData); + + function tryBlockAndAggregate(bool requireSuccess, Call[] calldata calls) + external + payable + returns (uint256 blockNumber, bytes32 blockHash, Result[] memory returnData); +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/src/mocks/MockERC20.sol b/harness/solidity_sized_tx_contract/lib/forge-std/src/mocks/MockERC20.sol new file mode 100644 index 00000000..6b825a09 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/src/mocks/MockERC20.sol @@ -0,0 +1,216 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.2 <0.9.0; + +/// @notice This is a mock contract of the ERC20 standard for testing purposes only, it SHOULD NOT be used in production. +/// @dev Forked from: https://github.com/transmissions11/solmate/blob/0384dbaaa4fcb5715738a9254a7c0a4cb62cf458/src/tokens/ERC20.sol +contract MockERC20 { + /*////////////////////////////////////////////////////////////// + EVENTS + //////////////////////////////////////////////////////////////*/ + + event Transfer(address indexed from, address indexed to, uint256 amount); + + event Approval(address indexed owner, address indexed spender, uint256 amount); + + /*////////////////////////////////////////////////////////////// + METADATA STORAGE + //////////////////////////////////////////////////////////////*/ + + string public name; + + string public symbol; + + uint8 public decimals; + + /*////////////////////////////////////////////////////////////// + ERC20 STORAGE + //////////////////////////////////////////////////////////////*/ + + uint256 public totalSupply; + + mapping(address => uint256) public balanceOf; + + mapping(address => mapping(address => uint256)) public allowance; + + /*////////////////////////////////////////////////////////////// + EIP-2612 STORAGE + //////////////////////////////////////////////////////////////*/ + + uint256 internal INITIAL_CHAIN_ID; + + bytes32 internal INITIAL_DOMAIN_SEPARATOR; + + mapping(address => uint256) public nonces; + + /*////////////////////////////////////////////////////////////// + INITIALIZE + //////////////////////////////////////////////////////////////*/ + + /// @dev A bool to track whether the contract has been initialized. + bool private initialized; + + /// @dev To hide constructor warnings across solc versions due to different constructor visibility requirements and + /// syntaxes, we add an initialization function that can be called only once. + function initialize(string memory _name, string memory _symbol, uint8 _decimals) public { + require(!initialized, "ALREADY_INITIALIZED"); + + name = _name; + symbol = _symbol; + decimals = _decimals; + + INITIAL_CHAIN_ID = _pureChainId(); + INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator(); + + initialized = true; + } + + /*////////////////////////////////////////////////////////////// + ERC20 LOGIC + //////////////////////////////////////////////////////////////*/ + + function approve(address spender, uint256 amount) public virtual returns (bool) { + allowance[msg.sender][spender] = amount; + + emit Approval(msg.sender, spender, amount); + + return true; + } + + function transfer(address to, uint256 amount) public virtual returns (bool) { + balanceOf[msg.sender] = _sub(balanceOf[msg.sender], amount); + balanceOf[to] = _add(balanceOf[to], amount); + + emit Transfer(msg.sender, to, amount); + + return true; + } + + function transferFrom(address from, address to, uint256 amount) public virtual returns (bool) { + uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals. + + if (allowed != ~uint256(0)) allowance[from][msg.sender] = _sub(allowed, amount); + + balanceOf[from] = _sub(balanceOf[from], amount); + balanceOf[to] = _add(balanceOf[to], amount); + + emit Transfer(from, to, amount); + + return true; + } + + /*////////////////////////////////////////////////////////////// + EIP-2612 LOGIC + //////////////////////////////////////////////////////////////*/ + + function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) + public + virtual + { + require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED"); + + address recoveredAddress = ecrecover( + keccak256( + abi.encodePacked( + "\x19\x01", + DOMAIN_SEPARATOR(), + keccak256( + abi.encode( + keccak256( + "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)" + ), + owner, + spender, + value, + nonces[owner]++, + deadline + ) + ) + ) + ), + v, + r, + s + ); + + require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER"); + + allowance[recoveredAddress][spender] = value; + + emit Approval(owner, spender, value); + } + + function DOMAIN_SEPARATOR() public view virtual returns (bytes32) { + return _pureChainId() == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator(); + } + + function computeDomainSeparator() internal view virtual returns (bytes32) { + return keccak256( + abi.encode( + keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), + keccak256(bytes(name)), + keccak256("1"), + _pureChainId(), + address(this) + ) + ); + } + + /*////////////////////////////////////////////////////////////// + INTERNAL MINT/BURN LOGIC + //////////////////////////////////////////////////////////////*/ + + function _mint(address to, uint256 amount) internal virtual { + totalSupply = _add(totalSupply, amount); + balanceOf[to] = _add(balanceOf[to], amount); + + emit Transfer(address(0), to, amount); + } + + function _burn(address from, uint256 amount) internal virtual { + balanceOf[from] = _sub(balanceOf[from], amount); + totalSupply = _sub(totalSupply, amount); + + emit Transfer(from, address(0), amount); + } + + /*////////////////////////////////////////////////////////////// + INTERNAL SAFE MATH LOGIC + //////////////////////////////////////////////////////////////*/ + + function _add(uint256 a, uint256 b) internal pure returns (uint256) { + uint256 c = a + b; + require(c >= a, "ERC20: addition overflow"); + return c; + } + + function _sub(uint256 a, uint256 b) internal pure returns (uint256) { + require(a >= b, "ERC20: subtraction underflow"); + return a - b; + } + + /*////////////////////////////////////////////////////////////// + HELPERS + //////////////////////////////////////////////////////////////*/ + + // We use this complex approach of `_viewChainId` and `_pureChainId` to ensure there are no + // compiler warnings when accessing chain ID in any solidity version supported by forge-std. We + // can't simply access the chain ID in a normal view or pure function because the solc View Pure + // Checker changed `chainid` from pure to view in 0.8.0. + function _viewChainId() private view returns (uint256 chainId) { + // Assembly required since `block.chainid` was introduced in 0.8.0. + assembly { + chainId := chainid() + } + + address(this); // Silence warnings in older Solc versions. + } + + function _pureChainId() private pure returns (uint256 chainId) { + function() internal view returns (uint256) fnIn = _viewChainId; + function() internal pure returns (uint256) pureChainId; + assembly { + pureChainId := fnIn + } + chainId = pureChainId(); + } +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/src/mocks/MockERC721.sol b/harness/solidity_sized_tx_contract/lib/forge-std/src/mocks/MockERC721.sol new file mode 100644 index 00000000..75840874 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/src/mocks/MockERC721.sol @@ -0,0 +1,221 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.2 <0.9.0; + +/// @notice This is a mock contract of the ERC721 standard for testing purposes only, it SHOULD NOT be used in production. +/// @dev Forked from: https://github.com/transmissions11/solmate/blob/0384dbaaa4fcb5715738a9254a7c0a4cb62cf458/src/tokens/ERC721.sol +contract MockERC721 { + /*////////////////////////////////////////////////////////////// + EVENTS + //////////////////////////////////////////////////////////////*/ + + event Transfer(address indexed from, address indexed to, uint256 indexed id); + + event Approval(address indexed owner, address indexed spender, uint256 indexed id); + + event ApprovalForAll(address indexed owner, address indexed operator, bool approved); + + /*////////////////////////////////////////////////////////////// + METADATA STORAGE/LOGIC + //////////////////////////////////////////////////////////////*/ + + string public name; + + string public symbol; + + function tokenURI(uint256 id) public view virtual returns (string memory) {} + + /*////////////////////////////////////////////////////////////// + ERC721 BALANCE/OWNER STORAGE + //////////////////////////////////////////////////////////////*/ + + mapping(uint256 => address) internal _ownerOf; + + mapping(address => uint256) internal _balanceOf; + + function ownerOf(uint256 id) public view virtual returns (address owner) { + require((owner = _ownerOf[id]) != address(0), "NOT_MINTED"); + } + + function balanceOf(address owner) public view virtual returns (uint256) { + require(owner != address(0), "ZERO_ADDRESS"); + + return _balanceOf[owner]; + } + + /*////////////////////////////////////////////////////////////// + ERC721 APPROVAL STORAGE + //////////////////////////////////////////////////////////////*/ + + mapping(uint256 => address) public getApproved; + + mapping(address => mapping(address => bool)) public isApprovedForAll; + + /*////////////////////////////////////////////////////////////// + INITIALIZE + //////////////////////////////////////////////////////////////*/ + + /// @dev A bool to track whether the contract has been initialized. + bool private initialized; + + /// @dev To hide constructor warnings across solc versions due to different constructor visibility requirements and + /// syntaxes, we add an initialization function that can be called only once. + function initialize(string memory _name, string memory _symbol) public { + require(!initialized, "ALREADY_INITIALIZED"); + + name = _name; + symbol = _symbol; + + initialized = true; + } + + /*////////////////////////////////////////////////////////////// + ERC721 LOGIC + //////////////////////////////////////////////////////////////*/ + + function approve(address spender, uint256 id) public virtual { + address owner = _ownerOf[id]; + + require(msg.sender == owner || isApprovedForAll[owner][msg.sender], "NOT_AUTHORIZED"); + + getApproved[id] = spender; + + emit Approval(owner, spender, id); + } + + function setApprovalForAll(address operator, bool approved) public virtual { + isApprovedForAll[msg.sender][operator] = approved; + + emit ApprovalForAll(msg.sender, operator, approved); + } + + function transferFrom(address from, address to, uint256 id) public virtual { + require(from == _ownerOf[id], "WRONG_FROM"); + + require(to != address(0), "INVALID_RECIPIENT"); + + require( + msg.sender == from || isApprovedForAll[from][msg.sender] || msg.sender == getApproved[id], "NOT_AUTHORIZED" + ); + + // Underflow of the sender's balance is impossible because we check for + // ownership above and the recipient's balance can't realistically overflow. + _balanceOf[from]--; + + _balanceOf[to]++; + + _ownerOf[id] = to; + + delete getApproved[id]; + + emit Transfer(from, to, id); + } + + function safeTransferFrom(address from, address to, uint256 id) public virtual { + transferFrom(from, to, id); + + require( + !_isContract(to) + || IERC721TokenReceiver(to).onERC721Received(msg.sender, from, id, "") + == IERC721TokenReceiver.onERC721Received.selector, + "UNSAFE_RECIPIENT" + ); + } + + function safeTransferFrom(address from, address to, uint256 id, bytes memory data) public virtual { + transferFrom(from, to, id); + + require( + !_isContract(to) + || IERC721TokenReceiver(to).onERC721Received(msg.sender, from, id, data) + == IERC721TokenReceiver.onERC721Received.selector, + "UNSAFE_RECIPIENT" + ); + } + + /*////////////////////////////////////////////////////////////// + ERC165 LOGIC + //////////////////////////////////////////////////////////////*/ + + function supportsInterface(bytes4 interfaceId) public pure virtual returns (bool) { + return interfaceId == 0x01ffc9a7 // ERC165 Interface ID for ERC165 + || interfaceId == 0x80ac58cd // ERC165 Interface ID for ERC721 + || interfaceId == 0x5b5e139f; // ERC165 Interface ID for ERC721Metadata + } + + /*////////////////////////////////////////////////////////////// + INTERNAL MINT/BURN LOGIC + //////////////////////////////////////////////////////////////*/ + + function _mint(address to, uint256 id) internal virtual { + require(to != address(0), "INVALID_RECIPIENT"); + + require(_ownerOf[id] == address(0), "ALREADY_MINTED"); + + // Counter overflow is incredibly unrealistic. + + _balanceOf[to]++; + + _ownerOf[id] = to; + + emit Transfer(address(0), to, id); + } + + function _burn(uint256 id) internal virtual { + address owner = _ownerOf[id]; + + require(owner != address(0), "NOT_MINTED"); + + _balanceOf[owner]--; + + delete _ownerOf[id]; + + delete getApproved[id]; + + emit Transfer(owner, address(0), id); + } + + /*////////////////////////////////////////////////////////////// + INTERNAL SAFE MINT LOGIC + //////////////////////////////////////////////////////////////*/ + + function _safeMint(address to, uint256 id) internal virtual { + _mint(to, id); + + require( + !_isContract(to) + || IERC721TokenReceiver(to).onERC721Received(msg.sender, address(0), id, "") + == IERC721TokenReceiver.onERC721Received.selector, + "UNSAFE_RECIPIENT" + ); + } + + function _safeMint(address to, uint256 id, bytes memory data) internal virtual { + _mint(to, id); + + require( + !_isContract(to) + || IERC721TokenReceiver(to).onERC721Received(msg.sender, address(0), id, data) + == IERC721TokenReceiver.onERC721Received.selector, + "UNSAFE_RECIPIENT" + ); + } + + /*////////////////////////////////////////////////////////////// + HELPERS + //////////////////////////////////////////////////////////////*/ + + function _isContract(address _addr) private view returns (bool) { + uint256 codeLength; + + // Assembly required for versions < 0.8.0 to check extcodesize. + assembly { + codeLength := extcodesize(_addr) + } + + return codeLength > 0; + } +} + +interface IERC721TokenReceiver { + function onERC721Received(address, address, uint256, bytes calldata) external returns (bytes4); +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/src/safeconsole.sol b/harness/solidity_sized_tx_contract/lib/forge-std/src/safeconsole.sol new file mode 100644 index 00000000..5714d090 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/src/safeconsole.sol @@ -0,0 +1,13248 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.2 <0.9.0; + +/// @author philogy +/// @dev Code generated automatically by script. +library safeconsole { + uint256 constant CONSOLE_ADDR = 0x000000000000000000000000000000000000000000636F6e736F6c652e6c6f67; + + // Credit to [0age](https://twitter.com/z0age/status/1654922202930888704) and [0xdapper](https://github.com/foundry-rs/forge-std/pull/374) + // for the view-to-pure log trick. + function _sendLogPayload(uint256 offset, uint256 size) private pure { + function(uint256, uint256) internal view fnIn = _sendLogPayloadView; + function(uint256, uint256) internal pure pureSendLogPayload; + assembly { + pureSendLogPayload := fnIn + } + pureSendLogPayload(offset, size); + } + + function _sendLogPayloadView(uint256 offset, uint256 size) private view { + assembly { + pop(staticcall(gas(), CONSOLE_ADDR, offset, size, 0x0, 0x0)) + } + } + + function _memcopy(uint256 fromOffset, uint256 toOffset, uint256 length) private pure { + function(uint256, uint256, uint256) internal view fnIn = _memcopyView; + function(uint256, uint256, uint256) internal pure pureMemcopy; + assembly { + pureMemcopy := fnIn + } + pureMemcopy(fromOffset, toOffset, length); + } + + function _memcopyView(uint256 fromOffset, uint256 toOffset, uint256 length) private view { + assembly { + pop(staticcall(gas(), 0x4, fromOffset, length, toOffset, length)) + } + } + + function logMemory(uint256 offset, uint256 length) internal pure { + if (offset >= 0x60) { + // Sufficient memory before slice to prepare call header. + bytes32 m0; + bytes32 m1; + bytes32 m2; + assembly { + m0 := mload(sub(offset, 0x60)) + m1 := mload(sub(offset, 0x40)) + m2 := mload(sub(offset, 0x20)) + // Selector of `logBytes(bytes)`. + mstore(sub(offset, 0x60), 0xe17bf956) + mstore(sub(offset, 0x40), 0x20) + mstore(sub(offset, 0x20), length) + } + _sendLogPayload(offset - 0x44, length + 0x44); + assembly { + mstore(sub(offset, 0x60), m0) + mstore(sub(offset, 0x40), m1) + mstore(sub(offset, 0x20), m2) + } + } else { + // Insufficient space, so copy slice forward, add header and reverse. + bytes32 m0; + bytes32 m1; + bytes32 m2; + uint256 endOffset = offset + length; + assembly { + m0 := mload(add(endOffset, 0x00)) + m1 := mload(add(endOffset, 0x20)) + m2 := mload(add(endOffset, 0x40)) + } + _memcopy(offset, offset + 0x60, length); + assembly { + // Selector of `logBytes(bytes)`. + mstore(add(offset, 0x00), 0xe17bf956) + mstore(add(offset, 0x20), 0x20) + mstore(add(offset, 0x40), length) + } + _sendLogPayload(offset + 0x1c, length + 0x44); + _memcopy(offset + 0x60, offset, length); + assembly { + mstore(add(endOffset, 0x00), m0) + mstore(add(endOffset, 0x20), m1) + mstore(add(endOffset, 0x40), m2) + } + } + } + + function log(address p0) internal pure { + bytes32 m0; + bytes32 m1; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + // Selector of `log(address)`. + mstore(0x00, 0x2c2ecbc2) + mstore(0x20, p0) + } + _sendLogPayload(0x1c, 0x24); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + } + } + + function log(bool p0) internal pure { + bytes32 m0; + bytes32 m1; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + // Selector of `log(bool)`. + mstore(0x00, 0x32458eed) + mstore(0x20, p0) + } + _sendLogPayload(0x1c, 0x24); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + } + } + + function log(uint256 p0) internal pure { + bytes32 m0; + bytes32 m1; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + // Selector of `log(uint256)`. + mstore(0x00, 0xf82c50f1) + mstore(0x20, p0) + } + _sendLogPayload(0x1c, 0x24); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + } + } + + function log(bytes32 p0) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(string)`. + mstore(0x00, 0x41304fac) + mstore(0x20, 0x20) + writeString(0x40, p0) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(address p0, address p1) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + // Selector of `log(address,address)`. + mstore(0x00, 0xdaf0d4aa) + mstore(0x20, p0) + mstore(0x40, p1) + } + _sendLogPayload(0x1c, 0x44); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + } + } + + function log(address p0, bool p1) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + // Selector of `log(address,bool)`. + mstore(0x00, 0x75b605d3) + mstore(0x20, p0) + mstore(0x40, p1) + } + _sendLogPayload(0x1c, 0x44); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + } + } + + function log(address p0, uint256 p1) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + // Selector of `log(address,uint256)`. + mstore(0x00, 0x8309e8a8) + mstore(0x20, p0) + mstore(0x40, p1) + } + _sendLogPayload(0x1c, 0x44); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + } + } + + function log(address p0, bytes32 p1) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,string)`. + mstore(0x00, 0x759f86bb) + mstore(0x20, p0) + mstore(0x40, 0x40) + writeString(0x60, p1) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, address p1) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + // Selector of `log(bool,address)`. + mstore(0x00, 0x853c4849) + mstore(0x20, p0) + mstore(0x40, p1) + } + _sendLogPayload(0x1c, 0x44); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + } + } + + function log(bool p0, bool p1) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + // Selector of `log(bool,bool)`. + mstore(0x00, 0x2a110e83) + mstore(0x20, p0) + mstore(0x40, p1) + } + _sendLogPayload(0x1c, 0x44); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + } + } + + function log(bool p0, uint256 p1) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + // Selector of `log(bool,uint256)`. + mstore(0x00, 0x399174d3) + mstore(0x20, p0) + mstore(0x40, p1) + } + _sendLogPayload(0x1c, 0x44); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + } + } + + function log(bool p0, bytes32 p1) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,string)`. + mstore(0x00, 0x8feac525) + mstore(0x20, p0) + mstore(0x40, 0x40) + writeString(0x60, p1) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, address p1) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + // Selector of `log(uint256,address)`. + mstore(0x00, 0x69276c86) + mstore(0x20, p0) + mstore(0x40, p1) + } + _sendLogPayload(0x1c, 0x44); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + } + } + + function log(uint256 p0, bool p1) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + // Selector of `log(uint256,bool)`. + mstore(0x00, 0x1c9d7eb3) + mstore(0x20, p0) + mstore(0x40, p1) + } + _sendLogPayload(0x1c, 0x44); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + } + } + + function log(uint256 p0, uint256 p1) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + // Selector of `log(uint256,uint256)`. + mstore(0x00, 0xf666715a) + mstore(0x20, p0) + mstore(0x40, p1) + } + _sendLogPayload(0x1c, 0x44); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + } + } + + function log(uint256 p0, bytes32 p1) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,string)`. + mstore(0x00, 0x643fd0df) + mstore(0x20, p0) + mstore(0x40, 0x40) + writeString(0x60, p1) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bytes32 p0, address p1) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(string,address)`. + mstore(0x00, 0x319af333) + mstore(0x20, 0x40) + mstore(0x40, p1) + writeString(0x60, p0) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bytes32 p0, bool p1) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(string,bool)`. + mstore(0x00, 0xc3b55635) + mstore(0x20, 0x40) + mstore(0x40, p1) + writeString(0x60, p0) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bytes32 p0, uint256 p1) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(string,uint256)`. + mstore(0x00, 0xb60e72cc) + mstore(0x20, 0x40) + mstore(0x40, p1) + writeString(0x60, p0) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bytes32 p0, bytes32 p1) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,string)`. + mstore(0x00, 0x4b5c4277) + mstore(0x20, 0x40) + mstore(0x40, 0x80) + writeString(0x60, p0) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, address p1, address p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(address,address,address)`. + mstore(0x00, 0x018c84c2) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(address p0, address p1, bool p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(address,address,bool)`. + mstore(0x00, 0xf2a66286) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(address p0, address p1, uint256 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(address,address,uint256)`. + mstore(0x00, 0x17fe6185) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(address p0, address p1, bytes32 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(address,address,string)`. + mstore(0x00, 0x007150be) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x60) + writeString(0x80, p2) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(address p0, bool p1, address p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(address,bool,address)`. + mstore(0x00, 0xf11699ed) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(address p0, bool p1, bool p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(address,bool,bool)`. + mstore(0x00, 0xeb830c92) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(address p0, bool p1, uint256 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(address,bool,uint256)`. + mstore(0x00, 0x9c4f99fb) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(address p0, bool p1, bytes32 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(address,bool,string)`. + mstore(0x00, 0x212255cc) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x60) + writeString(0x80, p2) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(address p0, uint256 p1, address p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(address,uint256,address)`. + mstore(0x00, 0x7bc0d848) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(address p0, uint256 p1, bool p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(address,uint256,bool)`. + mstore(0x00, 0x678209a8) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(address p0, uint256 p1, uint256 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(address,uint256,uint256)`. + mstore(0x00, 0xb69bcaf6) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(address p0, uint256 p1, bytes32 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(address,uint256,string)`. + mstore(0x00, 0xa1f2e8aa) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x60) + writeString(0x80, p2) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(address p0, bytes32 p1, address p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(address,string,address)`. + mstore(0x00, 0xf08744e8) + mstore(0x20, p0) + mstore(0x40, 0x60) + mstore(0x60, p2) + writeString(0x80, p1) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(address p0, bytes32 p1, bool p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(address,string,bool)`. + mstore(0x00, 0xcf020fb1) + mstore(0x20, p0) + mstore(0x40, 0x60) + mstore(0x60, p2) + writeString(0x80, p1) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(address p0, bytes32 p1, uint256 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(address,string,uint256)`. + mstore(0x00, 0x67dd6ff1) + mstore(0x20, p0) + mstore(0x40, 0x60) + mstore(0x60, p2) + writeString(0x80, p1) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(address p0, bytes32 p1, bytes32 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + // Selector of `log(address,string,string)`. + mstore(0x00, 0xfb772265) + mstore(0x20, p0) + mstore(0x40, 0x60) + mstore(0x60, 0xa0) + writeString(0x80, p1) + writeString(0xc0, p2) + } + _sendLogPayload(0x1c, 0xe4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + } + } + + function log(bool p0, address p1, address p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(bool,address,address)`. + mstore(0x00, 0xd2763667) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(bool p0, address p1, bool p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(bool,address,bool)`. + mstore(0x00, 0x18c9c746) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(bool p0, address p1, uint256 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(bool,address,uint256)`. + mstore(0x00, 0x5f7b9afb) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(bool p0, address p1, bytes32 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(bool,address,string)`. + mstore(0x00, 0xde9a9270) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x60) + writeString(0x80, p2) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(bool p0, bool p1, address p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(bool,bool,address)`. + mstore(0x00, 0x1078f68d) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(bool p0, bool p1, bool p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(bool,bool,bool)`. + mstore(0x00, 0x50709698) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(bool p0, bool p1, uint256 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(bool,bool,uint256)`. + mstore(0x00, 0x12f21602) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(bool p0, bool p1, bytes32 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(bool,bool,string)`. + mstore(0x00, 0x2555fa46) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x60) + writeString(0x80, p2) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(bool p0, uint256 p1, address p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(bool,uint256,address)`. + mstore(0x00, 0x088ef9d2) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(bool p0, uint256 p1, bool p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(bool,uint256,bool)`. + mstore(0x00, 0xe8defba9) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(bool p0, uint256 p1, uint256 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(bool,uint256,uint256)`. + mstore(0x00, 0x37103367) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(bool p0, uint256 p1, bytes32 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(bool,uint256,string)`. + mstore(0x00, 0xc3fc3970) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x60) + writeString(0x80, p2) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(bool p0, bytes32 p1, address p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(bool,string,address)`. + mstore(0x00, 0x9591b953) + mstore(0x20, p0) + mstore(0x40, 0x60) + mstore(0x60, p2) + writeString(0x80, p1) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(bool p0, bytes32 p1, bool p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(bool,string,bool)`. + mstore(0x00, 0xdbb4c247) + mstore(0x20, p0) + mstore(0x40, 0x60) + mstore(0x60, p2) + writeString(0x80, p1) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(bool p0, bytes32 p1, uint256 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(bool,string,uint256)`. + mstore(0x00, 0x1093ee11) + mstore(0x20, p0) + mstore(0x40, 0x60) + mstore(0x60, p2) + writeString(0x80, p1) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(bool p0, bytes32 p1, bytes32 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + // Selector of `log(bool,string,string)`. + mstore(0x00, 0xb076847f) + mstore(0x20, p0) + mstore(0x40, 0x60) + mstore(0x60, 0xa0) + writeString(0x80, p1) + writeString(0xc0, p2) + } + _sendLogPayload(0x1c, 0xe4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + } + } + + function log(uint256 p0, address p1, address p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(uint256,address,address)`. + mstore(0x00, 0xbcfd9be0) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(uint256 p0, address p1, bool p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(uint256,address,bool)`. + mstore(0x00, 0x9b6ec042) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(uint256 p0, address p1, uint256 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(uint256,address,uint256)`. + mstore(0x00, 0x5a9b5ed5) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(uint256 p0, address p1, bytes32 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(uint256,address,string)`. + mstore(0x00, 0x63cb41f9) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x60) + writeString(0x80, p2) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(uint256 p0, bool p1, address p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(uint256,bool,address)`. + mstore(0x00, 0x35085f7b) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(uint256 p0, bool p1, bool p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(uint256,bool,bool)`. + mstore(0x00, 0x20718650) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(uint256 p0, bool p1, uint256 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(uint256,bool,uint256)`. + mstore(0x00, 0x20098014) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(uint256 p0, bool p1, bytes32 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(uint256,bool,string)`. + mstore(0x00, 0x85775021) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x60) + writeString(0x80, p2) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(uint256 p0, uint256 p1, address p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(uint256,uint256,address)`. + mstore(0x00, 0x5c96b331) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(uint256 p0, uint256 p1, bool p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(uint256,uint256,bool)`. + mstore(0x00, 0x4766da72) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(uint256 p0, uint256 p1, uint256 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + // Selector of `log(uint256,uint256,uint256)`. + mstore(0x00, 0xd1ed7a3c) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + } + _sendLogPayload(0x1c, 0x64); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + } + } + + function log(uint256 p0, uint256 p1, bytes32 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(uint256,uint256,string)`. + mstore(0x00, 0x71d04af2) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x60) + writeString(0x80, p2) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(uint256 p0, bytes32 p1, address p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(uint256,string,address)`. + mstore(0x00, 0x7afac959) + mstore(0x20, p0) + mstore(0x40, 0x60) + mstore(0x60, p2) + writeString(0x80, p1) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(uint256 p0, bytes32 p1, bool p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(uint256,string,bool)`. + mstore(0x00, 0x4ceda75a) + mstore(0x20, p0) + mstore(0x40, 0x60) + mstore(0x60, p2) + writeString(0x80, p1) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(uint256 p0, bytes32 p1, uint256 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(uint256,string,uint256)`. + mstore(0x00, 0x37aa7d4c) + mstore(0x20, p0) + mstore(0x40, 0x60) + mstore(0x60, p2) + writeString(0x80, p1) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(uint256 p0, bytes32 p1, bytes32 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + // Selector of `log(uint256,string,string)`. + mstore(0x00, 0xb115611f) + mstore(0x20, p0) + mstore(0x40, 0x60) + mstore(0x60, 0xa0) + writeString(0x80, p1) + writeString(0xc0, p2) + } + _sendLogPayload(0x1c, 0xe4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + } + } + + function log(bytes32 p0, address p1, address p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(string,address,address)`. + mstore(0x00, 0xfcec75e0) + mstore(0x20, 0x60) + mstore(0x40, p1) + mstore(0x60, p2) + writeString(0x80, p0) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(bytes32 p0, address p1, bool p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(string,address,bool)`. + mstore(0x00, 0xc91d5ed4) + mstore(0x20, 0x60) + mstore(0x40, p1) + mstore(0x60, p2) + writeString(0x80, p0) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(bytes32 p0, address p1, uint256 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(string,address,uint256)`. + mstore(0x00, 0x0d26b925) + mstore(0x20, 0x60) + mstore(0x40, p1) + mstore(0x60, p2) + writeString(0x80, p0) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(bytes32 p0, address p1, bytes32 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + // Selector of `log(string,address,string)`. + mstore(0x00, 0xe0e9ad4f) + mstore(0x20, 0x60) + mstore(0x40, p1) + mstore(0x60, 0xa0) + writeString(0x80, p0) + writeString(0xc0, p2) + } + _sendLogPayload(0x1c, 0xe4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + } + } + + function log(bytes32 p0, bool p1, address p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(string,bool,address)`. + mstore(0x00, 0x932bbb38) + mstore(0x20, 0x60) + mstore(0x40, p1) + mstore(0x60, p2) + writeString(0x80, p0) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(bytes32 p0, bool p1, bool p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(string,bool,bool)`. + mstore(0x00, 0x850b7ad6) + mstore(0x20, 0x60) + mstore(0x40, p1) + mstore(0x60, p2) + writeString(0x80, p0) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(bytes32 p0, bool p1, uint256 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(string,bool,uint256)`. + mstore(0x00, 0xc95958d6) + mstore(0x20, 0x60) + mstore(0x40, p1) + mstore(0x60, p2) + writeString(0x80, p0) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(bytes32 p0, bool p1, bytes32 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + // Selector of `log(string,bool,string)`. + mstore(0x00, 0xe298f47d) + mstore(0x20, 0x60) + mstore(0x40, p1) + mstore(0x60, 0xa0) + writeString(0x80, p0) + writeString(0xc0, p2) + } + _sendLogPayload(0x1c, 0xe4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + } + } + + function log(bytes32 p0, uint256 p1, address p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(string,uint256,address)`. + mstore(0x00, 0x1c7ec448) + mstore(0x20, 0x60) + mstore(0x40, p1) + mstore(0x60, p2) + writeString(0x80, p0) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(bytes32 p0, uint256 p1, bool p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(string,uint256,bool)`. + mstore(0x00, 0xca7733b1) + mstore(0x20, 0x60) + mstore(0x40, p1) + mstore(0x60, p2) + writeString(0x80, p0) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(bytes32 p0, uint256 p1, uint256 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + // Selector of `log(string,uint256,uint256)`. + mstore(0x00, 0xca47c4eb) + mstore(0x20, 0x60) + mstore(0x40, p1) + mstore(0x60, p2) + writeString(0x80, p0) + } + _sendLogPayload(0x1c, 0xa4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + } + } + + function log(bytes32 p0, uint256 p1, bytes32 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + // Selector of `log(string,uint256,string)`. + mstore(0x00, 0x5970e089) + mstore(0x20, 0x60) + mstore(0x40, p1) + mstore(0x60, 0xa0) + writeString(0x80, p0) + writeString(0xc0, p2) + } + _sendLogPayload(0x1c, 0xe4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + } + } + + function log(bytes32 p0, bytes32 p1, address p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + // Selector of `log(string,string,address)`. + mstore(0x00, 0x95ed0195) + mstore(0x20, 0x60) + mstore(0x40, 0xa0) + mstore(0x60, p2) + writeString(0x80, p0) + writeString(0xc0, p1) + } + _sendLogPayload(0x1c, 0xe4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + } + } + + function log(bytes32 p0, bytes32 p1, bool p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + // Selector of `log(string,string,bool)`. + mstore(0x00, 0xb0e0f9b5) + mstore(0x20, 0x60) + mstore(0x40, 0xa0) + mstore(0x60, p2) + writeString(0x80, p0) + writeString(0xc0, p1) + } + _sendLogPayload(0x1c, 0xe4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + } + } + + function log(bytes32 p0, bytes32 p1, uint256 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + // Selector of `log(string,string,uint256)`. + mstore(0x00, 0x5821efa1) + mstore(0x20, 0x60) + mstore(0x40, 0xa0) + mstore(0x60, p2) + writeString(0x80, p0) + writeString(0xc0, p1) + } + _sendLogPayload(0x1c, 0xe4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + } + } + + function log(bytes32 p0, bytes32 p1, bytes32 p2) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + bytes32 m9; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + m9 := mload(0x120) + // Selector of `log(string,string,string)`. + mstore(0x00, 0x2ced7cef) + mstore(0x20, 0x60) + mstore(0x40, 0xa0) + mstore(0x60, 0xe0) + writeString(0x80, p0) + writeString(0xc0, p1) + writeString(0x100, p2) + } + _sendLogPayload(0x1c, 0x124); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + mstore(0x120, m9) + } + } + + function log(address p0, address p1, address p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,address,address,address)`. + mstore(0x00, 0x665bf134) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, address p1, address p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,address,address,bool)`. + mstore(0x00, 0x0e378994) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, address p1, address p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,address,address,uint256)`. + mstore(0x00, 0x94250d77) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, address p1, address p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,address,address,string)`. + mstore(0x00, 0xf808da20) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, address p1, bool p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,address,bool,address)`. + mstore(0x00, 0x9f1bc36e) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, address p1, bool p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,address,bool,bool)`. + mstore(0x00, 0x2cd4134a) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, address p1, bool p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,address,bool,uint256)`. + mstore(0x00, 0x3971e78c) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, address p1, bool p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,address,bool,string)`. + mstore(0x00, 0xaa6540c8) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, address p1, uint256 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,address,uint256,address)`. + mstore(0x00, 0x8da6def5) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, address p1, uint256 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,address,uint256,bool)`. + mstore(0x00, 0x9b4254e2) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, address p1, uint256 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,address,uint256,uint256)`. + mstore(0x00, 0xbe553481) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, address p1, uint256 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,address,uint256,string)`. + mstore(0x00, 0xfdb4f990) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, address p1, bytes32 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,address,string,address)`. + mstore(0x00, 0x8f736d16) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, address p1, bytes32 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,address,string,bool)`. + mstore(0x00, 0x6f1a594e) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, address p1, bytes32 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,address,string,uint256)`. + mstore(0x00, 0xef1cefe7) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, address p1, bytes32 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(address,address,string,string)`. + mstore(0x00, 0x21bdaf25) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, 0xc0) + writeString(0xa0, p2) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(address p0, bool p1, address p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,bool,address,address)`. + mstore(0x00, 0x660375dd) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, bool p1, address p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,bool,address,bool)`. + mstore(0x00, 0xa6f50b0f) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, bool p1, address p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,bool,address,uint256)`. + mstore(0x00, 0xa75c59de) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, bool p1, address p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,bool,address,string)`. + mstore(0x00, 0x2dd778e6) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, bool p1, bool p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,bool,bool,address)`. + mstore(0x00, 0xcf394485) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, bool p1, bool p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,bool,bool,bool)`. + mstore(0x00, 0xcac43479) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, bool p1, bool p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,bool,bool,uint256)`. + mstore(0x00, 0x8c4e5de6) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, bool p1, bool p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,bool,bool,string)`. + mstore(0x00, 0xdfc4a2e8) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, bool p1, uint256 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,bool,uint256,address)`. + mstore(0x00, 0xccf790a1) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, bool p1, uint256 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,bool,uint256,bool)`. + mstore(0x00, 0xc4643e20) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, bool p1, uint256 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,bool,uint256,uint256)`. + mstore(0x00, 0x386ff5f4) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, bool p1, uint256 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,bool,uint256,string)`. + mstore(0x00, 0x0aa6cfad) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, bool p1, bytes32 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,bool,string,address)`. + mstore(0x00, 0x19fd4956) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, bool p1, bytes32 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,bool,string,bool)`. + mstore(0x00, 0x50ad461d) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, bool p1, bytes32 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,bool,string,uint256)`. + mstore(0x00, 0x80e6a20b) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, bool p1, bytes32 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(address,bool,string,string)`. + mstore(0x00, 0x475c5c33) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, 0xc0) + writeString(0xa0, p2) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(address p0, uint256 p1, address p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,uint256,address,address)`. + mstore(0x00, 0x478d1c62) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, uint256 p1, address p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,uint256,address,bool)`. + mstore(0x00, 0xa1bcc9b3) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, uint256 p1, address p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,uint256,address,uint256)`. + mstore(0x00, 0x100f650e) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, uint256 p1, address p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,uint256,address,string)`. + mstore(0x00, 0x1da986ea) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, uint256 p1, bool p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,uint256,bool,address)`. + mstore(0x00, 0xa31bfdcc) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, uint256 p1, bool p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,uint256,bool,bool)`. + mstore(0x00, 0x3bf5e537) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, uint256 p1, bool p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,uint256,bool,uint256)`. + mstore(0x00, 0x22f6b999) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, uint256 p1, bool p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,uint256,bool,string)`. + mstore(0x00, 0xc5ad85f9) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, uint256 p1, uint256 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,uint256,uint256,address)`. + mstore(0x00, 0x20e3984d) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, uint256 p1, uint256 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,uint256,uint256,bool)`. + mstore(0x00, 0x66f1bc67) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, uint256 p1, uint256 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(address,uint256,uint256,uint256)`. + mstore(0x00, 0x34f0e636) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(address p0, uint256 p1, uint256 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,uint256,uint256,string)`. + mstore(0x00, 0x4a28c017) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, uint256 p1, bytes32 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,uint256,string,address)`. + mstore(0x00, 0x5c430d47) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, uint256 p1, bytes32 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,uint256,string,bool)`. + mstore(0x00, 0xcf18105c) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, uint256 p1, bytes32 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,uint256,string,uint256)`. + mstore(0x00, 0xbf01f891) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, uint256 p1, bytes32 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(address,uint256,string,string)`. + mstore(0x00, 0x88a8c406) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, 0xc0) + writeString(0xa0, p2) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(address p0, bytes32 p1, address p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,string,address,address)`. + mstore(0x00, 0x0d36fa20) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, bytes32 p1, address p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,string,address,bool)`. + mstore(0x00, 0x0df12b76) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, bytes32 p1, address p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,string,address,uint256)`. + mstore(0x00, 0x457fe3cf) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, bytes32 p1, address p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(address,string,address,string)`. + mstore(0x00, 0xf7e36245) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, 0xc0) + writeString(0xa0, p1) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(address p0, bytes32 p1, bool p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,string,bool,address)`. + mstore(0x00, 0x205871c2) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, bytes32 p1, bool p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,string,bool,bool)`. + mstore(0x00, 0x5f1d5c9f) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, bytes32 p1, bool p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,string,bool,uint256)`. + mstore(0x00, 0x515e38b6) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, bytes32 p1, bool p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(address,string,bool,string)`. + mstore(0x00, 0xbc0b61fe) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, 0xc0) + writeString(0xa0, p1) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(address p0, bytes32 p1, uint256 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,string,uint256,address)`. + mstore(0x00, 0x63183678) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, bytes32 p1, uint256 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,string,uint256,bool)`. + mstore(0x00, 0x0ef7e050) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, bytes32 p1, uint256 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(address,string,uint256,uint256)`. + mstore(0x00, 0x1dc8e1b8) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(address p0, bytes32 p1, uint256 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(address,string,uint256,string)`. + mstore(0x00, 0x448830a8) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, 0xc0) + writeString(0xa0, p1) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(address p0, bytes32 p1, bytes32 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(address,string,string,address)`. + mstore(0x00, 0xa04e2f87) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, 0xc0) + mstore(0x80, p3) + writeString(0xa0, p1) + writeString(0xe0, p2) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(address p0, bytes32 p1, bytes32 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(address,string,string,bool)`. + mstore(0x00, 0x35a5071f) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, 0xc0) + mstore(0x80, p3) + writeString(0xa0, p1) + writeString(0xe0, p2) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(address p0, bytes32 p1, bytes32 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(address,string,string,uint256)`. + mstore(0x00, 0x159f8927) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, 0xc0) + mstore(0x80, p3) + writeString(0xa0, p1) + writeString(0xe0, p2) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(address p0, bytes32 p1, bytes32 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + bytes32 m9; + bytes32 m10; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + m9 := mload(0x120) + m10 := mload(0x140) + // Selector of `log(address,string,string,string)`. + mstore(0x00, 0x5d02c50b) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, 0xc0) + mstore(0x80, 0x100) + writeString(0xa0, p1) + writeString(0xe0, p2) + writeString(0x120, p3) + } + _sendLogPayload(0x1c, 0x144); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + mstore(0x120, m9) + mstore(0x140, m10) + } + } + + function log(bool p0, address p1, address p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,address,address,address)`. + mstore(0x00, 0x1d14d001) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, address p1, address p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,address,address,bool)`. + mstore(0x00, 0x46600be0) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, address p1, address p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,address,address,uint256)`. + mstore(0x00, 0x0c66d1be) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, address p1, address p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,address,address,string)`. + mstore(0x00, 0xd812a167) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, address p1, bool p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,address,bool,address)`. + mstore(0x00, 0x1c41a336) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, address p1, bool p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,address,bool,bool)`. + mstore(0x00, 0x6a9c478b) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, address p1, bool p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,address,bool,uint256)`. + mstore(0x00, 0x07831502) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, address p1, bool p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,address,bool,string)`. + mstore(0x00, 0x4a66cb34) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, address p1, uint256 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,address,uint256,address)`. + mstore(0x00, 0x136b05dd) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, address p1, uint256 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,address,uint256,bool)`. + mstore(0x00, 0xd6019f1c) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, address p1, uint256 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,address,uint256,uint256)`. + mstore(0x00, 0x7bf181a1) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, address p1, uint256 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,address,uint256,string)`. + mstore(0x00, 0x51f09ff8) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, address p1, bytes32 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,address,string,address)`. + mstore(0x00, 0x6f7c603e) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, address p1, bytes32 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,address,string,bool)`. + mstore(0x00, 0xe2bfd60b) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, address p1, bytes32 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,address,string,uint256)`. + mstore(0x00, 0xc21f64c7) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, address p1, bytes32 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(bool,address,string,string)`. + mstore(0x00, 0xa73c1db6) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, 0xc0) + writeString(0xa0, p2) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bool p0, bool p1, address p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,bool,address,address)`. + mstore(0x00, 0xf4880ea4) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, bool p1, address p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,bool,address,bool)`. + mstore(0x00, 0xc0a302d8) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, bool p1, address p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,bool,address,uint256)`. + mstore(0x00, 0x4c123d57) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, bool p1, address p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,bool,address,string)`. + mstore(0x00, 0xa0a47963) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, bool p1, bool p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,bool,bool,address)`. + mstore(0x00, 0x8c329b1a) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, bool p1, bool p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,bool,bool,bool)`. + mstore(0x00, 0x3b2a5ce0) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, bool p1, bool p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,bool,bool,uint256)`. + mstore(0x00, 0x6d7045c1) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, bool p1, bool p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,bool,bool,string)`. + mstore(0x00, 0x2ae408d4) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, bool p1, uint256 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,bool,uint256,address)`. + mstore(0x00, 0x54a7a9a0) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, bool p1, uint256 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,bool,uint256,bool)`. + mstore(0x00, 0x619e4d0e) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, bool p1, uint256 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,bool,uint256,uint256)`. + mstore(0x00, 0x0bb00eab) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, bool p1, uint256 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,bool,uint256,string)`. + mstore(0x00, 0x7dd4d0e0) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, bool p1, bytes32 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,bool,string,address)`. + mstore(0x00, 0xf9ad2b89) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, bool p1, bytes32 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,bool,string,bool)`. + mstore(0x00, 0xb857163a) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, bool p1, bytes32 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,bool,string,uint256)`. + mstore(0x00, 0xe3a9ca2f) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, bool p1, bytes32 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(bool,bool,string,string)`. + mstore(0x00, 0x6d1e8751) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, 0xc0) + writeString(0xa0, p2) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bool p0, uint256 p1, address p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,uint256,address,address)`. + mstore(0x00, 0x26f560a8) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, uint256 p1, address p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,uint256,address,bool)`. + mstore(0x00, 0xb4c314ff) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, uint256 p1, address p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,uint256,address,uint256)`. + mstore(0x00, 0x1537dc87) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, uint256 p1, address p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,uint256,address,string)`. + mstore(0x00, 0x1bb3b09a) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, uint256 p1, bool p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,uint256,bool,address)`. + mstore(0x00, 0x9acd3616) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, uint256 p1, bool p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,uint256,bool,bool)`. + mstore(0x00, 0xceb5f4d7) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, uint256 p1, bool p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,uint256,bool,uint256)`. + mstore(0x00, 0x7f9bbca2) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, uint256 p1, bool p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,uint256,bool,string)`. + mstore(0x00, 0x9143dbb1) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, uint256 p1, uint256 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,uint256,uint256,address)`. + mstore(0x00, 0x00dd87b9) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, uint256 p1, uint256 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,uint256,uint256,bool)`. + mstore(0x00, 0xbe984353) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, uint256 p1, uint256 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(bool,uint256,uint256,uint256)`. + mstore(0x00, 0x374bb4b2) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(bool p0, uint256 p1, uint256 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,uint256,uint256,string)`. + mstore(0x00, 0x8e69fb5d) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, uint256 p1, bytes32 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,uint256,string,address)`. + mstore(0x00, 0xfedd1fff) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, uint256 p1, bytes32 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,uint256,string,bool)`. + mstore(0x00, 0xe5e70b2b) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, uint256 p1, bytes32 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,uint256,string,uint256)`. + mstore(0x00, 0x6a1199e2) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, uint256 p1, bytes32 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(bool,uint256,string,string)`. + mstore(0x00, 0xf5bc2249) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, 0xc0) + writeString(0xa0, p2) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bool p0, bytes32 p1, address p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,string,address,address)`. + mstore(0x00, 0x2b2b18dc) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, bytes32 p1, address p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,string,address,bool)`. + mstore(0x00, 0x6dd434ca) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, bytes32 p1, address p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,string,address,uint256)`. + mstore(0x00, 0xa5cada94) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, bytes32 p1, address p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(bool,string,address,string)`. + mstore(0x00, 0x12d6c788) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, 0xc0) + writeString(0xa0, p1) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bool p0, bytes32 p1, bool p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,string,bool,address)`. + mstore(0x00, 0x538e06ab) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, bytes32 p1, bool p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,string,bool,bool)`. + mstore(0x00, 0xdc5e935b) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, bytes32 p1, bool p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,string,bool,uint256)`. + mstore(0x00, 0x1606a393) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, bytes32 p1, bool p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(bool,string,bool,string)`. + mstore(0x00, 0x483d0416) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, 0xc0) + writeString(0xa0, p1) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bool p0, bytes32 p1, uint256 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,string,uint256,address)`. + mstore(0x00, 0x1596a1ce) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, bytes32 p1, uint256 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,string,uint256,bool)`. + mstore(0x00, 0x6b0e5d53) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, bytes32 p1, uint256 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(bool,string,uint256,uint256)`. + mstore(0x00, 0x28863fcb) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bool p0, bytes32 p1, uint256 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(bool,string,uint256,string)`. + mstore(0x00, 0x1ad96de6) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, 0xc0) + writeString(0xa0, p1) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bool p0, bytes32 p1, bytes32 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(bool,string,string,address)`. + mstore(0x00, 0x97d394d8) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, 0xc0) + mstore(0x80, p3) + writeString(0xa0, p1) + writeString(0xe0, p2) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bool p0, bytes32 p1, bytes32 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(bool,string,string,bool)`. + mstore(0x00, 0x1e4b87e5) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, 0xc0) + mstore(0x80, p3) + writeString(0xa0, p1) + writeString(0xe0, p2) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bool p0, bytes32 p1, bytes32 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(bool,string,string,uint256)`. + mstore(0x00, 0x7be0c3eb) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, 0xc0) + mstore(0x80, p3) + writeString(0xa0, p1) + writeString(0xe0, p2) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bool p0, bytes32 p1, bytes32 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + bytes32 m9; + bytes32 m10; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + m9 := mload(0x120) + m10 := mload(0x140) + // Selector of `log(bool,string,string,string)`. + mstore(0x00, 0x1762e32a) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, 0xc0) + mstore(0x80, 0x100) + writeString(0xa0, p1) + writeString(0xe0, p2) + writeString(0x120, p3) + } + _sendLogPayload(0x1c, 0x144); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + mstore(0x120, m9) + mstore(0x140, m10) + } + } + + function log(uint256 p0, address p1, address p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,address,address,address)`. + mstore(0x00, 0x2488b414) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, address p1, address p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,address,address,bool)`. + mstore(0x00, 0x091ffaf5) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, address p1, address p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,address,address,uint256)`. + mstore(0x00, 0x736efbb6) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, address p1, address p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,address,address,string)`. + mstore(0x00, 0x031c6f73) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, address p1, bool p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,address,bool,address)`. + mstore(0x00, 0xef72c513) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, address p1, bool p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,address,bool,bool)`. + mstore(0x00, 0xe351140f) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, address p1, bool p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,address,bool,uint256)`. + mstore(0x00, 0x5abd992a) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, address p1, bool p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,address,bool,string)`. + mstore(0x00, 0x90fb06aa) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, address p1, uint256 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,address,uint256,address)`. + mstore(0x00, 0x15c127b5) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, address p1, uint256 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,address,uint256,bool)`. + mstore(0x00, 0x5f743a7c) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, address p1, uint256 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,address,uint256,uint256)`. + mstore(0x00, 0x0c9cd9c1) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, address p1, uint256 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,address,uint256,string)`. + mstore(0x00, 0xddb06521) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, address p1, bytes32 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,address,string,address)`. + mstore(0x00, 0x9cba8fff) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, address p1, bytes32 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,address,string,bool)`. + mstore(0x00, 0xcc32ab07) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, address p1, bytes32 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,address,string,uint256)`. + mstore(0x00, 0x46826b5d) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, address p1, bytes32 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(uint256,address,string,string)`. + mstore(0x00, 0x3e128ca3) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, 0xc0) + writeString(0xa0, p2) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(uint256 p0, bool p1, address p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,bool,address,address)`. + mstore(0x00, 0xa1ef4cbb) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, bool p1, address p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,bool,address,bool)`. + mstore(0x00, 0x454d54a5) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, bool p1, address p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,bool,address,uint256)`. + mstore(0x00, 0x078287f5) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, bool p1, address p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,bool,address,string)`. + mstore(0x00, 0xade052c7) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, bool p1, bool p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,bool,bool,address)`. + mstore(0x00, 0x69640b59) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, bool p1, bool p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,bool,bool,bool)`. + mstore(0x00, 0xb6f577a1) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, bool p1, bool p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,bool,bool,uint256)`. + mstore(0x00, 0x7464ce23) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, bool p1, bool p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,bool,bool,string)`. + mstore(0x00, 0xdddb9561) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, bool p1, uint256 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,bool,uint256,address)`. + mstore(0x00, 0x88cb6041) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, bool p1, uint256 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,bool,uint256,bool)`. + mstore(0x00, 0x91a02e2a) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, bool p1, uint256 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,bool,uint256,uint256)`. + mstore(0x00, 0xc6acc7a8) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, bool p1, uint256 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,bool,uint256,string)`. + mstore(0x00, 0xde03e774) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, bool p1, bytes32 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,bool,string,address)`. + mstore(0x00, 0xef529018) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, bool p1, bytes32 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,bool,string,bool)`. + mstore(0x00, 0xeb928d7f) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, bool p1, bytes32 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,bool,string,uint256)`. + mstore(0x00, 0x2c1d0746) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, bool p1, bytes32 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(uint256,bool,string,string)`. + mstore(0x00, 0x68c8b8bd) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, 0xc0) + writeString(0xa0, p2) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(uint256 p0, uint256 p1, address p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,uint256,address,address)`. + mstore(0x00, 0x56a5d1b1) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, uint256 p1, address p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,uint256,address,bool)`. + mstore(0x00, 0x15cac476) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, uint256 p1, address p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,uint256,address,uint256)`. + mstore(0x00, 0x88f6e4b2) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, uint256 p1, address p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,uint256,address,string)`. + mstore(0x00, 0x6cde40b8) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, uint256 p1, bool p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,uint256,bool,address)`. + mstore(0x00, 0x9a816a83) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, uint256 p1, bool p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,uint256,bool,bool)`. + mstore(0x00, 0xab085ae6) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, uint256 p1, bool p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,uint256,bool,uint256)`. + mstore(0x00, 0xeb7f6fd2) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, uint256 p1, bool p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,uint256,bool,string)`. + mstore(0x00, 0xa5b4fc99) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, uint256 p1, uint256 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,uint256,uint256,address)`. + mstore(0x00, 0xfa8185af) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, uint256 p1, uint256 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,uint256,uint256,bool)`. + mstore(0x00, 0xc598d185) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, uint256 p1, uint256 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + assembly { + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + // Selector of `log(uint256,uint256,uint256,uint256)`. + mstore(0x00, 0x193fb800) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + } + _sendLogPayload(0x1c, 0x84); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + } + } + + function log(uint256 p0, uint256 p1, uint256 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,uint256,uint256,string)`. + mstore(0x00, 0x59cfcbe3) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0x80) + writeString(0xa0, p3) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, uint256 p1, bytes32 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,uint256,string,address)`. + mstore(0x00, 0x42d21db7) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, uint256 p1, bytes32 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,uint256,string,bool)`. + mstore(0x00, 0x7af6ab25) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, uint256 p1, bytes32 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,uint256,string,uint256)`. + mstore(0x00, 0x5da297eb) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, p3) + writeString(0xa0, p2) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, uint256 p1, bytes32 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(uint256,uint256,string,string)`. + mstore(0x00, 0x27d8afd2) + mstore(0x20, p0) + mstore(0x40, p1) + mstore(0x60, 0x80) + mstore(0x80, 0xc0) + writeString(0xa0, p2) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(uint256 p0, bytes32 p1, address p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,string,address,address)`. + mstore(0x00, 0x6168ed61) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, bytes32 p1, address p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,string,address,bool)`. + mstore(0x00, 0x90c30a56) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, bytes32 p1, address p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,string,address,uint256)`. + mstore(0x00, 0xe8d3018d) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, bytes32 p1, address p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(uint256,string,address,string)`. + mstore(0x00, 0x9c3adfa1) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, 0xc0) + writeString(0xa0, p1) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(uint256 p0, bytes32 p1, bool p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,string,bool,address)`. + mstore(0x00, 0xae2ec581) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, bytes32 p1, bool p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,string,bool,bool)`. + mstore(0x00, 0xba535d9c) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, bytes32 p1, bool p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,string,bool,uint256)`. + mstore(0x00, 0xcf009880) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, bytes32 p1, bool p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(uint256,string,bool,string)`. + mstore(0x00, 0xd2d423cd) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, 0xc0) + writeString(0xa0, p1) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(uint256 p0, bytes32 p1, uint256 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,string,uint256,address)`. + mstore(0x00, 0x3b2279b4) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, bytes32 p1, uint256 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,string,uint256,bool)`. + mstore(0x00, 0x691a8f74) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, bytes32 p1, uint256 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(uint256,string,uint256,uint256)`. + mstore(0x00, 0x82c25b74) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p1) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(uint256 p0, bytes32 p1, uint256 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(uint256,string,uint256,string)`. + mstore(0x00, 0xb7b914ca) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, p2) + mstore(0x80, 0xc0) + writeString(0xa0, p1) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(uint256 p0, bytes32 p1, bytes32 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(uint256,string,string,address)`. + mstore(0x00, 0xd583c602) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, 0xc0) + mstore(0x80, p3) + writeString(0xa0, p1) + writeString(0xe0, p2) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(uint256 p0, bytes32 p1, bytes32 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(uint256,string,string,bool)`. + mstore(0x00, 0xb3a6b6bd) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, 0xc0) + mstore(0x80, p3) + writeString(0xa0, p1) + writeString(0xe0, p2) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(uint256 p0, bytes32 p1, bytes32 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(uint256,string,string,uint256)`. + mstore(0x00, 0xb028c9bd) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, 0xc0) + mstore(0x80, p3) + writeString(0xa0, p1) + writeString(0xe0, p2) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(uint256 p0, bytes32 p1, bytes32 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + bytes32 m9; + bytes32 m10; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + m9 := mload(0x120) + m10 := mload(0x140) + // Selector of `log(uint256,string,string,string)`. + mstore(0x00, 0x21ad0683) + mstore(0x20, p0) + mstore(0x40, 0x80) + mstore(0x60, 0xc0) + mstore(0x80, 0x100) + writeString(0xa0, p1) + writeString(0xe0, p2) + writeString(0x120, p3) + } + _sendLogPayload(0x1c, 0x144); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + mstore(0x120, m9) + mstore(0x140, m10) + } + } + + function log(bytes32 p0, address p1, address p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,address,address,address)`. + mstore(0x00, 0xed8f28f6) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, address p1, address p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,address,address,bool)`. + mstore(0x00, 0xb59dbd60) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, address p1, address p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,address,address,uint256)`. + mstore(0x00, 0x8ef3f399) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, address p1, address p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,address,address,string)`. + mstore(0x00, 0x800a1c67) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0xc0) + writeString(0xa0, p0) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, address p1, bool p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,address,bool,address)`. + mstore(0x00, 0x223603bd) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, address p1, bool p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,address,bool,bool)`. + mstore(0x00, 0x79884c2b) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, address p1, bool p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,address,bool,uint256)`. + mstore(0x00, 0x3e9f866a) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, address p1, bool p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,address,bool,string)`. + mstore(0x00, 0x0454c079) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0xc0) + writeString(0xa0, p0) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, address p1, uint256 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,address,uint256,address)`. + mstore(0x00, 0x63fb8bc5) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, address p1, uint256 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,address,uint256,bool)`. + mstore(0x00, 0xfc4845f0) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, address p1, uint256 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,address,uint256,uint256)`. + mstore(0x00, 0xf8f51b1e) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, address p1, uint256 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,address,uint256,string)`. + mstore(0x00, 0x5a477632) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0xc0) + writeString(0xa0, p0) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, address p1, bytes32 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,address,string,address)`. + mstore(0x00, 0xaabc9a31) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, 0xc0) + mstore(0x80, p3) + writeString(0xa0, p0) + writeString(0xe0, p2) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, address p1, bytes32 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,address,string,bool)`. + mstore(0x00, 0x5f15d28c) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, 0xc0) + mstore(0x80, p3) + writeString(0xa0, p0) + writeString(0xe0, p2) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, address p1, bytes32 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,address,string,uint256)`. + mstore(0x00, 0x91d1112e) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, 0xc0) + mstore(0x80, p3) + writeString(0xa0, p0) + writeString(0xe0, p2) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, address p1, bytes32 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + bytes32 m9; + bytes32 m10; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + m9 := mload(0x120) + m10 := mload(0x140) + // Selector of `log(string,address,string,string)`. + mstore(0x00, 0x245986f2) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, 0xc0) + mstore(0x80, 0x100) + writeString(0xa0, p0) + writeString(0xe0, p2) + writeString(0x120, p3) + } + _sendLogPayload(0x1c, 0x144); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + mstore(0x120, m9) + mstore(0x140, m10) + } + } + + function log(bytes32 p0, bool p1, address p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,bool,address,address)`. + mstore(0x00, 0x33e9dd1d) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, bool p1, address p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,bool,address,bool)`. + mstore(0x00, 0x958c28c6) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, bool p1, address p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,bool,address,uint256)`. + mstore(0x00, 0x5d08bb05) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, bool p1, address p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,bool,address,string)`. + mstore(0x00, 0x2d8e33a4) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0xc0) + writeString(0xa0, p0) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, bool p1, bool p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,bool,bool,address)`. + mstore(0x00, 0x7190a529) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, bool p1, bool p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,bool,bool,bool)`. + mstore(0x00, 0x895af8c5) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, bool p1, bool p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,bool,bool,uint256)`. + mstore(0x00, 0x8e3f78a9) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, bool p1, bool p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,bool,bool,string)`. + mstore(0x00, 0x9d22d5dd) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0xc0) + writeString(0xa0, p0) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, bool p1, uint256 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,bool,uint256,address)`. + mstore(0x00, 0x935e09bf) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, bool p1, uint256 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,bool,uint256,bool)`. + mstore(0x00, 0x8af7cf8a) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, bool p1, uint256 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,bool,uint256,uint256)`. + mstore(0x00, 0x64b5bb67) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, bool p1, uint256 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,bool,uint256,string)`. + mstore(0x00, 0x742d6ee7) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0xc0) + writeString(0xa0, p0) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, bool p1, bytes32 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,bool,string,address)`. + mstore(0x00, 0xe0625b29) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, 0xc0) + mstore(0x80, p3) + writeString(0xa0, p0) + writeString(0xe0, p2) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, bool p1, bytes32 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,bool,string,bool)`. + mstore(0x00, 0x3f8a701d) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, 0xc0) + mstore(0x80, p3) + writeString(0xa0, p0) + writeString(0xe0, p2) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, bool p1, bytes32 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,bool,string,uint256)`. + mstore(0x00, 0x24f91465) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, 0xc0) + mstore(0x80, p3) + writeString(0xa0, p0) + writeString(0xe0, p2) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, bool p1, bytes32 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + bytes32 m9; + bytes32 m10; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + m9 := mload(0x120) + m10 := mload(0x140) + // Selector of `log(string,bool,string,string)`. + mstore(0x00, 0xa826caeb) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, 0xc0) + mstore(0x80, 0x100) + writeString(0xa0, p0) + writeString(0xe0, p2) + writeString(0x120, p3) + } + _sendLogPayload(0x1c, 0x144); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + mstore(0x120, m9) + mstore(0x140, m10) + } + } + + function log(bytes32 p0, uint256 p1, address p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,uint256,address,address)`. + mstore(0x00, 0x5ea2b7ae) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, uint256 p1, address p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,uint256,address,bool)`. + mstore(0x00, 0x82112a42) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, uint256 p1, address p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,uint256,address,uint256)`. + mstore(0x00, 0x4f04fdc6) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, uint256 p1, address p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,uint256,address,string)`. + mstore(0x00, 0x9ffb2f93) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0xc0) + writeString(0xa0, p0) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, uint256 p1, bool p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,uint256,bool,address)`. + mstore(0x00, 0xe0e95b98) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, uint256 p1, bool p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,uint256,bool,bool)`. + mstore(0x00, 0x354c36d6) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, uint256 p1, bool p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,uint256,bool,uint256)`. + mstore(0x00, 0xe41b6f6f) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, uint256 p1, bool p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,uint256,bool,string)`. + mstore(0x00, 0xabf73a98) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0xc0) + writeString(0xa0, p0) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, uint256 p1, uint256 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,uint256,uint256,address)`. + mstore(0x00, 0xe21de278) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, uint256 p1, uint256 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,uint256,uint256,bool)`. + mstore(0x00, 0x7626db92) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, uint256 p1, uint256 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + // Selector of `log(string,uint256,uint256,uint256)`. + mstore(0x00, 0xa7a87853) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + } + _sendLogPayload(0x1c, 0xc4); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + } + } + + function log(bytes32 p0, uint256 p1, uint256 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,uint256,uint256,string)`. + mstore(0x00, 0x854b3496) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, p2) + mstore(0x80, 0xc0) + writeString(0xa0, p0) + writeString(0xe0, p3) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, uint256 p1, bytes32 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,uint256,string,address)`. + mstore(0x00, 0x7c4632a4) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, 0xc0) + mstore(0x80, p3) + writeString(0xa0, p0) + writeString(0xe0, p2) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, uint256 p1, bytes32 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,uint256,string,bool)`. + mstore(0x00, 0x7d24491d) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, 0xc0) + mstore(0x80, p3) + writeString(0xa0, p0) + writeString(0xe0, p2) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, uint256 p1, bytes32 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,uint256,string,uint256)`. + mstore(0x00, 0xc67ea9d1) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, 0xc0) + mstore(0x80, p3) + writeString(0xa0, p0) + writeString(0xe0, p2) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, uint256 p1, bytes32 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + bytes32 m9; + bytes32 m10; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + m9 := mload(0x120) + m10 := mload(0x140) + // Selector of `log(string,uint256,string,string)`. + mstore(0x00, 0x5ab84e1f) + mstore(0x20, 0x80) + mstore(0x40, p1) + mstore(0x60, 0xc0) + mstore(0x80, 0x100) + writeString(0xa0, p0) + writeString(0xe0, p2) + writeString(0x120, p3) + } + _sendLogPayload(0x1c, 0x144); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + mstore(0x120, m9) + mstore(0x140, m10) + } + } + + function log(bytes32 p0, bytes32 p1, address p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,string,address,address)`. + mstore(0x00, 0x439c7bef) + mstore(0x20, 0x80) + mstore(0x40, 0xc0) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + writeString(0xe0, p1) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, bytes32 p1, address p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,string,address,bool)`. + mstore(0x00, 0x5ccd4e37) + mstore(0x20, 0x80) + mstore(0x40, 0xc0) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + writeString(0xe0, p1) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, bytes32 p1, address p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,string,address,uint256)`. + mstore(0x00, 0x7cc3c607) + mstore(0x20, 0x80) + mstore(0x40, 0xc0) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + writeString(0xe0, p1) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, bytes32 p1, address p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + bytes32 m9; + bytes32 m10; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + m9 := mload(0x120) + m10 := mload(0x140) + // Selector of `log(string,string,address,string)`. + mstore(0x00, 0xeb1bff80) + mstore(0x20, 0x80) + mstore(0x40, 0xc0) + mstore(0x60, p2) + mstore(0x80, 0x100) + writeString(0xa0, p0) + writeString(0xe0, p1) + writeString(0x120, p3) + } + _sendLogPayload(0x1c, 0x144); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + mstore(0x120, m9) + mstore(0x140, m10) + } + } + + function log(bytes32 p0, bytes32 p1, bool p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,string,bool,address)`. + mstore(0x00, 0xc371c7db) + mstore(0x20, 0x80) + mstore(0x40, 0xc0) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + writeString(0xe0, p1) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, bytes32 p1, bool p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,string,bool,bool)`. + mstore(0x00, 0x40785869) + mstore(0x20, 0x80) + mstore(0x40, 0xc0) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + writeString(0xe0, p1) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, bytes32 p1, bool p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,string,bool,uint256)`. + mstore(0x00, 0xd6aefad2) + mstore(0x20, 0x80) + mstore(0x40, 0xc0) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + writeString(0xe0, p1) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, bytes32 p1, bool p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + bytes32 m9; + bytes32 m10; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + m9 := mload(0x120) + m10 := mload(0x140) + // Selector of `log(string,string,bool,string)`. + mstore(0x00, 0x5e84b0ea) + mstore(0x20, 0x80) + mstore(0x40, 0xc0) + mstore(0x60, p2) + mstore(0x80, 0x100) + writeString(0xa0, p0) + writeString(0xe0, p1) + writeString(0x120, p3) + } + _sendLogPayload(0x1c, 0x144); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + mstore(0x120, m9) + mstore(0x140, m10) + } + } + + function log(bytes32 p0, bytes32 p1, uint256 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,string,uint256,address)`. + mstore(0x00, 0x1023f7b2) + mstore(0x20, 0x80) + mstore(0x40, 0xc0) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + writeString(0xe0, p1) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, bytes32 p1, uint256 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,string,uint256,bool)`. + mstore(0x00, 0xc3a8a654) + mstore(0x20, 0x80) + mstore(0x40, 0xc0) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + writeString(0xe0, p1) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, bytes32 p1, uint256 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + // Selector of `log(string,string,uint256,uint256)`. + mstore(0x00, 0xf45d7d2c) + mstore(0x20, 0x80) + mstore(0x40, 0xc0) + mstore(0x60, p2) + mstore(0x80, p3) + writeString(0xa0, p0) + writeString(0xe0, p1) + } + _sendLogPayload(0x1c, 0x104); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + } + } + + function log(bytes32 p0, bytes32 p1, uint256 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + bytes32 m9; + bytes32 m10; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + m9 := mload(0x120) + m10 := mload(0x140) + // Selector of `log(string,string,uint256,string)`. + mstore(0x00, 0x5d1a971a) + mstore(0x20, 0x80) + mstore(0x40, 0xc0) + mstore(0x60, p2) + mstore(0x80, 0x100) + writeString(0xa0, p0) + writeString(0xe0, p1) + writeString(0x120, p3) + } + _sendLogPayload(0x1c, 0x144); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + mstore(0x120, m9) + mstore(0x140, m10) + } + } + + function log(bytes32 p0, bytes32 p1, bytes32 p2, address p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + bytes32 m9; + bytes32 m10; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + m9 := mload(0x120) + m10 := mload(0x140) + // Selector of `log(string,string,string,address)`. + mstore(0x00, 0x6d572f44) + mstore(0x20, 0x80) + mstore(0x40, 0xc0) + mstore(0x60, 0x100) + mstore(0x80, p3) + writeString(0xa0, p0) + writeString(0xe0, p1) + writeString(0x120, p2) + } + _sendLogPayload(0x1c, 0x144); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + mstore(0x120, m9) + mstore(0x140, m10) + } + } + + function log(bytes32 p0, bytes32 p1, bytes32 p2, bool p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + bytes32 m9; + bytes32 m10; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + m9 := mload(0x120) + m10 := mload(0x140) + // Selector of `log(string,string,string,bool)`. + mstore(0x00, 0x2c1754ed) + mstore(0x20, 0x80) + mstore(0x40, 0xc0) + mstore(0x60, 0x100) + mstore(0x80, p3) + writeString(0xa0, p0) + writeString(0xe0, p1) + writeString(0x120, p2) + } + _sendLogPayload(0x1c, 0x144); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + mstore(0x120, m9) + mstore(0x140, m10) + } + } + + function log(bytes32 p0, bytes32 p1, bytes32 p2, uint256 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + bytes32 m9; + bytes32 m10; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + m9 := mload(0x120) + m10 := mload(0x140) + // Selector of `log(string,string,string,uint256)`. + mstore(0x00, 0x8eafb02b) + mstore(0x20, 0x80) + mstore(0x40, 0xc0) + mstore(0x60, 0x100) + mstore(0x80, p3) + writeString(0xa0, p0) + writeString(0xe0, p1) + writeString(0x120, p2) + } + _sendLogPayload(0x1c, 0x144); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + mstore(0x120, m9) + mstore(0x140, m10) + } + } + + function log(bytes32 p0, bytes32 p1, bytes32 p2, bytes32 p3) internal pure { + bytes32 m0; + bytes32 m1; + bytes32 m2; + bytes32 m3; + bytes32 m4; + bytes32 m5; + bytes32 m6; + bytes32 m7; + bytes32 m8; + bytes32 m9; + bytes32 m10; + bytes32 m11; + bytes32 m12; + assembly { + function writeString(pos, w) { + let length := 0 + for {} lt(length, 0x20) { length := add(length, 1) } { if iszero(byte(length, w)) { break } } + mstore(pos, length) + let shift := sub(256, shl(3, length)) + mstore(add(pos, 0x20), shl(shift, shr(shift, w))) + } + m0 := mload(0x00) + m1 := mload(0x20) + m2 := mload(0x40) + m3 := mload(0x60) + m4 := mload(0x80) + m5 := mload(0xa0) + m6 := mload(0xc0) + m7 := mload(0xe0) + m8 := mload(0x100) + m9 := mload(0x120) + m10 := mload(0x140) + m11 := mload(0x160) + m12 := mload(0x180) + // Selector of `log(string,string,string,string)`. + mstore(0x00, 0xde68f20a) + mstore(0x20, 0x80) + mstore(0x40, 0xc0) + mstore(0x60, 0x100) + mstore(0x80, 0x140) + writeString(0xa0, p0) + writeString(0xe0, p1) + writeString(0x120, p2) + writeString(0x160, p3) + } + _sendLogPayload(0x1c, 0x184); + assembly { + mstore(0x00, m0) + mstore(0x20, m1) + mstore(0x40, m2) + mstore(0x60, m3) + mstore(0x80, m4) + mstore(0xa0, m5) + mstore(0xc0, m6) + mstore(0xe0, m7) + mstore(0x100, m8) + mstore(0x120, m9) + mstore(0x140, m10) + mstore(0x160, m11) + mstore(0x180, m12) + } + } +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/test/StdAssertions.t.sol b/harness/solidity_sized_tx_contract/lib/forge-std/test/StdAssertions.t.sol new file mode 100644 index 00000000..ae998f1f --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/test/StdAssertions.t.sol @@ -0,0 +1,1015 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.7.0 <0.9.0; + +import "../src/Test.sol"; + +contract StdAssertionsTest is Test { + string constant CUSTOM_ERROR = "guh!"; + + bool constant EXPECT_PASS = false; + bool constant EXPECT_FAIL = true; + + bool constant SHOULD_REVERT = true; + bool constant SHOULD_RETURN = false; + + bool constant STRICT_REVERT_DATA = true; + bool constant NON_STRICT_REVERT_DATA = false; + + TestTest t = new TestTest(); + + /*////////////////////////////////////////////////////////////////////////// + FAIL(STRING) + //////////////////////////////////////////////////////////////////////////*/ + + function test_ShouldFail() external { + vm.expectEmit(false, false, false, true); + emit log_named_string("Error", CUSTOM_ERROR); + t._fail(CUSTOM_ERROR); + } + + /*////////////////////////////////////////////////////////////////////////// + ASSERT_FALSE + //////////////////////////////////////////////////////////////////////////*/ + + function test_AssertFalse_Pass() external { + t._assertFalse(false, EXPECT_PASS); + } + + function test_AssertFalse_Fail() external { + vm.expectEmit(false, false, false, true); + emit log("Error: Assertion Failed"); + t._assertFalse(true, EXPECT_FAIL); + } + + function test_AssertFalse_Err_Pass() external { + t._assertFalse(false, CUSTOM_ERROR, EXPECT_PASS); + } + + function test_AssertFalse_Err_Fail() external { + vm.expectEmit(false, false, false, true); + emit log_named_string("Error", CUSTOM_ERROR); + t._assertFalse(true, CUSTOM_ERROR, EXPECT_FAIL); + } + + /*////////////////////////////////////////////////////////////////////////// + ASSERT_EQ(BOOL) + //////////////////////////////////////////////////////////////////////////*/ + + function testFuzz_AssertEq_Bool_Pass(bool a) external { + t._assertEq(a, a, EXPECT_PASS); + } + + function testFuzz_AssertEq_Bool_Fail(bool a, bool b) external { + vm.assume(a != b); + + vm.expectEmit(false, false, false, true); + emit log("Error: a == b not satisfied [bool]"); + t._assertEq(a, b, EXPECT_FAIL); + } + + function testFuzz_AssertEq_BoolErr_Pass(bool a) external { + t._assertEq(a, a, CUSTOM_ERROR, EXPECT_PASS); + } + + function testFuzz_AssertEq_BoolErr_Fail(bool a, bool b) external { + vm.assume(a != b); + + vm.expectEmit(false, false, false, true); + emit log_named_string("Error", CUSTOM_ERROR); + t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); + } + + /*////////////////////////////////////////////////////////////////////////// + ASSERT_EQ(BYTES) + //////////////////////////////////////////////////////////////////////////*/ + + function testFuzz_AssertEq_Bytes_Pass(bytes calldata a) external { + t._assertEq(a, a, EXPECT_PASS); + } + + function testFuzz_AssertEq_Bytes_Fail(bytes calldata a, bytes calldata b) external { + vm.assume(keccak256(a) != keccak256(b)); + + vm.expectEmit(false, false, false, true); + emit log("Error: a == b not satisfied [bytes]"); + t._assertEq(a, b, EXPECT_FAIL); + } + + function testFuzz_AssertEq_BytesErr_Pass(bytes calldata a) external { + t._assertEq(a, a, CUSTOM_ERROR, EXPECT_PASS); + } + + function testFuzz_AssertEq_BytesErr_Fail(bytes calldata a, bytes calldata b) external { + vm.assume(keccak256(a) != keccak256(b)); + + vm.expectEmit(false, false, false, true); + emit log_named_string("Error", CUSTOM_ERROR); + t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); + } + + /*////////////////////////////////////////////////////////////////////////// + ASSERT_EQ(ARRAY) + //////////////////////////////////////////////////////////////////////////*/ + + function testFuzz_AssertEq_UintArr_Pass(uint256 e0, uint256 e1, uint256 e2) public { + uint256[] memory a = new uint256[](3); + a[0] = e0; + a[1] = e1; + a[2] = e2; + uint256[] memory b = new uint256[](3); + b[0] = e0; + b[1] = e1; + b[2] = e2; + + t._assertEq(a, b, EXPECT_PASS); + } + + function testFuzz_AssertEq_IntArr_Pass(int256 e0, int256 e1, int256 e2) public { + int256[] memory a = new int256[](3); + a[0] = e0; + a[1] = e1; + a[2] = e2; + int256[] memory b = new int256[](3); + b[0] = e0; + b[1] = e1; + b[2] = e2; + + t._assertEq(a, b, EXPECT_PASS); + } + + function testFuzz_AssertEq_AddressArr_Pass(address e0, address e1, address e2) public { + address[] memory a = new address[](3); + a[0] = e0; + a[1] = e1; + a[2] = e2; + address[] memory b = new address[](3); + b[0] = e0; + b[1] = e1; + b[2] = e2; + + t._assertEq(a, b, EXPECT_PASS); + } + + function testFuzz_AssertEq_UintArr_FailEl(uint256 e1) public { + vm.assume(e1 != 0); + uint256[] memory a = new uint256[](3); + uint256[] memory b = new uint256[](3); + b[1] = e1; + + vm.expectEmit(false, false, false, true); + emit log("Error: a == b not satisfied [uint[]]"); + t._assertEq(a, b, EXPECT_FAIL); + } + + function testFuzz_AssertEq_IntArr_FailEl(int256 e1) public { + vm.assume(e1 != 0); + int256[] memory a = new int256[](3); + int256[] memory b = new int256[](3); + b[1] = e1; + + vm.expectEmit(false, false, false, true); + emit log("Error: a == b not satisfied [int[]]"); + t._assertEq(a, b, EXPECT_FAIL); + } + + function testFuzz_AssertEq_AddressArr_FailEl(address e1) public { + vm.assume(e1 != address(0)); + address[] memory a = new address[](3); + address[] memory b = new address[](3); + b[1] = e1; + + vm.expectEmit(false, false, false, true); + emit log("Error: a == b not satisfied [address[]]"); + t._assertEq(a, b, EXPECT_FAIL); + } + + function testFuzz_AssertEq_UintArrErr_FailEl(uint256 e1) public { + vm.assume(e1 != 0); + uint256[] memory a = new uint256[](3); + uint256[] memory b = new uint256[](3); + b[1] = e1; + + vm.expectEmit(false, false, false, true); + emit log_named_string("Error", CUSTOM_ERROR); + vm.expectEmit(false, false, false, true); + emit log("Error: a == b not satisfied [uint[]]"); + t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); + } + + function testFuzz_AssertEq_IntArrErr_FailEl(int256 e1) public { + vm.assume(e1 != 0); + int256[] memory a = new int256[](3); + int256[] memory b = new int256[](3); + b[1] = e1; + + vm.expectEmit(false, false, false, true); + emit log_named_string("Error", CUSTOM_ERROR); + vm.expectEmit(false, false, false, true); + emit log("Error: a == b not satisfied [int[]]"); + t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); + } + + function testFuzz_AssertEq_AddressArrErr_FailEl(address e1) public { + vm.assume(e1 != address(0)); + address[] memory a = new address[](3); + address[] memory b = new address[](3); + b[1] = e1; + + vm.expectEmit(false, false, false, true); + emit log_named_string("Error", CUSTOM_ERROR); + vm.expectEmit(false, false, false, true); + emit log("Error: a == b not satisfied [address[]]"); + t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); + } + + function testFuzz_AssertEq_UintArr_FailLen(uint256 lenA, uint256 lenB) public { + vm.assume(lenA != lenB); + vm.assume(lenA <= 10000); + vm.assume(lenB <= 10000); + uint256[] memory a = new uint256[](lenA); + uint256[] memory b = new uint256[](lenB); + + vm.expectEmit(false, false, false, true); + emit log("Error: a == b not satisfied [uint[]]"); + t._assertEq(a, b, EXPECT_FAIL); + } + + function testFuzz_AssertEq_IntArr_FailLen(uint256 lenA, uint256 lenB) public { + vm.assume(lenA != lenB); + vm.assume(lenA <= 10000); + vm.assume(lenB <= 10000); + int256[] memory a = new int256[](lenA); + int256[] memory b = new int256[](lenB); + + vm.expectEmit(false, false, false, true); + emit log("Error: a == b not satisfied [int[]]"); + t._assertEq(a, b, EXPECT_FAIL); + } + + function testFuzz_AssertEq_AddressArr_FailLen(uint256 lenA, uint256 lenB) public { + vm.assume(lenA != lenB); + vm.assume(lenA <= 10000); + vm.assume(lenB <= 10000); + address[] memory a = new address[](lenA); + address[] memory b = new address[](lenB); + + vm.expectEmit(false, false, false, true); + emit log("Error: a == b not satisfied [address[]]"); + t._assertEq(a, b, EXPECT_FAIL); + } + + function testFuzz_AssertEq_UintArrErr_FailLen(uint256 lenA, uint256 lenB) public { + vm.assume(lenA != lenB); + vm.assume(lenA <= 10000); + vm.assume(lenB <= 10000); + uint256[] memory a = new uint256[](lenA); + uint256[] memory b = new uint256[](lenB); + + vm.expectEmit(false, false, false, true); + emit log_named_string("Error", CUSTOM_ERROR); + vm.expectEmit(false, false, false, true); + emit log("Error: a == b not satisfied [uint[]]"); + t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); + } + + function testFuzz_AssertEq_IntArrErr_FailLen(uint256 lenA, uint256 lenB) public { + vm.assume(lenA != lenB); + vm.assume(lenA <= 10000); + vm.assume(lenB <= 10000); + int256[] memory a = new int256[](lenA); + int256[] memory b = new int256[](lenB); + + vm.expectEmit(false, false, false, true); + emit log_named_string("Error", CUSTOM_ERROR); + vm.expectEmit(false, false, false, true); + emit log("Error: a == b not satisfied [int[]]"); + t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); + } + + function testFuzz_AssertEq_AddressArrErr_FailLen(uint256 lenA, uint256 lenB) public { + vm.assume(lenA != lenB); + vm.assume(lenA <= 10000); + vm.assume(lenB <= 10000); + address[] memory a = new address[](lenA); + address[] memory b = new address[](lenB); + + vm.expectEmit(false, false, false, true); + emit log_named_string("Error", CUSTOM_ERROR); + vm.expectEmit(false, false, false, true); + emit log("Error: a == b not satisfied [address[]]"); + t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); + } + + /*////////////////////////////////////////////////////////////////////////// + ASSERT_EQ(UINT) + //////////////////////////////////////////////////////////////////////////*/ + + function test_AssertEqUint() public { + assertEqUint(uint8(1), uint128(1)); + assertEqUint(uint64(2), uint64(2)); + } + + function testFail_AssertEqUint() public { + assertEqUint(uint64(1), uint96(2)); + assertEqUint(uint160(3), uint160(4)); + } + + /*////////////////////////////////////////////////////////////////////////// + APPROX_EQ_ABS(UINT) + //////////////////////////////////////////////////////////////////////////*/ + + function testFuzz_AssertApproxEqAbs_Uint_Pass(uint256 a, uint256 b, uint256 maxDelta) external { + vm.assume(stdMath.delta(a, b) <= maxDelta); + + t._assertApproxEqAbs(a, b, maxDelta, EXPECT_PASS); + } + + function testFuzz_AssertApproxEqAbs_Uint_Fail(uint256 a, uint256 b, uint256 maxDelta) external { + vm.assume(stdMath.delta(a, b) > maxDelta); + + vm.expectEmit(false, false, false, true); + emit log("Error: a ~= b not satisfied [uint]"); + t._assertApproxEqAbs(a, b, maxDelta, EXPECT_FAIL); + } + + function testFuzz_AssertApproxEqAbs_UintErr_Pass(uint256 a, uint256 b, uint256 maxDelta) external { + vm.assume(stdMath.delta(a, b) <= maxDelta); + + t._assertApproxEqAbs(a, b, maxDelta, CUSTOM_ERROR, EXPECT_PASS); + } + + function testFuzz_AssertApproxEqAbs_UintErr_Fail(uint256 a, uint256 b, uint256 maxDelta) external { + vm.assume(stdMath.delta(a, b) > maxDelta); + + vm.expectEmit(false, false, false, true); + emit log_named_string("Error", CUSTOM_ERROR); + t._assertApproxEqAbs(a, b, maxDelta, CUSTOM_ERROR, EXPECT_FAIL); + } + + /*////////////////////////////////////////////////////////////////////////// + APPROX_EQ_ABS_DECIMAL(UINT) + //////////////////////////////////////////////////////////////////////////*/ + + function testFuzz_AssertApproxEqAbsDecimal_Uint_Pass(uint256 a, uint256 b, uint256 maxDelta, uint256 decimals) + external + { + vm.assume(stdMath.delta(a, b) <= maxDelta); + + t._assertApproxEqAbsDecimal(a, b, maxDelta, decimals, EXPECT_PASS); + } + + function testFuzz_AssertApproxEqAbsDecimal_Uint_Fail(uint256 a, uint256 b, uint256 maxDelta, uint256 decimals) + external + { + vm.assume(stdMath.delta(a, b) > maxDelta); + + vm.expectEmit(false, false, false, true); + emit log("Error: a ~= b not satisfied [uint]"); + t._assertApproxEqAbsDecimal(a, b, maxDelta, decimals, EXPECT_FAIL); + } + + function testFuzz_AssertApproxEqAbsDecimal_UintErr_Pass(uint256 a, uint256 b, uint256 maxDelta, uint256 decimals) + external + { + vm.assume(stdMath.delta(a, b) <= maxDelta); + + t._assertApproxEqAbsDecimal(a, b, maxDelta, decimals, CUSTOM_ERROR, EXPECT_PASS); + } + + function testFuzz_AssertApproxEqAbsDecimal_UintErr_Fail(uint256 a, uint256 b, uint256 maxDelta, uint256 decimals) + external + { + vm.assume(stdMath.delta(a, b) > maxDelta); + + vm.expectEmit(false, false, false, true); + emit log_named_string("Error", CUSTOM_ERROR); + t._assertApproxEqAbsDecimal(a, b, maxDelta, decimals, CUSTOM_ERROR, EXPECT_FAIL); + } + + /*////////////////////////////////////////////////////////////////////////// + APPROX_EQ_ABS(INT) + //////////////////////////////////////////////////////////////////////////*/ + + function testFuzz_AssertApproxEqAbs_Int_Pass(int256 a, int256 b, uint256 maxDelta) external { + vm.assume(stdMath.delta(a, b) <= maxDelta); + + t._assertApproxEqAbs(a, b, maxDelta, EXPECT_PASS); + } + + function testFuzz_AssertApproxEqAbs_Int_Fail(int256 a, int256 b, uint256 maxDelta) external { + vm.assume(stdMath.delta(a, b) > maxDelta); + + vm.expectEmit(false, false, false, true); + emit log("Error: a ~= b not satisfied [int]"); + t._assertApproxEqAbs(a, b, maxDelta, EXPECT_FAIL); + } + + function testFuzz_AssertApproxEqAbs_IntErr_Pass(int256 a, int256 b, uint256 maxDelta) external { + vm.assume(stdMath.delta(a, b) <= maxDelta); + + t._assertApproxEqAbs(a, b, maxDelta, CUSTOM_ERROR, EXPECT_PASS); + } + + function testFuzz_AssertApproxEqAbs_IntErr_Fail(int256 a, int256 b, uint256 maxDelta) external { + vm.assume(stdMath.delta(a, b) > maxDelta); + + vm.expectEmit(false, false, false, true); + emit log_named_string("Error", CUSTOM_ERROR); + t._assertApproxEqAbs(a, b, maxDelta, CUSTOM_ERROR, EXPECT_FAIL); + } + + /*////////////////////////////////////////////////////////////////////////// + APPROX_EQ_ABS_DECIMAL(INT) + //////////////////////////////////////////////////////////////////////////*/ + + function testFuzz_AssertApproxEqAbsDecimal_Int_Pass(int256 a, int256 b, uint256 maxDelta, uint256 decimals) + external + { + vm.assume(stdMath.delta(a, b) <= maxDelta); + + t._assertApproxEqAbsDecimal(a, b, maxDelta, decimals, EXPECT_PASS); + } + + function testFuzz_AssertApproxEqAbsDecimal_Int_Fail(int256 a, int256 b, uint256 maxDelta, uint256 decimals) + external + { + vm.assume(stdMath.delta(a, b) > maxDelta); + + vm.expectEmit(false, false, false, true); + emit log("Error: a ~= b not satisfied [int]"); + t._assertApproxEqAbsDecimal(a, b, maxDelta, decimals, EXPECT_FAIL); + } + + function testFuzz_AssertApproxEqAbsDecimal_IntErr_Pass(int256 a, int256 b, uint256 maxDelta, uint256 decimals) + external + { + vm.assume(stdMath.delta(a, b) <= maxDelta); + + t._assertApproxEqAbsDecimal(a, b, maxDelta, decimals, CUSTOM_ERROR, EXPECT_PASS); + } + + function testFuzz_AssertApproxEqAbsDecimal_IntErr_Fail(int256 a, int256 b, uint256 maxDelta, uint256 decimals) + external + { + vm.assume(stdMath.delta(a, b) > maxDelta); + + vm.expectEmit(false, false, false, true); + emit log_named_string("Error", CUSTOM_ERROR); + t._assertApproxEqAbsDecimal(a, b, maxDelta, decimals, CUSTOM_ERROR, EXPECT_FAIL); + } + + /*////////////////////////////////////////////////////////////////////////// + APPROX_EQ_REL(UINT) + //////////////////////////////////////////////////////////////////////////*/ + + function testFuzz_AssertApproxEqRel_Uint_Pass(uint256 a, uint256 b, uint256 maxPercentDelta) external { + vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); + vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); + + t._assertApproxEqRel(a, b, maxPercentDelta, EXPECT_PASS); + } + + function testFuzz_AssertApproxEqRel_Uint_Fail(uint256 a, uint256 b, uint256 maxPercentDelta) external { + vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); + vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); + + vm.expectEmit(false, false, false, true); + emit log("Error: a ~= b not satisfied [uint]"); + t._assertApproxEqRel(a, b, maxPercentDelta, EXPECT_FAIL); + } + + function testFuzz_AssertApproxEqRel_UintErr_Pass(uint256 a, uint256 b, uint256 maxPercentDelta) external { + vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); + vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); + + t._assertApproxEqRel(a, b, maxPercentDelta, CUSTOM_ERROR, EXPECT_PASS); + } + + function testFuzz_AssertApproxEqRel_UintErr_Fail(uint256 a, uint256 b, uint256 maxPercentDelta) external { + vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); + vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); + + vm.expectEmit(false, false, false, true); + emit log_named_string("Error", CUSTOM_ERROR); + t._assertApproxEqRel(a, b, maxPercentDelta, CUSTOM_ERROR, EXPECT_FAIL); + } + + /*////////////////////////////////////////////////////////////////////////// + APPROX_EQ_REL_DECIMAL(UINT) + //////////////////////////////////////////////////////////////////////////*/ + + function testFuzz_AssertApproxEqRelDecimal_Uint_Pass( + uint256 a, + uint256 b, + uint256 maxPercentDelta, + uint256 decimals + ) external { + vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); + vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); + + t._assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, EXPECT_PASS); + } + + function testFuzz_AssertApproxEqRelDecimal_Uint_Fail( + uint256 a, + uint256 b, + uint256 maxPercentDelta, + uint256 decimals + ) external { + vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); + vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); + + vm.expectEmit(false, false, false, true); + emit log("Error: a ~= b not satisfied [uint]"); + t._assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, EXPECT_FAIL); + } + + function testFuzz_AssertApproxEqRelDecimal_UintErr_Pass( + uint256 a, + uint256 b, + uint256 maxPercentDelta, + uint256 decimals + ) external { + vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); + vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); + + t._assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, CUSTOM_ERROR, EXPECT_PASS); + } + + function testFuzz_AssertApproxEqRelDecimal_UintErr_Fail( + uint256 a, + uint256 b, + uint256 maxPercentDelta, + uint256 decimals + ) external { + vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); + vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); + + vm.expectEmit(false, false, false, true); + emit log_named_string("Error", CUSTOM_ERROR); + t._assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, CUSTOM_ERROR, EXPECT_FAIL); + } + + /*////////////////////////////////////////////////////////////////////////// + APPROX_EQ_REL(INT) + //////////////////////////////////////////////////////////////////////////*/ + + function testFuzz_AssertApproxEqRel_Int_Pass(int128 a, int128 b, uint128 maxPercentDelta) external { + vm.assume(b != 0); + vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); + + t._assertApproxEqRel(a, b, maxPercentDelta, EXPECT_PASS); + } + + function testFuzz_AssertApproxEqRel_Int_Fail(int128 a, int128 b, uint128 maxPercentDelta) external { + vm.assume(b != 0); + vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); + + vm.expectEmit(false, false, false, true); + emit log("Error: a ~= b not satisfied [int]"); + t._assertApproxEqRel(a, b, maxPercentDelta, EXPECT_FAIL); + } + + function testFuzz_AssertApproxEqRel_IntErr_Pass(int128 a, int128 b, uint128 maxPercentDelta) external { + vm.assume(b != 0); + vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); + + t._assertApproxEqRel(a, b, maxPercentDelta, CUSTOM_ERROR, EXPECT_PASS); + } + + function testFuzz_AssertApproxEqRel_IntErr_Fail(int128 a, int128 b, uint128 maxPercentDelta) external { + vm.assume(b != 0); + vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); + + vm.expectEmit(false, false, false, true); + emit log_named_string("Error", CUSTOM_ERROR); + t._assertApproxEqRel(a, b, maxPercentDelta, CUSTOM_ERROR, EXPECT_FAIL); + } + + /*////////////////////////////////////////////////////////////////////////// + APPROX_EQ_REL_DECIMAL(INT) + //////////////////////////////////////////////////////////////////////////*/ + + function testAssertApproxEqRelDecimal_Int_Pass(int128 a, int128 b, uint128 maxPercentDelta, uint128 decimals) + external + { + vm.assume(b != 0); + vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); + + t._assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, EXPECT_PASS); + } + + function testAssertApproxEqRelDecimal_Int_Fail(int128 a, int128 b, uint128 maxPercentDelta, uint128 decimals) + external + { + vm.assume(b != 0); + vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); + + vm.expectEmit(false, false, false, true); + emit log("Error: a ~= b not satisfied [int]"); + t._assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, EXPECT_FAIL); + } + + function testAssertApproxEqRelDecimal_IntErr_Pass(int128 a, int128 b, uint128 maxPercentDelta, uint128 decimals) + external + { + vm.assume(b != 0); + vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); + + t._assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, CUSTOM_ERROR, EXPECT_PASS); + } + + function testAssertApproxEqRelDecimal_IntErr_Fail(int128 a, int128 b, uint128 maxPercentDelta, uint128 decimals) + external + { + vm.assume(b != 0); + vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); + + vm.expectEmit(false, false, false, true); + emit log_named_string("Error", CUSTOM_ERROR); + t._assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, CUSTOM_ERROR, EXPECT_FAIL); + } + + /*////////////////////////////////////////////////////////////////////////// + ASSERT_EQ_CALL + //////////////////////////////////////////////////////////////////////////*/ + + function testFuzz_AssertEqCall_Return_Pass( + bytes memory callDataA, + bytes memory callDataB, + bytes memory returnData, + bool strictRevertData + ) external { + address targetA = address(new TestMockCall(returnData, SHOULD_RETURN)); + address targetB = address(new TestMockCall(returnData, SHOULD_RETURN)); + + t._assertEqCall(targetA, callDataA, targetB, callDataB, strictRevertData, EXPECT_PASS); + } + + function testFuzz_RevertWhenCalled_AssertEqCall_Return_Fail( + bytes memory callDataA, + bytes memory callDataB, + bytes memory returnDataA, + bytes memory returnDataB, + bool strictRevertData + ) external { + vm.assume(keccak256(returnDataA) != keccak256(returnDataB)); + + address targetA = address(new TestMockCall(returnDataA, SHOULD_RETURN)); + address targetB = address(new TestMockCall(returnDataB, SHOULD_RETURN)); + + vm.expectEmit(true, true, true, true); + emit log_named_string("Error", "Call return data does not match"); + t._assertEqCall(targetA, callDataA, targetB, callDataB, strictRevertData, EXPECT_FAIL); + } + + function testFuzz_AssertEqCall_Revert_Pass( + bytes memory callDataA, + bytes memory callDataB, + bytes memory revertDataA, + bytes memory revertDataB + ) external { + address targetA = address(new TestMockCall(revertDataA, SHOULD_REVERT)); + address targetB = address(new TestMockCall(revertDataB, SHOULD_REVERT)); + + t._assertEqCall(targetA, callDataA, targetB, callDataB, NON_STRICT_REVERT_DATA, EXPECT_PASS); + } + + function testFuzz_RevertWhenCalled_AssertEqCall_Revert_Fail( + bytes memory callDataA, + bytes memory callDataB, + bytes memory revertDataA, + bytes memory revertDataB + ) external { + vm.assume(keccak256(revertDataA) != keccak256(revertDataB)); + + address targetA = address(new TestMockCall(revertDataA, SHOULD_REVERT)); + address targetB = address(new TestMockCall(revertDataB, SHOULD_REVERT)); + + vm.expectEmit(true, true, true, true); + emit log_named_string("Error", "Call revert data does not match"); + t._assertEqCall(targetA, callDataA, targetB, callDataB, STRICT_REVERT_DATA, EXPECT_FAIL); + } + + function testFuzz_RevertWhenCalled_AssertEqCall_Fail( + bytes memory callDataA, + bytes memory callDataB, + bytes memory returnDataA, + bytes memory returnDataB, + bool strictRevertData + ) external { + address targetA = address(new TestMockCall(returnDataA, SHOULD_RETURN)); + address targetB = address(new TestMockCall(returnDataB, SHOULD_REVERT)); + + vm.expectEmit(true, true, true, true); + emit log_named_bytes(" Left call return data", returnDataA); + vm.expectEmit(true, true, true, true); + emit log_named_bytes(" Right call revert data", returnDataB); + t._assertEqCall(targetA, callDataA, targetB, callDataB, strictRevertData, EXPECT_FAIL); + + vm.expectEmit(true, true, true, true); + emit log_named_bytes(" Left call revert data", returnDataB); + vm.expectEmit(true, true, true, true); + emit log_named_bytes(" Right call return data", returnDataA); + t._assertEqCall(targetB, callDataB, targetA, callDataA, strictRevertData, EXPECT_FAIL); + } + + /*////////////////////////////////////////////////////////////////////////// + ASSERT_NOT_EQ(BYTES) + //////////////////////////////////////////////////////////////////////////*/ + + function testFuzz_AssertNotEq_Bytes_Pass(bytes32 a, bytes32 b) external { + vm.assume(a != b); + t._assertNotEq(a, b, EXPECT_PASS); + } + + function testFuzz_AssertNotEq_Bytes_Fail(bytes32 a) external { + vm.expectEmit(false, false, false, true); + emit log("Error: a != b not satisfied [bytes32]"); + t._assertNotEq(a, a, EXPECT_FAIL); + } + + function testFuzz_AssertNotEq_BytesErr_Pass(bytes32 a, bytes32 b) external { + vm.assume(a != b); + t._assertNotEq(a, b, CUSTOM_ERROR, EXPECT_PASS); + } + + function testFuzz_AsserNottEq_BytesErr_Fail(bytes32 a) external { + vm.expectEmit(false, false, false, true); + emit log_named_string("Error", CUSTOM_ERROR); + t._assertNotEq(a, a, CUSTOM_ERROR, EXPECT_FAIL); + } + + /*////////////////////////////////////////////////////////////////////////// + ASSERT_NOT_EQ(UINT) + //////////////////////////////////////////////////////////////////////////*/ + + function test_AssertNotEqUint() public { + assertNotEq(uint8(1), uint128(2)); + assertNotEq(uint64(3), uint64(4)); + } + + function testFail_AssertNotEqUint() public { + assertNotEq(uint64(1), uint96(1)); + assertNotEq(uint160(2), uint160(2)); + } +} + +contract TestTest is Test { + modifier expectFailure(bool expectFail) { + bool preState = vm.load(HEVM_ADDRESS, bytes32("failed")) != bytes32(0x00); + _; + bool postState = vm.load(HEVM_ADDRESS, bytes32("failed")) != bytes32(0x00); + + if (preState == true) { + return; + } + + if (expectFail) { + require(postState == true, "expected failure not triggered"); + + // unwind the expected failure + vm.store(HEVM_ADDRESS, bytes32("failed"), bytes32(uint256(0x00))); + } else { + require(postState == false, "unexpected failure was triggered"); + } + } + + function _fail(string memory err) external expectFailure(true) { + fail(err); + } + + function _assertFalse(bool data, bool expectFail) external expectFailure(expectFail) { + assertFalse(data); + } + + function _assertFalse(bool data, string memory err, bool expectFail) external expectFailure(expectFail) { + assertFalse(data, err); + } + + function _assertEq(bool a, bool b, bool expectFail) external expectFailure(expectFail) { + assertEq(a, b); + } + + function _assertEq(bool a, bool b, string memory err, bool expectFail) external expectFailure(expectFail) { + assertEq(a, b, err); + } + + function _assertEq(bytes memory a, bytes memory b, bool expectFail) external expectFailure(expectFail) { + assertEq(a, b); + } + + function _assertEq(bytes memory a, bytes memory b, string memory err, bool expectFail) + external + expectFailure(expectFail) + { + assertEq(a, b, err); + } + + function _assertEq(uint256[] memory a, uint256[] memory b, bool expectFail) external expectFailure(expectFail) { + assertEq(a, b); + } + + function _assertEq(int256[] memory a, int256[] memory b, bool expectFail) external expectFailure(expectFail) { + assertEq(a, b); + } + + function _assertEq(address[] memory a, address[] memory b, bool expectFail) external expectFailure(expectFail) { + assertEq(a, b); + } + + function _assertEq(uint256[] memory a, uint256[] memory b, string memory err, bool expectFail) + external + expectFailure(expectFail) + { + assertEq(a, b, err); + } + + function _assertEq(int256[] memory a, int256[] memory b, string memory err, bool expectFail) + external + expectFailure(expectFail) + { + assertEq(a, b, err); + } + + function _assertEq(address[] memory a, address[] memory b, string memory err, bool expectFail) + external + expectFailure(expectFail) + { + assertEq(a, b, err); + } + + function _assertNotEq(bytes32 a, bytes32 b, bool expectFail) external expectFailure(expectFail) { + assertNotEq32(a, b); + } + + function _assertNotEq(bytes32 a, bytes32 b, string memory err, bool expectFail) + external + expectFailure(expectFail) + { + assertNotEq32(a, b, err); + } + + function _assertApproxEqAbs(uint256 a, uint256 b, uint256 maxDelta, bool expectFail) + external + expectFailure(expectFail) + { + assertApproxEqAbs(a, b, maxDelta); + } + + function _assertApproxEqAbs(uint256 a, uint256 b, uint256 maxDelta, string memory err, bool expectFail) + external + expectFailure(expectFail) + { + assertApproxEqAbs(a, b, maxDelta, err); + } + + function _assertApproxEqAbsDecimal(uint256 a, uint256 b, uint256 maxDelta, uint256 decimals, bool expectFail) + external + expectFailure(expectFail) + { + assertApproxEqAbsDecimal(a, b, maxDelta, decimals); + } + + function _assertApproxEqAbsDecimal( + uint256 a, + uint256 b, + uint256 maxDelta, + uint256 decimals, + string memory err, + bool expectFail + ) external expectFailure(expectFail) { + assertApproxEqAbsDecimal(a, b, maxDelta, decimals, err); + } + + function _assertApproxEqAbs(int256 a, int256 b, uint256 maxDelta, bool expectFail) + external + expectFailure(expectFail) + { + assertApproxEqAbs(a, b, maxDelta); + } + + function _assertApproxEqAbs(int256 a, int256 b, uint256 maxDelta, string memory err, bool expectFail) + external + expectFailure(expectFail) + { + assertApproxEqAbs(a, b, maxDelta, err); + } + + function _assertApproxEqAbsDecimal(int256 a, int256 b, uint256 maxDelta, uint256 decimals, bool expectFail) + external + expectFailure(expectFail) + { + assertApproxEqAbsDecimal(a, b, maxDelta, decimals); + } + + function _assertApproxEqAbsDecimal( + int256 a, + int256 b, + uint256 maxDelta, + uint256 decimals, + string memory err, + bool expectFail + ) external expectFailure(expectFail) { + assertApproxEqAbsDecimal(a, b, maxDelta, decimals, err); + } + + function _assertApproxEqRel(uint256 a, uint256 b, uint256 maxPercentDelta, bool expectFail) + external + expectFailure(expectFail) + { + assertApproxEqRel(a, b, maxPercentDelta); + } + + function _assertApproxEqRel(uint256 a, uint256 b, uint256 maxPercentDelta, string memory err, bool expectFail) + external + expectFailure(expectFail) + { + assertApproxEqRel(a, b, maxPercentDelta, err); + } + + function _assertApproxEqRelDecimal(uint256 a, uint256 b, uint256 maxPercentDelta, uint256 decimals, bool expectFail) + external + expectFailure(expectFail) + { + assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals); + } + + function _assertApproxEqRelDecimal( + uint256 a, + uint256 b, + uint256 maxPercentDelta, + uint256 decimals, + string memory err, + bool expectFail + ) external expectFailure(expectFail) { + assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, err); + } + + function _assertApproxEqRel(int256 a, int256 b, uint256 maxPercentDelta, bool expectFail) + external + expectFailure(expectFail) + { + assertApproxEqRel(a, b, maxPercentDelta); + } + + function _assertApproxEqRel(int256 a, int256 b, uint256 maxPercentDelta, string memory err, bool expectFail) + external + expectFailure(expectFail) + { + assertApproxEqRel(a, b, maxPercentDelta, err); + } + + function _assertApproxEqRelDecimal(int256 a, int256 b, uint256 maxPercentDelta, uint256 decimals, bool expectFail) + external + expectFailure(expectFail) + { + assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals); + } + + function _assertApproxEqRelDecimal( + int256 a, + int256 b, + uint256 maxPercentDelta, + uint256 decimals, + string memory err, + bool expectFail + ) external expectFailure(expectFail) { + assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, err); + } + + function _assertEqCall( + address targetA, + bytes memory callDataA, + address targetB, + bytes memory callDataB, + bool strictRevertData, + bool expectFail + ) external expectFailure(expectFail) { + assertEqCall(targetA, callDataA, targetB, callDataB, strictRevertData); + } +} + +contract TestMockCall { + bytes returnData; + bool shouldRevert; + + constructor(bytes memory returnData_, bool shouldRevert_) { + returnData = returnData_; + shouldRevert = shouldRevert_; + } + + fallback() external payable { + bytes memory returnData_ = returnData; + + if (shouldRevert) { + assembly { + revert(add(returnData_, 0x20), mload(returnData_)) + } + } else { + assembly { + return(add(returnData_, 0x20), mload(returnData_)) + } + } + } +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/test/StdChains.t.sol b/harness/solidity_sized_tx_contract/lib/forge-std/test/StdChains.t.sol new file mode 100644 index 00000000..b329125e --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/test/StdChains.t.sol @@ -0,0 +1,216 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.7.0 <0.9.0; + +import "../src/Test.sol"; + +contract StdChainsMock is Test { + function exposed_getChain(string memory chainAlias) public returns (Chain memory) { + return getChain(chainAlias); + } + + function exposed_getChain(uint256 chainId) public returns (Chain memory) { + return getChain(chainId); + } + + function exposed_setChain(string memory chainAlias, ChainData memory chainData) public { + setChain(chainAlias, chainData); + } + + function exposed_setFallbackToDefaultRpcUrls(bool useDefault) public { + setFallbackToDefaultRpcUrls(useDefault); + } +} + +contract StdChainsTest is Test { + function test_ChainRpcInitialization() public { + // RPCs specified in `foundry.toml` should be updated. + assertEq(getChain(1).rpcUrl, "https://mainnet.infura.io/v3/b1d3925804e74152b316ca7da97060d3"); + assertEq(getChain("optimism_goerli").rpcUrl, "https://goerli.optimism.io/"); + assertEq(getChain("arbitrum_one_goerli").rpcUrl, "https://goerli-rollup.arbitrum.io/rpc/"); + + // Environment variables should be the next fallback + assertEq(getChain("arbitrum_nova").rpcUrl, "https://nova.arbitrum.io/rpc"); + vm.setEnv("ARBITRUM_NOVA_RPC_URL", "myoverride"); + assertEq(getChain("arbitrum_nova").rpcUrl, "myoverride"); + vm.setEnv("ARBITRUM_NOVA_RPC_URL", "https://nova.arbitrum.io/rpc"); + + // Cannot override RPCs defined in `foundry.toml` + vm.setEnv("MAINNET_RPC_URL", "myoverride2"); + assertEq(getChain("mainnet").rpcUrl, "https://mainnet.infura.io/v3/b1d3925804e74152b316ca7da97060d3"); + + // Other RPCs should remain unchanged. + assertEq(getChain(31337).rpcUrl, "http://127.0.0.1:8545"); + assertEq(getChain("sepolia").rpcUrl, "https://sepolia.infura.io/v3/b9794ad1ddf84dfb8c34d6bb5dca2001"); + } + + function testFuzz_Rpc(string memory rpcAlias) internal { + string memory rpcUrl = getChain(rpcAlias).rpcUrl; + vm.createSelectFork(rpcUrl); + } + + // Ensure we can connect to the default RPC URL for each chain. + // function testRpcs() public { + // testRpc("mainnet"); + // testRpc("goerli"); + // testRpc("sepolia"); + // testRpc("optimism"); + // testRpc("optimism_goerli"); + // testRpc("arbitrum_one"); + // testRpc("arbitrum_one_goerli"); + // testRpc("arbitrum_nova"); + // testRpc("polygon"); + // testRpc("polygon_mumbai"); + // testRpc("avalanche"); + // testRpc("avalanche_fuji"); + // testRpc("bnb_smart_chain"); + // testRpc("bnb_smart_chain_testnet"); + // testRpc("gnosis_chain"); + // testRpc("moonbeam"); + // testRpc("moonriver"); + // testRpc("moonbase"); + // testRpc("base_goerli"); + // testRpc("base"); + // } + + function test_ChainNoDefault() public { + // We deploy a mock to properly test the revert. + StdChainsMock stdChainsMock = new StdChainsMock(); + + vm.expectRevert("StdChains getChain(string): Chain with alias \"does_not_exist\" not found."); + stdChainsMock.exposed_getChain("does_not_exist"); + } + + function test_SetChainFirstFails() public { + // We deploy a mock to properly test the revert. + StdChainsMock stdChainsMock = new StdChainsMock(); + + vm.expectRevert("StdChains setChain(string,ChainData): Chain ID 31337 already used by \"anvil\"."); + stdChainsMock.exposed_setChain("anvil2", ChainData("Anvil", 31337, "URL")); + } + + function test_ChainBubbleUp() public { + // We deploy a mock to properly test the revert. + StdChainsMock stdChainsMock = new StdChainsMock(); + + stdChainsMock.exposed_setChain("needs_undefined_env_var", ChainData("", 123456789, "")); + vm.expectRevert( + "Failed to resolve env var `UNDEFINED_RPC_URL_PLACEHOLDER` in `${UNDEFINED_RPC_URL_PLACEHOLDER}`: environment variable not found" + ); + stdChainsMock.exposed_getChain("needs_undefined_env_var"); + } + + function test_CannotSetChain_ChainIdExists() public { + // We deploy a mock to properly test the revert. + StdChainsMock stdChainsMock = new StdChainsMock(); + + stdChainsMock.exposed_setChain("custom_chain", ChainData("Custom Chain", 123456789, "https://custom.chain/")); + + vm.expectRevert('StdChains setChain(string,ChainData): Chain ID 123456789 already used by "custom_chain".'); + + stdChainsMock.exposed_setChain("another_custom_chain", ChainData("", 123456789, "")); + } + + function test_SetChain() public { + setChain("custom_chain", ChainData("Custom Chain", 123456789, "https://custom.chain/")); + Chain memory customChain = getChain("custom_chain"); + assertEq(customChain.name, "Custom Chain"); + assertEq(customChain.chainId, 123456789); + assertEq(customChain.chainAlias, "custom_chain"); + assertEq(customChain.rpcUrl, "https://custom.chain/"); + Chain memory chainById = getChain(123456789); + assertEq(chainById.name, customChain.name); + assertEq(chainById.chainId, customChain.chainId); + assertEq(chainById.chainAlias, customChain.chainAlias); + assertEq(chainById.rpcUrl, customChain.rpcUrl); + customChain.name = "Another Custom Chain"; + customChain.chainId = 987654321; + setChain("another_custom_chain", customChain); + Chain memory anotherCustomChain = getChain("another_custom_chain"); + assertEq(anotherCustomChain.name, "Another Custom Chain"); + assertEq(anotherCustomChain.chainId, 987654321); + assertEq(anotherCustomChain.chainAlias, "another_custom_chain"); + assertEq(anotherCustomChain.rpcUrl, "https://custom.chain/"); + // Verify the first chain data was not overwritten + chainById = getChain(123456789); + assertEq(chainById.name, "Custom Chain"); + assertEq(chainById.chainId, 123456789); + } + + function test_SetNoEmptyAlias() public { + // We deploy a mock to properly test the revert. + StdChainsMock stdChainsMock = new StdChainsMock(); + + vm.expectRevert("StdChains setChain(string,ChainData): Chain alias cannot be the empty string."); + stdChainsMock.exposed_setChain("", ChainData("", 123456789, "")); + } + + function test_SetNoChainId0() public { + // We deploy a mock to properly test the revert. + StdChainsMock stdChainsMock = new StdChainsMock(); + + vm.expectRevert("StdChains setChain(string,ChainData): Chain ID cannot be 0."); + stdChainsMock.exposed_setChain("alias", ChainData("", 0, "")); + } + + function test_GetNoChainId0() public { + // We deploy a mock to properly test the revert. + StdChainsMock stdChainsMock = new StdChainsMock(); + + vm.expectRevert("StdChains getChain(uint256): Chain ID cannot be 0."); + stdChainsMock.exposed_getChain(0); + } + + function test_GetNoEmptyAlias() public { + // We deploy a mock to properly test the revert. + StdChainsMock stdChainsMock = new StdChainsMock(); + + vm.expectRevert("StdChains getChain(string): Chain alias cannot be the empty string."); + stdChainsMock.exposed_getChain(""); + } + + function test_ChainIdNotFound() public { + // We deploy a mock to properly test the revert. + StdChainsMock stdChainsMock = new StdChainsMock(); + + vm.expectRevert("StdChains getChain(string): Chain with alias \"no_such_alias\" not found."); + stdChainsMock.exposed_getChain("no_such_alias"); + } + + function test_ChainAliasNotFound() public { + // We deploy a mock to properly test the revert. + StdChainsMock stdChainsMock = new StdChainsMock(); + + vm.expectRevert("StdChains getChain(uint256): Chain with ID 321 not found."); + + stdChainsMock.exposed_getChain(321); + } + + function test_SetChain_ExistingOne() public { + // We deploy a mock to properly test the revert. + StdChainsMock stdChainsMock = new StdChainsMock(); + + setChain("custom_chain", ChainData("Custom Chain", 123456789, "https://custom.chain/")); + assertEq(getChain(123456789).chainId, 123456789); + + setChain("custom_chain", ChainData("Modified Chain", 999999999, "https://modified.chain/")); + vm.expectRevert("StdChains getChain(uint256): Chain with ID 123456789 not found."); + stdChainsMock.exposed_getChain(123456789); + + Chain memory modifiedChain = getChain(999999999); + assertEq(modifiedChain.name, "Modified Chain"); + assertEq(modifiedChain.chainId, 999999999); + assertEq(modifiedChain.rpcUrl, "https://modified.chain/"); + } + + function test_DontUseDefaultRpcUrl() public { + // We deploy a mock to properly test the revert. + StdChainsMock stdChainsMock = new StdChainsMock(); + + // Should error if default RPCs flag is set to false. + stdChainsMock.exposed_setFallbackToDefaultRpcUrls(false); + vm.expectRevert(); + stdChainsMock.exposed_getChain(31337); + vm.expectRevert(); + stdChainsMock.exposed_getChain("sepolia"); + } +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/test/StdCheats.t.sol b/harness/solidity_sized_tx_contract/lib/forge-std/test/StdCheats.t.sol new file mode 100644 index 00000000..e94923c7 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/test/StdCheats.t.sol @@ -0,0 +1,610 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.7.0 <0.9.0; + +import "../src/StdCheats.sol"; +import "../src/Test.sol"; +import "../src/StdJson.sol"; + +contract StdCheatsTest is Test { + Bar test; + + using stdJson for string; + + function setUp() public { + test = new Bar(); + } + + function test_Skip() public { + vm.warp(100); + skip(25); + assertEq(block.timestamp, 125); + } + + function test_Rewind() public { + vm.warp(100); + rewind(25); + assertEq(block.timestamp, 75); + } + + function test_Hoax() public { + hoax(address(1337)); + test.bar{value: 100}(address(1337)); + } + + function test_HoaxOrigin() public { + hoax(address(1337), address(1337)); + test.origin{value: 100}(address(1337)); + } + + function test_HoaxDifferentAddresses() public { + hoax(address(1337), address(7331)); + test.origin{value: 100}(address(1337), address(7331)); + } + + function test_StartHoax() public { + startHoax(address(1337)); + test.bar{value: 100}(address(1337)); + test.bar{value: 100}(address(1337)); + vm.stopPrank(); + test.bar(address(this)); + } + + function test_StartHoaxOrigin() public { + startHoax(address(1337), address(1337)); + test.origin{value: 100}(address(1337)); + test.origin{value: 100}(address(1337)); + vm.stopPrank(); + test.bar(address(this)); + } + + function test_ChangePrankMsgSender() public { + vm.startPrank(address(1337)); + test.bar(address(1337)); + changePrank(address(0xdead)); + test.bar(address(0xdead)); + changePrank(address(1337)); + test.bar(address(1337)); + vm.stopPrank(); + } + + function test_ChangePrankMsgSenderAndTxOrigin() public { + vm.startPrank(address(1337), address(1338)); + test.origin(address(1337), address(1338)); + changePrank(address(0xdead), address(0xbeef)); + test.origin(address(0xdead), address(0xbeef)); + changePrank(address(1337), address(1338)); + test.origin(address(1337), address(1338)); + vm.stopPrank(); + } + + function test_MakeAccountEquivalence() public { + Account memory account = makeAccount("1337"); + (address addr, uint256 key) = makeAddrAndKey("1337"); + assertEq(account.addr, addr); + assertEq(account.key, key); + } + + function test_MakeAddrEquivalence() public { + (address addr,) = makeAddrAndKey("1337"); + assertEq(makeAddr("1337"), addr); + } + + function test_MakeAddrSigning() public { + (address addr, uint256 key) = makeAddrAndKey("1337"); + bytes32 hash = keccak256("some_message"); + + (uint8 v, bytes32 r, bytes32 s) = vm.sign(key, hash); + assertEq(ecrecover(hash, v, r, s), addr); + } + + function test_Deal() public { + deal(address(this), 1 ether); + assertEq(address(this).balance, 1 ether); + } + + function test_DealToken() public { + Bar barToken = new Bar(); + address bar = address(barToken); + deal(bar, address(this), 10000e18); + assertEq(barToken.balanceOf(address(this)), 10000e18); + } + + function test_DealTokenAdjustTotalSupply() public { + Bar barToken = new Bar(); + address bar = address(barToken); + deal(bar, address(this), 10000e18, true); + assertEq(barToken.balanceOf(address(this)), 10000e18); + assertEq(barToken.totalSupply(), 20000e18); + deal(bar, address(this), 0, true); + assertEq(barToken.balanceOf(address(this)), 0); + assertEq(barToken.totalSupply(), 10000e18); + } + + function test_DealERC1155Token() public { + BarERC1155 barToken = new BarERC1155(); + address bar = address(barToken); + dealERC1155(bar, address(this), 0, 10000e18, false); + assertEq(barToken.balanceOf(address(this), 0), 10000e18); + } + + function test_DealERC1155TokenAdjustTotalSupply() public { + BarERC1155 barToken = new BarERC1155(); + address bar = address(barToken); + dealERC1155(bar, address(this), 0, 10000e18, true); + assertEq(barToken.balanceOf(address(this), 0), 10000e18); + assertEq(barToken.totalSupply(0), 20000e18); + dealERC1155(bar, address(this), 0, 0, true); + assertEq(barToken.balanceOf(address(this), 0), 0); + assertEq(barToken.totalSupply(0), 10000e18); + } + + function test_DealERC721Token() public { + BarERC721 barToken = new BarERC721(); + address bar = address(barToken); + dealERC721(bar, address(2), 1); + assertEq(barToken.balanceOf(address(2)), 1); + assertEq(barToken.balanceOf(address(1)), 0); + dealERC721(bar, address(1), 2); + assertEq(barToken.balanceOf(address(1)), 1); + assertEq(barToken.balanceOf(bar), 1); + } + + function test_DeployCode() public { + address deployed = deployCode("StdCheats.t.sol:Bar", bytes("")); + assertEq(string(getCode(deployed)), string(getCode(address(test)))); + } + + function test_DestroyAccount() public { + // deploy something to destroy it + BarERC721 barToken = new BarERC721(); + address bar = address(barToken); + vm.setNonce(bar, 10); + deal(bar, 100); + + uint256 prevThisBalance = address(this).balance; + uint256 size; + assembly { + size := extcodesize(bar) + } + + assertGt(size, 0); + assertEq(bar.balance, 100); + assertEq(vm.getNonce(bar), 10); + + destroyAccount(bar, address(this)); + assembly { + size := extcodesize(bar) + } + assertEq(address(this).balance, prevThisBalance + 100); + assertEq(vm.getNonce(bar), 0); + assertEq(size, 0); + assertEq(bar.balance, 0); + } + + function test_DeployCodeNoArgs() public { + address deployed = deployCode("StdCheats.t.sol:Bar"); + assertEq(string(getCode(deployed)), string(getCode(address(test)))); + } + + function test_DeployCodeVal() public { + address deployed = deployCode("StdCheats.t.sol:Bar", bytes(""), 1 ether); + assertEq(string(getCode(deployed)), string(getCode(address(test)))); + assertEq(deployed.balance, 1 ether); + } + + function test_DeployCodeValNoArgs() public { + address deployed = deployCode("StdCheats.t.sol:Bar", 1 ether); + assertEq(string(getCode(deployed)), string(getCode(address(test)))); + assertEq(deployed.balance, 1 ether); + } + + // We need this so we can call "this.deployCode" rather than "deployCode" directly + function deployCodeHelper(string memory what) external { + deployCode(what); + } + + function test_DeployCodeFail() public { + vm.expectRevert(bytes("StdCheats deployCode(string): Deployment failed.")); + this.deployCodeHelper("StdCheats.t.sol:RevertingContract"); + } + + function getCode(address who) internal view returns (bytes memory o_code) { + /// @solidity memory-safe-assembly + assembly { + // retrieve the size of the code, this needs assembly + let size := extcodesize(who) + // allocate output byte array - this could also be done without assembly + // by using o_code = new bytes(size) + o_code := mload(0x40) + // new "memory end" including padding + mstore(0x40, add(o_code, and(add(add(size, 0x20), 0x1f), not(0x1f)))) + // store length in memory + mstore(o_code, size) + // actually retrieve the code, this needs assembly + extcodecopy(who, add(o_code, 0x20), 0, size) + } + } + + function test_DeriveRememberKey() public { + string memory mnemonic = "test test test test test test test test test test test junk"; + + (address deployer, uint256 privateKey) = deriveRememberKey(mnemonic, 0); + assertEq(deployer, 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266); + assertEq(privateKey, 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80); + } + + function test_BytesToUint() public { + assertEq(3, bytesToUint_test(hex"03")); + assertEq(2, bytesToUint_test(hex"02")); + assertEq(255, bytesToUint_test(hex"ff")); + assertEq(29625, bytesToUint_test(hex"73b9")); + } + + function test_ParseJsonTxDetail() public { + string memory root = vm.projectRoot(); + string memory path = string.concat(root, "/test/fixtures/broadcast.log.json"); + string memory json = vm.readFile(path); + bytes memory transactionDetails = json.parseRaw(".transactions[0].tx"); + RawTx1559Detail memory rawTxDetail = abi.decode(transactionDetails, (RawTx1559Detail)); + Tx1559Detail memory txDetail = rawToConvertedEIP1559Detail(rawTxDetail); + assertEq(txDetail.from, 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266); + assertEq(txDetail.to, 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512); + assertEq( + txDetail.data, + hex"23e99187000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000013370000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000004" + ); + assertEq(txDetail.nonce, 3); + assertEq(txDetail.txType, 2); + assertEq(txDetail.gas, 29625); + assertEq(txDetail.value, 0); + } + + function test_ReadEIP1559Transaction() public view { + string memory root = vm.projectRoot(); + string memory path = string.concat(root, "/test/fixtures/broadcast.log.json"); + uint256 index = 0; + Tx1559 memory transaction = readTx1559(path, index); + transaction; + } + + function test_ReadEIP1559Transactions() public view { + string memory root = vm.projectRoot(); + string memory path = string.concat(root, "/test/fixtures/broadcast.log.json"); + Tx1559[] memory transactions = readTx1559s(path); + transactions; + } + + function test_ReadReceipt() public { + string memory root = vm.projectRoot(); + string memory path = string.concat(root, "/test/fixtures/broadcast.log.json"); + uint256 index = 5; + Receipt memory receipt = readReceipt(path, index); + assertEq( + receipt.logsBloom, + hex"00000000000800000000000000000010000000000000000000000000000180000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100" + ); + } + + function test_ReadReceipts() public view { + string memory root = vm.projectRoot(); + string memory path = string.concat(root, "/test/fixtures/broadcast.log.json"); + Receipt[] memory receipts = readReceipts(path); + receipts; + } + + function test_GasMeteringModifier() public { + uint256 gas_start_normal = gasleft(); + addInLoop(); + uint256 gas_used_normal = gas_start_normal - gasleft(); + + uint256 gas_start_single = gasleft(); + addInLoopNoGas(); + uint256 gas_used_single = gas_start_single - gasleft(); + + uint256 gas_start_double = gasleft(); + addInLoopNoGasNoGas(); + uint256 gas_used_double = gas_start_double - gasleft(); + + emit log_named_uint("Normal gas", gas_used_normal); + emit log_named_uint("Single modifier gas", gas_used_single); + emit log_named_uint("Double modifier gas", gas_used_double); + assertTrue(gas_used_double + gas_used_single < gas_used_normal); + } + + function addInLoop() internal pure returns (uint256) { + uint256 b; + for (uint256 i; i < 10000; i++) { + b += i; + } + return b; + } + + function addInLoopNoGas() internal noGasMetering returns (uint256) { + return addInLoop(); + } + + function addInLoopNoGasNoGas() internal noGasMetering returns (uint256) { + return addInLoopNoGas(); + } + + function bytesToUint_test(bytes memory b) private pure returns (uint256) { + uint256 number; + for (uint256 i = 0; i < b.length; i++) { + number = number + uint256(uint8(b[i])) * (2 ** (8 * (b.length - (i + 1)))); + } + return number; + } + + function testFuzz_AssumeAddressIsNot(address addr) external { + // skip over Payable and NonPayable enums + for (uint8 i = 2; i < uint8(type(AddressType).max); i++) { + assumeAddressIsNot(addr, AddressType(i)); + } + assertTrue(addr != address(0)); + assertTrue(addr < address(1) || addr > address(9)); + assertTrue(addr != address(vm) || addr != 0x000000000000000000636F6e736F6c652e6c6f67); + } + + function test_AssumePayable() external { + // We deploy a mock version so we can properly test the revert. + StdCheatsMock stdCheatsMock = new StdCheatsMock(); + + // all should revert since these addresses are not payable + + // VM address + vm.expectRevert(); + stdCheatsMock.exposed_assumePayable(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D); + + // Console address + vm.expectRevert(); + stdCheatsMock.exposed_assumePayable(0x000000000000000000636F6e736F6c652e6c6f67); + + // Create2Deployer + vm.expectRevert(); + stdCheatsMock.exposed_assumePayable(0x4e59b44847b379578588920cA78FbF26c0B4956C); + + // all should pass since these addresses are payable + + // vitalik.eth + stdCheatsMock.exposed_assumePayable(0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045); + + // mock payable contract + MockContractPayable cp = new MockContractPayable(); + stdCheatsMock.exposed_assumePayable(address(cp)); + } + + function test_AssumeNotPayable() external { + // We deploy a mock version so we can properly test the revert. + StdCheatsMock stdCheatsMock = new StdCheatsMock(); + + // all should pass since these addresses are not payable + + // VM address + stdCheatsMock.exposed_assumeNotPayable(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D); + + // Console address + stdCheatsMock.exposed_assumeNotPayable(0x000000000000000000636F6e736F6c652e6c6f67); + + // Create2Deployer + stdCheatsMock.exposed_assumeNotPayable(0x4e59b44847b379578588920cA78FbF26c0B4956C); + + // all should revert since these addresses are payable + + // vitalik.eth + vm.expectRevert(); + stdCheatsMock.exposed_assumeNotPayable(0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045); + + // mock payable contract + MockContractPayable cp = new MockContractPayable(); + vm.expectRevert(); + stdCheatsMock.exposed_assumeNotPayable(address(cp)); + } + + function testFuzz_AssumeNotPrecompile(address addr) external { + assumeNotPrecompile(addr, getChain("optimism_goerli").chainId); + assertTrue( + addr < address(1) || (addr > address(9) && addr < address(0x4200000000000000000000000000000000000000)) + || addr > address(0x4200000000000000000000000000000000000800) + ); + } + + function testFuzz_AssumeNotForgeAddress(address addr) external { + assumeNotForgeAddress(addr); + assertTrue( + addr != address(vm) && addr != 0x000000000000000000636F6e736F6c652e6c6f67 + && addr != 0x4e59b44847b379578588920cA78FbF26c0B4956C + ); + } + + function test_CannotDeployCodeTo() external { + vm.expectRevert("StdCheats deployCodeTo(string,bytes,uint256,address): Failed to create runtime bytecode."); + this._revertDeployCodeTo(); + } + + function _revertDeployCodeTo() external { + deployCodeTo("StdCheats.t.sol:RevertingContract", address(0)); + } + + function test_DeployCodeTo() external { + address arbitraryAddress = makeAddr("arbitraryAddress"); + + deployCodeTo( + "StdCheats.t.sol:MockContractWithConstructorArgs", + abi.encode(uint256(6), true, bytes20(arbitraryAddress)), + 1 ether, + arbitraryAddress + ); + + MockContractWithConstructorArgs ct = MockContractWithConstructorArgs(arbitraryAddress); + + assertEq(arbitraryAddress.balance, 1 ether); + assertEq(ct.x(), 6); + assertTrue(ct.y()); + assertEq(ct.z(), bytes20(arbitraryAddress)); + } +} + +contract StdCheatsMock is StdCheats { + function exposed_assumePayable(address addr) external { + assumePayable(addr); + } + + function exposed_assumeNotPayable(address addr) external { + assumeNotPayable(addr); + } + + // We deploy a mock version so we can properly test expected reverts. + function exposed_assumeNotBlacklisted(address token, address addr) external view { + return assumeNotBlacklisted(token, addr); + } +} + +contract StdCheatsForkTest is Test { + address internal constant SHIB = 0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE; + address internal constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48; + address internal constant USDC_BLACKLISTED_USER = 0x1E34A77868E19A6647b1f2F47B51ed72dEDE95DD; + address internal constant USDT = 0xdAC17F958D2ee523a2206206994597C13D831ec7; + address internal constant USDT_BLACKLISTED_USER = 0x8f8a8F4B54a2aAC7799d7bc81368aC27b852822A; + + function setUp() public { + // All tests of the `assumeNotBlacklisted` method are fork tests using live contracts. + vm.createSelectFork({urlOrAlias: "mainnet", blockNumber: 16_428_900}); + } + + function test_CannotAssumeNoBlacklisted_EOA() external { + // We deploy a mock version so we can properly test the revert. + StdCheatsMock stdCheatsMock = new StdCheatsMock(); + address eoa = vm.addr({privateKey: 1}); + vm.expectRevert("StdCheats assumeNotBlacklisted(address,address): Token address is not a contract."); + stdCheatsMock.exposed_assumeNotBlacklisted(eoa, address(0)); + } + + function testFuzz_AssumeNotBlacklisted_TokenWithoutBlacklist(address addr) external { + assumeNotBlacklisted(SHIB, addr); + assertTrue(true); + } + + function test_AssumeNoBlacklisted_USDC() external { + // We deploy a mock version so we can properly test the revert. + StdCheatsMock stdCheatsMock = new StdCheatsMock(); + vm.expectRevert(); + stdCheatsMock.exposed_assumeNotBlacklisted(USDC, USDC_BLACKLISTED_USER); + } + + function testFuzz_AssumeNotBlacklisted_USDC(address addr) external { + assumeNotBlacklisted(USDC, addr); + assertFalse(USDCLike(USDC).isBlacklisted(addr)); + } + + function test_AssumeNoBlacklisted_USDT() external { + // We deploy a mock version so we can properly test the revert. + StdCheatsMock stdCheatsMock = new StdCheatsMock(); + vm.expectRevert(); + stdCheatsMock.exposed_assumeNotBlacklisted(USDT, USDT_BLACKLISTED_USER); + } + + function testFuzz_AssumeNotBlacklisted_USDT(address addr) external { + assumeNotBlacklisted(USDT, addr); + assertFalse(USDTLike(USDT).isBlackListed(addr)); + } +} + +contract Bar { + constructor() payable { + /// `DEAL` STDCHEAT + totalSupply = 10000e18; + balanceOf[address(this)] = totalSupply; + } + + /// `HOAX` and `CHANGEPRANK` STDCHEATS + function bar(address expectedSender) public payable { + require(msg.sender == expectedSender, "!prank"); + } + + function origin(address expectedSender) public payable { + require(msg.sender == expectedSender, "!prank"); + require(tx.origin == expectedSender, "!prank"); + } + + function origin(address expectedSender, address expectedOrigin) public payable { + require(msg.sender == expectedSender, "!prank"); + require(tx.origin == expectedOrigin, "!prank"); + } + + /// `DEAL` STDCHEAT + mapping(address => uint256) public balanceOf; + uint256 public totalSupply; +} + +contract BarERC1155 { + constructor() payable { + /// `DEALERC1155` STDCHEAT + _totalSupply[0] = 10000e18; + _balances[0][address(this)] = _totalSupply[0]; + } + + function balanceOf(address account, uint256 id) public view virtual returns (uint256) { + return _balances[id][account]; + } + + function totalSupply(uint256 id) public view virtual returns (uint256) { + return _totalSupply[id]; + } + + /// `DEALERC1155` STDCHEAT + mapping(uint256 => mapping(address => uint256)) private _balances; + mapping(uint256 => uint256) private _totalSupply; +} + +contract BarERC721 { + constructor() payable { + /// `DEALERC721` STDCHEAT + _owners[1] = address(1); + _balances[address(1)] = 1; + _owners[2] = address(this); + _owners[3] = address(this); + _balances[address(this)] = 2; + } + + function balanceOf(address owner) public view virtual returns (uint256) { + return _balances[owner]; + } + + function ownerOf(uint256 tokenId) public view virtual returns (address) { + address owner = _owners[tokenId]; + return owner; + } + + mapping(uint256 => address) private _owners; + mapping(address => uint256) private _balances; +} + +interface USDCLike { + function isBlacklisted(address) external view returns (bool); +} + +interface USDTLike { + function isBlackListed(address) external view returns (bool); +} + +contract RevertingContract { + constructor() { + revert(); + } +} + +contract MockContractWithConstructorArgs { + uint256 public immutable x; + bool public y; + bytes20 public z; + + constructor(uint256 _x, bool _y, bytes20 _z) payable { + x = _x; + y = _y; + z = _z; + } +} + +contract MockContractPayable { + receive() external payable {} +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/test/StdError.t.sol b/harness/solidity_sized_tx_contract/lib/forge-std/test/StdError.t.sol new file mode 100644 index 00000000..a306eaa7 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/test/StdError.t.sol @@ -0,0 +1,120 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.0 <0.9.0; + +import "../src/StdError.sol"; +import "../src/Test.sol"; + +contract StdErrorsTest is Test { + ErrorsTest test; + + function setUp() public { + test = new ErrorsTest(); + } + + function test_ExpectAssertion() public { + vm.expectRevert(stdError.assertionError); + test.assertionError(); + } + + function test_ExpectArithmetic() public { + vm.expectRevert(stdError.arithmeticError); + test.arithmeticError(10); + } + + function test_ExpectDiv() public { + vm.expectRevert(stdError.divisionError); + test.divError(0); + } + + function test_ExpectMod() public { + vm.expectRevert(stdError.divisionError); + test.modError(0); + } + + function test_ExpectEnum() public { + vm.expectRevert(stdError.enumConversionError); + test.enumConversion(1); + } + + function test_ExpectEncodeStg() public { + vm.expectRevert(stdError.encodeStorageError); + test.encodeStgError(); + } + + function test_ExpectPop() public { + vm.expectRevert(stdError.popError); + test.pop(); + } + + function test_ExpectOOB() public { + vm.expectRevert(stdError.indexOOBError); + test.indexOOBError(1); + } + + function test_ExpectMem() public { + vm.expectRevert(stdError.memOverflowError); + test.mem(); + } + + function test_ExpectIntern() public { + vm.expectRevert(stdError.zeroVarError); + test.intern(); + } +} + +contract ErrorsTest { + enum T { + T1 + } + + uint256[] public someArr; + bytes someBytes; + + function assertionError() public pure { + assert(false); + } + + function arithmeticError(uint256 a) public pure { + a -= 100; + } + + function divError(uint256 a) public pure { + 100 / a; + } + + function modError(uint256 a) public pure { + 100 % a; + } + + function enumConversion(uint256 a) public pure { + T(a); + } + + function encodeStgError() public { + /// @solidity memory-safe-assembly + assembly { + sstore(someBytes.slot, 1) + } + keccak256(someBytes); + } + + function pop() public { + someArr.pop(); + } + + function indexOOBError(uint256 a) public pure { + uint256[] memory t = new uint256[](0); + t[a]; + } + + function mem() public pure { + uint256 l = 2 ** 256 / 32; + new uint256[](l); + } + + function intern() public returns (uint256) { + function(uint256) internal returns (uint256) x; + x(2); + return 7; + } +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/test/StdMath.t.sol b/harness/solidity_sized_tx_contract/lib/forge-std/test/StdMath.t.sol new file mode 100644 index 00000000..6f50638f --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/test/StdMath.t.sol @@ -0,0 +1,212 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.0 <0.9.0; + +import "../src/StdMath.sol"; +import "../src/Test.sol"; + +contract StdMathMock is Test { + function exposed_percentDelta(uint256 a, uint256 b) public pure returns (uint256) { + return stdMath.percentDelta(a, b); + } + + function exposed_percentDelta(int256 a, int256 b) public pure returns (uint256) { + return stdMath.percentDelta(a, b); + } +} + +contract StdMathTest is Test { + function test_GetAbs() external { + assertEq(stdMath.abs(-50), 50); + assertEq(stdMath.abs(50), 50); + assertEq(stdMath.abs(-1337), 1337); + assertEq(stdMath.abs(0), 0); + + assertEq(stdMath.abs(type(int256).min), (type(uint256).max >> 1) + 1); + assertEq(stdMath.abs(type(int256).max), (type(uint256).max >> 1)); + } + + function testFuzz_GetAbs(int256 a) external { + uint256 manualAbs = getAbs(a); + + uint256 abs = stdMath.abs(a); + + assertEq(abs, manualAbs); + } + + function test_GetDelta_Uint() external { + assertEq(stdMath.delta(uint256(0), uint256(0)), 0); + assertEq(stdMath.delta(uint256(0), uint256(1337)), 1337); + assertEq(stdMath.delta(uint256(0), type(uint64).max), type(uint64).max); + assertEq(stdMath.delta(uint256(0), type(uint128).max), type(uint128).max); + assertEq(stdMath.delta(uint256(0), type(uint256).max), type(uint256).max); + + assertEq(stdMath.delta(0, uint256(0)), 0); + assertEq(stdMath.delta(1337, uint256(0)), 1337); + assertEq(stdMath.delta(type(uint64).max, uint256(0)), type(uint64).max); + assertEq(stdMath.delta(type(uint128).max, uint256(0)), type(uint128).max); + assertEq(stdMath.delta(type(uint256).max, uint256(0)), type(uint256).max); + + assertEq(stdMath.delta(1337, uint256(1337)), 0); + assertEq(stdMath.delta(type(uint256).max, type(uint256).max), 0); + assertEq(stdMath.delta(5000, uint256(1250)), 3750); + } + + function testFuzz_GetDelta_Uint(uint256 a, uint256 b) external { + uint256 manualDelta; + if (a > b) { + manualDelta = a - b; + } else { + manualDelta = b - a; + } + + uint256 delta = stdMath.delta(a, b); + + assertEq(delta, manualDelta); + } + + function test_GetDelta_Int() external { + assertEq(stdMath.delta(int256(0), int256(0)), 0); + assertEq(stdMath.delta(int256(0), int256(1337)), 1337); + assertEq(stdMath.delta(int256(0), type(int64).max), type(uint64).max >> 1); + assertEq(stdMath.delta(int256(0), type(int128).max), type(uint128).max >> 1); + assertEq(stdMath.delta(int256(0), type(int256).max), type(uint256).max >> 1); + + assertEq(stdMath.delta(0, int256(0)), 0); + assertEq(stdMath.delta(1337, int256(0)), 1337); + assertEq(stdMath.delta(type(int64).max, int256(0)), type(uint64).max >> 1); + assertEq(stdMath.delta(type(int128).max, int256(0)), type(uint128).max >> 1); + assertEq(stdMath.delta(type(int256).max, int256(0)), type(uint256).max >> 1); + + assertEq(stdMath.delta(-0, int256(0)), 0); + assertEq(stdMath.delta(-1337, int256(0)), 1337); + assertEq(stdMath.delta(type(int64).min, int256(0)), (type(uint64).max >> 1) + 1); + assertEq(stdMath.delta(type(int128).min, int256(0)), (type(uint128).max >> 1) + 1); + assertEq(stdMath.delta(type(int256).min, int256(0)), (type(uint256).max >> 1) + 1); + + assertEq(stdMath.delta(int256(0), -0), 0); + assertEq(stdMath.delta(int256(0), -1337), 1337); + assertEq(stdMath.delta(int256(0), type(int64).min), (type(uint64).max >> 1) + 1); + assertEq(stdMath.delta(int256(0), type(int128).min), (type(uint128).max >> 1) + 1); + assertEq(stdMath.delta(int256(0), type(int256).min), (type(uint256).max >> 1) + 1); + + assertEq(stdMath.delta(1337, int256(1337)), 0); + assertEq(stdMath.delta(type(int256).max, type(int256).max), 0); + assertEq(stdMath.delta(type(int256).min, type(int256).min), 0); + assertEq(stdMath.delta(type(int256).min, type(int256).max), type(uint256).max); + assertEq(stdMath.delta(5000, int256(1250)), 3750); + } + + function testFuzz_GetDelta_Int(int256 a, int256 b) external { + uint256 absA = getAbs(a); + uint256 absB = getAbs(b); + uint256 absDelta = absA > absB ? absA - absB : absB - absA; + + uint256 manualDelta; + if ((a >= 0 && b >= 0) || (a < 0 && b < 0)) { + manualDelta = absDelta; + } + // (a < 0 && b >= 0) || (a >= 0 && b < 0) + else { + manualDelta = absA + absB; + } + + uint256 delta = stdMath.delta(a, b); + + assertEq(delta, manualDelta); + } + + function test_GetPercentDelta_Uint() external { + StdMathMock stdMathMock = new StdMathMock(); + + assertEq(stdMath.percentDelta(uint256(0), uint256(1337)), 1e18); + assertEq(stdMath.percentDelta(uint256(0), type(uint64).max), 1e18); + assertEq(stdMath.percentDelta(uint256(0), type(uint128).max), 1e18); + assertEq(stdMath.percentDelta(uint256(0), type(uint192).max), 1e18); + + assertEq(stdMath.percentDelta(1337, uint256(1337)), 0); + assertEq(stdMath.percentDelta(type(uint192).max, type(uint192).max), 0); + assertEq(stdMath.percentDelta(0, uint256(2500)), 1e18); + assertEq(stdMath.percentDelta(2500, uint256(2500)), 0); + assertEq(stdMath.percentDelta(5000, uint256(2500)), 1e18); + assertEq(stdMath.percentDelta(7500, uint256(2500)), 2e18); + + vm.expectRevert(stdError.divisionError); + stdMathMock.exposed_percentDelta(uint256(1), 0); + } + + function testFuzz_GetPercentDelta_Uint(uint192 a, uint192 b) external { + vm.assume(b != 0); + uint256 manualDelta; + if (a > b) { + manualDelta = a - b; + } else { + manualDelta = b - a; + } + + uint256 manualPercentDelta = manualDelta * 1e18 / b; + uint256 percentDelta = stdMath.percentDelta(a, b); + + assertEq(percentDelta, manualPercentDelta); + } + + function test_GetPercentDelta_Int() external { + // We deploy a mock version so we can properly test the revert. + StdMathMock stdMathMock = new StdMathMock(); + + assertEq(stdMath.percentDelta(int256(0), int256(1337)), 1e18); + assertEq(stdMath.percentDelta(int256(0), -1337), 1e18); + assertEq(stdMath.percentDelta(int256(0), type(int64).min), 1e18); + assertEq(stdMath.percentDelta(int256(0), type(int128).min), 1e18); + assertEq(stdMath.percentDelta(int256(0), type(int192).min), 1e18); + assertEq(stdMath.percentDelta(int256(0), type(int64).max), 1e18); + assertEq(stdMath.percentDelta(int256(0), type(int128).max), 1e18); + assertEq(stdMath.percentDelta(int256(0), type(int192).max), 1e18); + + assertEq(stdMath.percentDelta(1337, int256(1337)), 0); + assertEq(stdMath.percentDelta(type(int192).max, type(int192).max), 0); + assertEq(stdMath.percentDelta(type(int192).min, type(int192).min), 0); + + assertEq(stdMath.percentDelta(type(int192).min, type(int192).max), 2e18); // rounds the 1 wei diff down + assertEq(stdMath.percentDelta(type(int192).max, type(int192).min), 2e18 - 1); // rounds the 1 wei diff down + assertEq(stdMath.percentDelta(0, int256(2500)), 1e18); + assertEq(stdMath.percentDelta(2500, int256(2500)), 0); + assertEq(stdMath.percentDelta(5000, int256(2500)), 1e18); + assertEq(stdMath.percentDelta(7500, int256(2500)), 2e18); + + vm.expectRevert(stdError.divisionError); + stdMathMock.exposed_percentDelta(int256(1), 0); + } + + function testFuzz_GetPercentDelta_Int(int192 a, int192 b) external { + vm.assume(b != 0); + uint256 absA = getAbs(a); + uint256 absB = getAbs(b); + uint256 absDelta = absA > absB ? absA - absB : absB - absA; + + uint256 manualDelta; + if ((a >= 0 && b >= 0) || (a < 0 && b < 0)) { + manualDelta = absDelta; + } + // (a < 0 && b >= 0) || (a >= 0 && b < 0) + else { + manualDelta = absA + absB; + } + + uint256 manualPercentDelta = manualDelta * 1e18 / absB; + uint256 percentDelta = stdMath.percentDelta(a, b); + + assertEq(percentDelta, manualPercentDelta); + } + + /*////////////////////////////////////////////////////////////////////////// + HELPERS + //////////////////////////////////////////////////////////////////////////*/ + + function getAbs(int256 a) private pure returns (uint256) { + if (a < 0) { + return a == type(int256).min ? uint256(type(int256).max) + 1 : uint256(-a); + } + + return uint256(a); + } +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/test/StdStorage.t.sol b/harness/solidity_sized_tx_contract/lib/forge-std/test/StdStorage.t.sol new file mode 100644 index 00000000..0b3ca9b1 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/test/StdStorage.t.sol @@ -0,0 +1,315 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.7.0 <0.9.0; + +import "../src/StdStorage.sol"; +import "../src/Test.sol"; + +contract StdStorageTest is Test { + using stdStorage for StdStorage; + + StorageTest internal test; + + function setUp() public { + test = new StorageTest(); + } + + function test_StorageHidden() public { + assertEq(uint256(keccak256("my.random.var")), stdstore.target(address(test)).sig("hidden()").find()); + } + + function test_StorageObvious() public { + assertEq(uint256(0), stdstore.target(address(test)).sig("exists()").find()); + } + + function test_StorageExtraSload() public { + assertEq(16, stdstore.target(address(test)).sig(test.extra_sload.selector).find()); + } + + function test_StorageCheckedWriteHidden() public { + stdstore.target(address(test)).sig(test.hidden.selector).checked_write(100); + assertEq(uint256(test.hidden()), 100); + } + + function test_StorageCheckedWriteObvious() public { + stdstore.target(address(test)).sig(test.exists.selector).checked_write(100); + assertEq(test.exists(), 100); + } + + function test_StorageCheckedWriteSignedIntegerHidden() public { + stdstore.target(address(test)).sig(test.hidden.selector).checked_write_int(-100); + assertEq(int256(uint256(test.hidden())), -100); + } + + function test_StorageCheckedWriteSignedIntegerObvious() public { + stdstore.target(address(test)).sig(test.tG.selector).checked_write_int(-100); + assertEq(test.tG(), -100); + } + + function test_StorageMapStructA() public { + uint256 slot = + stdstore.target(address(test)).sig(test.map_struct.selector).with_key(address(this)).depth(0).find(); + assertEq(uint256(keccak256(abi.encode(address(this), 4))), slot); + } + + function test_StorageMapStructB() public { + uint256 slot = + stdstore.target(address(test)).sig(test.map_struct.selector).with_key(address(this)).depth(1).find(); + assertEq(uint256(keccak256(abi.encode(address(this), 4))) + 1, slot); + } + + function test_StorageDeepMap() public { + uint256 slot = stdstore.target(address(test)).sig(test.deep_map.selector).with_key(address(this)).with_key( + address(this) + ).find(); + assertEq(uint256(keccak256(abi.encode(address(this), keccak256(abi.encode(address(this), uint256(5)))))), slot); + } + + function test_StorageCheckedWriteDeepMap() public { + stdstore.target(address(test)).sig(test.deep_map.selector).with_key(address(this)).with_key(address(this)) + .checked_write(100); + assertEq(100, test.deep_map(address(this), address(this))); + } + + function test_StorageDeepMapStructA() public { + uint256 slot = stdstore.target(address(test)).sig(test.deep_map_struct.selector).with_key(address(this)) + .with_key(address(this)).depth(0).find(); + assertEq( + bytes32(uint256(keccak256(abi.encode(address(this), keccak256(abi.encode(address(this), uint256(6)))))) + 0), + bytes32(slot) + ); + } + + function test_StorageDeepMapStructB() public { + uint256 slot = stdstore.target(address(test)).sig(test.deep_map_struct.selector).with_key(address(this)) + .with_key(address(this)).depth(1).find(); + assertEq( + bytes32(uint256(keccak256(abi.encode(address(this), keccak256(abi.encode(address(this), uint256(6)))))) + 1), + bytes32(slot) + ); + } + + function test_StorageCheckedWriteDeepMapStructA() public { + stdstore.target(address(test)).sig(test.deep_map_struct.selector).with_key(address(this)).with_key( + address(this) + ).depth(0).checked_write(100); + (uint256 a, uint256 b) = test.deep_map_struct(address(this), address(this)); + assertEq(100, a); + assertEq(0, b); + } + + function test_StorageCheckedWriteDeepMapStructB() public { + stdstore.target(address(test)).sig(test.deep_map_struct.selector).with_key(address(this)).with_key( + address(this) + ).depth(1).checked_write(100); + (uint256 a, uint256 b) = test.deep_map_struct(address(this), address(this)); + assertEq(0, a); + assertEq(100, b); + } + + function test_StorageCheckedWriteMapStructA() public { + stdstore.target(address(test)).sig(test.map_struct.selector).with_key(address(this)).depth(0).checked_write(100); + (uint256 a, uint256 b) = test.map_struct(address(this)); + assertEq(a, 100); + assertEq(b, 0); + } + + function test_StorageCheckedWriteMapStructB() public { + stdstore.target(address(test)).sig(test.map_struct.selector).with_key(address(this)).depth(1).checked_write(100); + (uint256 a, uint256 b) = test.map_struct(address(this)); + assertEq(a, 0); + assertEq(b, 100); + } + + function test_StorageStructA() public { + uint256 slot = stdstore.target(address(test)).sig(test.basic.selector).depth(0).find(); + assertEq(uint256(7), slot); + } + + function test_StorageStructB() public { + uint256 slot = stdstore.target(address(test)).sig(test.basic.selector).depth(1).find(); + assertEq(uint256(7) + 1, slot); + } + + function test_StorageCheckedWriteStructA() public { + stdstore.target(address(test)).sig(test.basic.selector).depth(0).checked_write(100); + (uint256 a, uint256 b) = test.basic(); + assertEq(a, 100); + assertEq(b, 1337); + } + + function test_StorageCheckedWriteStructB() public { + stdstore.target(address(test)).sig(test.basic.selector).depth(1).checked_write(100); + (uint256 a, uint256 b) = test.basic(); + assertEq(a, 1337); + assertEq(b, 100); + } + + function test_StorageMapAddrFound() public { + uint256 slot = stdstore.target(address(test)).sig(test.map_addr.selector).with_key(address(this)).find(); + assertEq(uint256(keccak256(abi.encode(address(this), uint256(1)))), slot); + } + + function test_StorageMapAddrRoot() public { + (uint256 slot, bytes32 key) = + stdstore.target(address(test)).sig(test.map_addr.selector).with_key(address(this)).parent(); + assertEq(address(uint160(uint256(key))), address(this)); + assertEq(uint256(1), slot); + slot = stdstore.target(address(test)).sig(test.map_addr.selector).with_key(address(this)).root(); + assertEq(uint256(1), slot); + } + + function test_StorageMapUintFound() public { + uint256 slot = stdstore.target(address(test)).sig(test.map_uint.selector).with_key(100).find(); + assertEq(uint256(keccak256(abi.encode(100, uint256(2)))), slot); + } + + function test_StorageCheckedWriteMapUint() public { + stdstore.target(address(test)).sig(test.map_uint.selector).with_key(100).checked_write(100); + assertEq(100, test.map_uint(100)); + } + + function test_StorageCheckedWriteMapAddr() public { + stdstore.target(address(test)).sig(test.map_addr.selector).with_key(address(this)).checked_write(100); + assertEq(100, test.map_addr(address(this))); + } + + function test_StorageCheckedWriteMapBool() public { + stdstore.target(address(test)).sig(test.map_bool.selector).with_key(address(this)).checked_write(true); + assertTrue(test.map_bool(address(this))); + } + + function testFail_StorageCheckedWriteMapPacked() public { + // expect PackedSlot error but not external call so cant expectRevert + stdstore.target(address(test)).sig(test.read_struct_lower.selector).with_key(address(uint160(1337))) + .checked_write(100); + } + + function test_StorageCheckedWriteMapPackedSuccess() public { + uint256 full = test.map_packed(address(1337)); + // keep upper 128, set lower 128 to 1337 + full = (full & (uint256((1 << 128) - 1) << 128)) | 1337; + stdstore.target(address(test)).sig(test.map_packed.selector).with_key(address(uint160(1337))).checked_write( + full + ); + assertEq(1337, test.read_struct_lower(address(1337))); + } + + function testFail_StorageConst() public { + // vm.expectRevert(abi.encodeWithSignature("NotStorage(bytes4)", bytes4(keccak256("const()")))); + stdstore.target(address(test)).sig("const()").find(); + } + + function testFail_StorageNativePack() public { + stdstore.target(address(test)).sig(test.tA.selector).find(); + stdstore.target(address(test)).sig(test.tB.selector).find(); + + // these both would fail + stdstore.target(address(test)).sig(test.tC.selector).find(); + stdstore.target(address(test)).sig(test.tD.selector).find(); + } + + function test_StorageReadBytes32() public { + bytes32 val = stdstore.target(address(test)).sig(test.tE.selector).read_bytes32(); + assertEq(val, hex"1337"); + } + + function test_StorageReadBool_False() public { + bool val = stdstore.target(address(test)).sig(test.tB.selector).read_bool(); + assertEq(val, false); + } + + function test_StorageReadBool_True() public { + bool val = stdstore.target(address(test)).sig(test.tH.selector).read_bool(); + assertEq(val, true); + } + + function test_StorageReadBool_Revert() public { + vm.expectRevert("stdStorage read_bool(StdStorage): Cannot decode. Make sure you are reading a bool."); + this.readNonBoolValue(); + } + + function readNonBoolValue() public { + stdstore.target(address(test)).sig(test.tE.selector).read_bool(); + } + + function test_StorageReadAddress() public { + address val = stdstore.target(address(test)).sig(test.tF.selector).read_address(); + assertEq(val, address(1337)); + } + + function test_StorageReadUint() public { + uint256 val = stdstore.target(address(test)).sig(test.exists.selector).read_uint(); + assertEq(val, 1); + } + + function test_StorageReadInt() public { + int256 val = stdstore.target(address(test)).sig(test.tG.selector).read_int(); + assertEq(val, type(int256).min); + } +} + +contract StorageTest { + uint256 public exists = 1; + mapping(address => uint256) public map_addr; + mapping(uint256 => uint256) public map_uint; + mapping(address => uint256) public map_packed; + mapping(address => UnpackedStruct) public map_struct; + mapping(address => mapping(address => uint256)) public deep_map; + mapping(address => mapping(address => UnpackedStruct)) public deep_map_struct; + UnpackedStruct public basic; + + uint248 public tA; + bool public tB; + + bool public tC = false; + uint248 public tD = 1; + + struct UnpackedStruct { + uint256 a; + uint256 b; + } + + mapping(address => bool) public map_bool; + + bytes32 public tE = hex"1337"; + address public tF = address(1337); + int256 public tG = type(int256).min; + bool public tH = true; + bytes32 private tI = ~bytes32(hex"1337"); + + constructor() { + basic = UnpackedStruct({a: 1337, b: 1337}); + + uint256 two = (1 << 128) | 1; + map_packed[msg.sender] = two; + map_packed[address(uint160(1337))] = 1 << 128; + } + + function read_struct_upper(address who) public view returns (uint256) { + return map_packed[who] >> 128; + } + + function read_struct_lower(address who) public view returns (uint256) { + return map_packed[who] & ((1 << 128) - 1); + } + + function hidden() public view returns (bytes32 t) { + bytes32 slot = keccak256("my.random.var"); + /// @solidity memory-safe-assembly + assembly { + t := sload(slot) + } + } + + function const() public pure returns (bytes32 t) { + t = bytes32(hex"1337"); + } + + function extra_sload() public view returns (bytes32 t) { + // trigger read on slot `tE`, and make a staticcall to make sure compiler doesn't optimize this SLOAD away + assembly { + pop(staticcall(gas(), sload(tE.slot), 0, 0, 0, 0)) + } + t = tI; + } +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/test/StdStyle.t.sol b/harness/solidity_sized_tx_contract/lib/forge-std/test/StdStyle.t.sol new file mode 100644 index 00000000..e12c005f --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/test/StdStyle.t.sol @@ -0,0 +1,110 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.7.0 <0.9.0; + +import "../src/Test.sol"; + +contract StdStyleTest is Test { + function test_StyleColor() public pure { + console2.log(StdStyle.red("StdStyle.red String Test")); + console2.log(StdStyle.red(uint256(10e18))); + console2.log(StdStyle.red(int256(-10e18))); + console2.log(StdStyle.red(true)); + console2.log(StdStyle.red(address(0))); + console2.log(StdStyle.redBytes(hex"7109709ECfa91a80626fF3989D68f67F5b1DD12D")); + console2.log(StdStyle.redBytes32("StdStyle.redBytes32")); + console2.log(StdStyle.green("StdStyle.green String Test")); + console2.log(StdStyle.green(uint256(10e18))); + console2.log(StdStyle.green(int256(-10e18))); + console2.log(StdStyle.green(true)); + console2.log(StdStyle.green(address(0))); + console2.log(StdStyle.greenBytes(hex"7109709ECfa91a80626fF3989D68f67F5b1DD12D")); + console2.log(StdStyle.greenBytes32("StdStyle.greenBytes32")); + console2.log(StdStyle.yellow("StdStyle.yellow String Test")); + console2.log(StdStyle.yellow(uint256(10e18))); + console2.log(StdStyle.yellow(int256(-10e18))); + console2.log(StdStyle.yellow(true)); + console2.log(StdStyle.yellow(address(0))); + console2.log(StdStyle.yellowBytes(hex"7109709ECfa91a80626fF3989D68f67F5b1DD12D")); + console2.log(StdStyle.yellowBytes32("StdStyle.yellowBytes32")); + console2.log(StdStyle.blue("StdStyle.blue String Test")); + console2.log(StdStyle.blue(uint256(10e18))); + console2.log(StdStyle.blue(int256(-10e18))); + console2.log(StdStyle.blue(true)); + console2.log(StdStyle.blue(address(0))); + console2.log(StdStyle.blueBytes(hex"7109709ECfa91a80626fF3989D68f67F5b1DD12D")); + console2.log(StdStyle.blueBytes32("StdStyle.blueBytes32")); + console2.log(StdStyle.magenta("StdStyle.magenta String Test")); + console2.log(StdStyle.magenta(uint256(10e18))); + console2.log(StdStyle.magenta(int256(-10e18))); + console2.log(StdStyle.magenta(true)); + console2.log(StdStyle.magenta(address(0))); + console2.log(StdStyle.magentaBytes(hex"7109709ECfa91a80626fF3989D68f67F5b1DD12D")); + console2.log(StdStyle.magentaBytes32("StdStyle.magentaBytes32")); + console2.log(StdStyle.cyan("StdStyle.cyan String Test")); + console2.log(StdStyle.cyan(uint256(10e18))); + console2.log(StdStyle.cyan(int256(-10e18))); + console2.log(StdStyle.cyan(true)); + console2.log(StdStyle.cyan(address(0))); + console2.log(StdStyle.cyanBytes(hex"7109709ECfa91a80626fF3989D68f67F5b1DD12D")); + console2.log(StdStyle.cyanBytes32("StdStyle.cyanBytes32")); + } + + function test_StyleFontWeight() public pure { + console2.log(StdStyle.bold("StdStyle.bold String Test")); + console2.log(StdStyle.bold(uint256(10e18))); + console2.log(StdStyle.bold(int256(-10e18))); + console2.log(StdStyle.bold(address(0))); + console2.log(StdStyle.bold(true)); + console2.log(StdStyle.boldBytes(hex"7109709ECfa91a80626fF3989D68f67F5b1DD12D")); + console2.log(StdStyle.boldBytes32("StdStyle.boldBytes32")); + console2.log(StdStyle.dim("StdStyle.dim String Test")); + console2.log(StdStyle.dim(uint256(10e18))); + console2.log(StdStyle.dim(int256(-10e18))); + console2.log(StdStyle.dim(address(0))); + console2.log(StdStyle.dim(true)); + console2.log(StdStyle.dimBytes(hex"7109709ECfa91a80626fF3989D68f67F5b1DD12D")); + console2.log(StdStyle.dimBytes32("StdStyle.dimBytes32")); + console2.log(StdStyle.italic("StdStyle.italic String Test")); + console2.log(StdStyle.italic(uint256(10e18))); + console2.log(StdStyle.italic(int256(-10e18))); + console2.log(StdStyle.italic(address(0))); + console2.log(StdStyle.italic(true)); + console2.log(StdStyle.italicBytes(hex"7109709ECfa91a80626fF3989D68f67F5b1DD12D")); + console2.log(StdStyle.italicBytes32("StdStyle.italicBytes32")); + console2.log(StdStyle.underline("StdStyle.underline String Test")); + console2.log(StdStyle.underline(uint256(10e18))); + console2.log(StdStyle.underline(int256(-10e18))); + console2.log(StdStyle.underline(address(0))); + console2.log(StdStyle.underline(true)); + console2.log(StdStyle.underlineBytes(hex"7109709ECfa91a80626fF3989D68f67F5b1DD12D")); + console2.log(StdStyle.underlineBytes32("StdStyle.underlineBytes32")); + console2.log(StdStyle.inverse("StdStyle.inverse String Test")); + console2.log(StdStyle.inverse(uint256(10e18))); + console2.log(StdStyle.inverse(int256(-10e18))); + console2.log(StdStyle.inverse(address(0))); + console2.log(StdStyle.inverse(true)); + console2.log(StdStyle.inverseBytes(hex"7109709ECfa91a80626fF3989D68f67F5b1DD12D")); + console2.log(StdStyle.inverseBytes32("StdStyle.inverseBytes32")); + } + + function test_StyleCombined() public pure { + console2.log(StdStyle.red(StdStyle.bold("Red Bold String Test"))); + console2.log(StdStyle.green(StdStyle.dim(uint256(10e18)))); + console2.log(StdStyle.yellow(StdStyle.italic(int256(-10e18)))); + console2.log(StdStyle.blue(StdStyle.underline(address(0)))); + console2.log(StdStyle.magenta(StdStyle.inverse(true))); + } + + function test_StyleCustom() public pure { + console2.log(h1("Custom Style 1")); + console2.log(h2("Custom Style 2")); + } + + function h1(string memory a) private pure returns (string memory) { + return StdStyle.cyan(StdStyle.inverse(StdStyle.bold(a))); + } + + function h2(string memory a) private pure returns (string memory) { + return StdStyle.magenta(StdStyle.bold(StdStyle.underline(a))); + } +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/test/StdUtils.t.sol b/harness/solidity_sized_tx_contract/lib/forge-std/test/StdUtils.t.sol new file mode 100644 index 00000000..80acc254 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/test/StdUtils.t.sol @@ -0,0 +1,342 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.7.0 <0.9.0; + +import "../src/Test.sol"; + +contract StdUtilsMock is StdUtils { + // We deploy a mock version so we can properly test expected reverts. + function exposed_getTokenBalances(address token, address[] memory addresses) + external + returns (uint256[] memory balances) + { + return getTokenBalances(token, addresses); + } + + function exposed_bound(int256 num, int256 min, int256 max) external pure returns (int256) { + return bound(num, min, max); + } + + function exposed_bound(uint256 num, uint256 min, uint256 max) external pure returns (uint256) { + return bound(num, min, max); + } + + function exposed_bytesToUint(bytes memory b) external pure returns (uint256) { + return bytesToUint(b); + } +} + +contract StdUtilsTest is Test { + /*////////////////////////////////////////////////////////////////////////// + BOUND UINT + //////////////////////////////////////////////////////////////////////////*/ + + function test_Bound() public { + assertEq(bound(uint256(5), 0, 4), 0); + assertEq(bound(uint256(0), 69, 69), 69); + assertEq(bound(uint256(0), 68, 69), 68); + assertEq(bound(uint256(10), 150, 190), 174); + assertEq(bound(uint256(300), 2800, 3200), 3107); + assertEq(bound(uint256(9999), 1337, 6666), 4669); + } + + function test_Bound_WithinRange() public { + assertEq(bound(uint256(51), 50, 150), 51); + assertEq(bound(uint256(51), 50, 150), bound(bound(uint256(51), 50, 150), 50, 150)); + assertEq(bound(uint256(149), 50, 150), 149); + assertEq(bound(uint256(149), 50, 150), bound(bound(uint256(149), 50, 150), 50, 150)); + } + + function test_Bound_EdgeCoverage() public { + assertEq(bound(uint256(0), 50, 150), 50); + assertEq(bound(uint256(1), 50, 150), 51); + assertEq(bound(uint256(2), 50, 150), 52); + assertEq(bound(uint256(3), 50, 150), 53); + assertEq(bound(type(uint256).max, 50, 150), 150); + assertEq(bound(type(uint256).max - 1, 50, 150), 149); + assertEq(bound(type(uint256).max - 2, 50, 150), 148); + assertEq(bound(type(uint256).max - 3, 50, 150), 147); + } + + function test_Bound_DistributionIsEven(uint256 min, uint256 size) public { + size = size % 100 + 1; + min = bound(min, UINT256_MAX / 2, UINT256_MAX / 2 + size); + uint256 max = min + size - 1; + uint256 result; + + for (uint256 i = 1; i <= size * 4; ++i) { + // x > max + result = bound(max + i, min, max); + assertEq(result, min + (i - 1) % size); + // x < min + result = bound(min - i, min, max); + assertEq(result, max - (i - 1) % size); + } + } + + function test_Bound(uint256 num, uint256 min, uint256 max) public { + if (min > max) (min, max) = (max, min); + + uint256 result = bound(num, min, max); + + assertGe(result, min); + assertLe(result, max); + assertEq(result, bound(result, min, max)); + if (num >= min && num <= max) assertEq(result, num); + } + + function test_BoundUint256Max() public { + assertEq(bound(0, type(uint256).max - 1, type(uint256).max), type(uint256).max - 1); + assertEq(bound(1, type(uint256).max - 1, type(uint256).max), type(uint256).max); + } + + function test_CannotBoundMaxLessThanMin() public { + // We deploy a mock version so we can properly test the revert. + StdUtilsMock stdUtils = new StdUtilsMock(); + + vm.expectRevert(bytes("StdUtils bound(uint256,uint256,uint256): Max is less than min.")); + stdUtils.exposed_bound(uint256(5), 100, 10); + } + + function test_CannotBoundMaxLessThanMin(uint256 num, uint256 min, uint256 max) public { + // We deploy a mock version so we can properly test the revert. + StdUtilsMock stdUtils = new StdUtilsMock(); + + vm.assume(min > max); + vm.expectRevert(bytes("StdUtils bound(uint256,uint256,uint256): Max is less than min.")); + stdUtils.exposed_bound(num, min, max); + } + + /*////////////////////////////////////////////////////////////////////////// + BOUND INT + //////////////////////////////////////////////////////////////////////////*/ + + function test_BoundInt() public { + assertEq(bound(-3, 0, 4), 2); + assertEq(bound(0, -69, -69), -69); + assertEq(bound(0, -69, -68), -68); + assertEq(bound(-10, 150, 190), 154); + assertEq(bound(-300, 2800, 3200), 2908); + assertEq(bound(9999, -1337, 6666), 1995); + } + + function test_BoundInt_WithinRange() public { + assertEq(bound(51, -50, 150), 51); + assertEq(bound(51, -50, 150), bound(bound(51, -50, 150), -50, 150)); + assertEq(bound(149, -50, 150), 149); + assertEq(bound(149, -50, 150), bound(bound(149, -50, 150), -50, 150)); + } + + function test_BoundInt_EdgeCoverage() public { + assertEq(bound(type(int256).min, -50, 150), -50); + assertEq(bound(type(int256).min + 1, -50, 150), -49); + assertEq(bound(type(int256).min + 2, -50, 150), -48); + assertEq(bound(type(int256).min + 3, -50, 150), -47); + assertEq(bound(type(int256).min, 10, 150), 10); + assertEq(bound(type(int256).min + 1, 10, 150), 11); + assertEq(bound(type(int256).min + 2, 10, 150), 12); + assertEq(bound(type(int256).min + 3, 10, 150), 13); + + assertEq(bound(type(int256).max, -50, 150), 150); + assertEq(bound(type(int256).max - 1, -50, 150), 149); + assertEq(bound(type(int256).max - 2, -50, 150), 148); + assertEq(bound(type(int256).max - 3, -50, 150), 147); + assertEq(bound(type(int256).max, -50, -10), -10); + assertEq(bound(type(int256).max - 1, -50, -10), -11); + assertEq(bound(type(int256).max - 2, -50, -10), -12); + assertEq(bound(type(int256).max - 3, -50, -10), -13); + } + + function test_BoundInt_DistributionIsEven(int256 min, uint256 size) public { + size = size % 100 + 1; + min = bound(min, -int256(size / 2), int256(size - size / 2)); + int256 max = min + int256(size) - 1; + int256 result; + + for (uint256 i = 1; i <= size * 4; ++i) { + // x > max + result = bound(max + int256(i), min, max); + assertEq(result, min + int256((i - 1) % size)); + // x < min + result = bound(min - int256(i), min, max); + assertEq(result, max - int256((i - 1) % size)); + } + } + + function test_BoundInt(int256 num, int256 min, int256 max) public { + if (min > max) (min, max) = (max, min); + + int256 result = bound(num, min, max); + + assertGe(result, min); + assertLe(result, max); + assertEq(result, bound(result, min, max)); + if (num >= min && num <= max) assertEq(result, num); + } + + function test_BoundIntInt256Max() public { + assertEq(bound(0, type(int256).max - 1, type(int256).max), type(int256).max - 1); + assertEq(bound(1, type(int256).max - 1, type(int256).max), type(int256).max); + } + + function test_BoundIntInt256Min() public { + assertEq(bound(0, type(int256).min, type(int256).min + 1), type(int256).min); + assertEq(bound(1, type(int256).min, type(int256).min + 1), type(int256).min + 1); + } + + function test_CannotBoundIntMaxLessThanMin() public { + // We deploy a mock version so we can properly test the revert. + StdUtilsMock stdUtils = new StdUtilsMock(); + + vm.expectRevert(bytes("StdUtils bound(int256,int256,int256): Max is less than min.")); + stdUtils.exposed_bound(-5, 100, 10); + } + + function test_CannotBoundIntMaxLessThanMin(int256 num, int256 min, int256 max) public { + // We deploy a mock version so we can properly test the revert. + StdUtilsMock stdUtils = new StdUtilsMock(); + + vm.assume(min > max); + vm.expectRevert(bytes("StdUtils bound(int256,int256,int256): Max is less than min.")); + stdUtils.exposed_bound(num, min, max); + } + + /*////////////////////////////////////////////////////////////////////////// + BOUND PRIVATE KEY + //////////////////////////////////////////////////////////////////////////*/ + + function test_BoundPrivateKey() public { + assertEq(boundPrivateKey(0), 1); + assertEq(boundPrivateKey(1), 1); + assertEq(boundPrivateKey(300), 300); + assertEq(boundPrivateKey(9999), 9999); + assertEq(boundPrivateKey(SECP256K1_ORDER - 1), SECP256K1_ORDER - 1); + assertEq(boundPrivateKey(SECP256K1_ORDER), 1); + assertEq(boundPrivateKey(SECP256K1_ORDER + 1), 2); + assertEq(boundPrivateKey(UINT256_MAX), UINT256_MAX & SECP256K1_ORDER - 1); // x&y is equivalent to x-x%y + } + + /*////////////////////////////////////////////////////////////////////////// + BYTES TO UINT + //////////////////////////////////////////////////////////////////////////*/ + + function test_BytesToUint() external { + bytes memory maxUint = hex"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"; + bytes memory two = hex"02"; + bytes memory millionEther = hex"d3c21bcecceda1000000"; + + assertEq(bytesToUint(maxUint), type(uint256).max); + assertEq(bytesToUint(two), 2); + assertEq(bytesToUint(millionEther), 1_000_000 ether); + } + + function test_CannotConvertGT32Bytes() external { + // We deploy a mock version so we can properly test the revert. + StdUtilsMock stdUtils = new StdUtilsMock(); + + bytes memory thirty3Bytes = hex"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"; + vm.expectRevert("StdUtils bytesToUint(bytes): Bytes length exceeds 32."); + stdUtils.exposed_bytesToUint(thirty3Bytes); + } + + /*////////////////////////////////////////////////////////////////////////// + COMPUTE CREATE ADDRESS + //////////////////////////////////////////////////////////////////////////*/ + + function test_ComputeCreateAddress() external { + address deployer = 0x6C9FC64A53c1b71FB3f9Af64d1ae3A4931A5f4E9; + uint256 nonce = 14; + address createAddress = computeCreateAddress(deployer, nonce); + assertEq(createAddress, 0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45); + } + + /*////////////////////////////////////////////////////////////////////////// + COMPUTE CREATE2 ADDRESS + //////////////////////////////////////////////////////////////////////////*/ + + function test_ComputeCreate2Address() external { + bytes32 salt = bytes32(uint256(31415)); + bytes32 initcodeHash = keccak256(abi.encode(0x6080)); + address deployer = 0x6C9FC64A53c1b71FB3f9Af64d1ae3A4931A5f4E9; + address create2Address = computeCreate2Address(salt, initcodeHash, deployer); + assertEq(create2Address, 0xB147a5d25748fda14b463EB04B111027C290f4d3); + } + + function test_ComputeCreate2AddressWithDefaultDeployer() external { + bytes32 salt = 0xc290c670fde54e5ef686f9132cbc8711e76a98f0333a438a92daa442c71403c0; + bytes32 initcodeHash = hashInitCode(hex"6080", ""); + assertEq(initcodeHash, 0x1a578b7a4b0b5755db6d121b4118d4bc68fe170dca840c59bc922f14175a76b0); + address create2Address = computeCreate2Address(salt, initcodeHash); + assertEq(create2Address, 0xc0ffEe2198a06235aAbFffe5Db0CacF1717f5Ac6); + } +} + +contract StdUtilsForkTest is Test { + /*////////////////////////////////////////////////////////////////////////// + GET TOKEN BALANCES + //////////////////////////////////////////////////////////////////////////*/ + + address internal SHIB = 0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE; + address internal SHIB_HOLDER_0 = 0x855F5981e831D83e6A4b4EBFCAdAa68D92333170; + address internal SHIB_HOLDER_1 = 0x8F509A90c2e47779cA408Fe00d7A72e359229AdA; + address internal SHIB_HOLDER_2 = 0x0e3bbc0D04fF62211F71f3e4C45d82ad76224385; + + address internal USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48; + address internal USDC_HOLDER_0 = 0xDa9CE944a37d218c3302F6B82a094844C6ECEb17; + address internal USDC_HOLDER_1 = 0x3e67F4721E6d1c41a015f645eFa37BEd854fcf52; + + function setUp() public { + // All tests of the `getTokenBalances` method are fork tests using live contracts. + vm.createSelectFork({urlOrAlias: "mainnet", blockNumber: 16_428_900}); + } + + function test_CannotGetTokenBalances_NonTokenContract() external { + // We deploy a mock version so we can properly test the revert. + StdUtilsMock stdUtils = new StdUtilsMock(); + + // The UniswapV2Factory contract has neither a `balanceOf` function nor a fallback function, + // so the `balanceOf` call should revert. + address token = address(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); + address[] memory addresses = new address[](1); + addresses[0] = USDC_HOLDER_0; + + vm.expectRevert("Multicall3: call failed"); + stdUtils.exposed_getTokenBalances(token, addresses); + } + + function test_CannotGetTokenBalances_EOA() external { + // We deploy a mock version so we can properly test the revert. + StdUtilsMock stdUtils = new StdUtilsMock(); + + address eoa = vm.addr({privateKey: 1}); + address[] memory addresses = new address[](1); + addresses[0] = USDC_HOLDER_0; + vm.expectRevert("StdUtils getTokenBalances(address,address[]): Token address is not a contract."); + stdUtils.exposed_getTokenBalances(eoa, addresses); + } + + function test_GetTokenBalances_Empty() external { + address[] memory addresses = new address[](0); + uint256[] memory balances = getTokenBalances(USDC, addresses); + assertEq(balances.length, 0); + } + + function test_GetTokenBalances_USDC() external { + address[] memory addresses = new address[](2); + addresses[0] = USDC_HOLDER_0; + addresses[1] = USDC_HOLDER_1; + uint256[] memory balances = getTokenBalances(USDC, addresses); + assertEq(balances[0], 159_000_000_000_000); + assertEq(balances[1], 131_350_000_000_000); + } + + function test_GetTokenBalances_SHIB() external { + address[] memory addresses = new address[](3); + addresses[0] = SHIB_HOLDER_0; + addresses[1] = SHIB_HOLDER_1; + addresses[2] = SHIB_HOLDER_2; + uint256[] memory balances = getTokenBalances(SHIB, addresses); + assertEq(balances[0], 3_323_256_285_484.42e18); + assertEq(balances[1], 1_271_702_771_149.99999928e18); + assertEq(balances[2], 606_357_106_247e18); + } +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/test/Vm.t.sol b/harness/solidity_sized_tx_contract/lib/forge-std/test/Vm.t.sol new file mode 100644 index 00000000..dcea7673 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/test/Vm.t.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.0 <0.9.0; + +import {Test} from "../src/Test.sol"; +import {Vm, VmSafe} from "../src/Vm.sol"; + +contract VmTest is Test { + // This test ensures that functions are never accidentally removed from a Vm interface, or + // inadvertently moved between Vm and VmSafe. This test must be updated each time a function is + // added to or removed from Vm or VmSafe. + function test_interfaceId() public { + assertEq(type(VmSafe).interfaceId, bytes4(0x7e017c39), "VmSafe"); + assertEq(type(Vm).interfaceId, bytes4(0xd6a02054), "Vm"); + } +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/test/compilation/CompilationScript.sol b/harness/solidity_sized_tx_contract/lib/forge-std/test/compilation/CompilationScript.sol new file mode 100644 index 00000000..e205cfff --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/test/compilation/CompilationScript.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.2 <0.9.0; + +pragma experimental ABIEncoderV2; + +import "../../src/Script.sol"; + +// The purpose of this contract is to benchmark compilation time to avoid accidentally introducing +// a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207 +contract CompilationScript is Script {} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/test/compilation/CompilationScriptBase.sol b/harness/solidity_sized_tx_contract/lib/forge-std/test/compilation/CompilationScriptBase.sol new file mode 100644 index 00000000..ce8e0e95 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/test/compilation/CompilationScriptBase.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.2 <0.9.0; + +pragma experimental ABIEncoderV2; + +import "../../src/Script.sol"; + +// The purpose of this contract is to benchmark compilation time to avoid accidentally introducing +// a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207 +contract CompilationScriptBase is ScriptBase {} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/test/compilation/CompilationTest.sol b/harness/solidity_sized_tx_contract/lib/forge-std/test/compilation/CompilationTest.sol new file mode 100644 index 00000000..9beeafeb --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/test/compilation/CompilationTest.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.2 <0.9.0; + +pragma experimental ABIEncoderV2; + +import "../../src/Test.sol"; + +// The purpose of this contract is to benchmark compilation time to avoid accidentally introducing +// a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207 +contract CompilationTest is Test {} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/test/compilation/CompilationTestBase.sol b/harness/solidity_sized_tx_contract/lib/forge-std/test/compilation/CompilationTestBase.sol new file mode 100644 index 00000000..e993535b --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/test/compilation/CompilationTestBase.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.2 <0.9.0; + +pragma experimental ABIEncoderV2; + +import "../../src/Test.sol"; + +// The purpose of this contract is to benchmark compilation time to avoid accidentally introducing +// a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207 +contract CompilationTestBase is TestBase {} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/test/fixtures/broadcast.log.json b/harness/solidity_sized_tx_contract/lib/forge-std/test/fixtures/broadcast.log.json new file mode 100644 index 00000000..0a0200bc --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/test/fixtures/broadcast.log.json @@ -0,0 +1,187 @@ +{ + "transactions": [ + { + "hash": "0xc6006863c267735a11476b7f15b15bc718e117e2da114a2be815dd651e1a509f", + "type": "CALL", + "contractName": "Test", + "contractAddress": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", + "function": "multiple_arguments(uint256,address,uint256[]):(uint256)", + "arguments": ["1", "0000000000000000000000000000000000001337", "[3,4]"], + "tx": { + "type": "0x02", + "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", + "to": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", + "gas": "0x73b9", + "value": "0x0", + "data": "0x23e99187000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000013370000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000004", + "nonce": "0x3", + "accessList": [] + } + }, + { + "hash": "0xedf2b38d8d896519a947a1acf720f859bb35c0c5ecb8dd7511995b67b9853298", + "type": "CALL", + "contractName": "Test", + "contractAddress": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", + "function": "inc():(uint256)", + "arguments": [], + "tx": { + "type": "0x02", + "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", + "to": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", + "gas": "0xdcb2", + "value": "0x0", + "data": "0x371303c0", + "nonce": "0x4", + "accessList": [] + } + }, + { + "hash": "0xa57e8e3981a6c861442e46c9471bd19cb3e21f9a8a6c63a72e7b5c47c6675a7c", + "type": "CALL", + "contractName": "Test", + "contractAddress": "0x7c6b4bbe207d642d98d5c537142d85209e585087", + "function": "t(uint256):(uint256)", + "arguments": ["1"], + "tx": { + "type": "0x02", + "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", + "to": "0x7c6b4bbe207d642d98d5c537142d85209e585087", + "gas": "0x8599", + "value": "0x0", + "data": "0xafe29f710000000000000000000000000000000000000000000000000000000000000001", + "nonce": "0x5", + "accessList": [] + } + } + ], + "receipts": [ + { + "transactionHash": "0x481dc86e40bba90403c76f8e144aa9ff04c1da2164299d0298573835f0991181", + "transactionIndex": "0x0", + "blockHash": "0xef0730448490304e5403be0fa8f8ce64f118e9adcca60c07a2ae1ab921d748af", + "blockNumber": "0x1", + "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", + "to": null, + "cumulativeGasUsed": "0x13f3a", + "gasUsed": "0x13f3a", + "contractAddress": "0x5fbdb2315678afecb367f032d93f642f64180aa3", + "logs": [], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "effectiveGasPrice": "0xee6b2800" + }, + { + "transactionHash": "0x6a187183545b8a9e7f1790e847139379bf5622baff2cb43acf3f5c79470af782", + "transactionIndex": "0x0", + "blockHash": "0xf3acb96a90071640c2a8c067ae4e16aad87e634ea8d8bbbb5b352fba86ba0148", + "blockNumber": "0x2", + "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", + "to": null, + "cumulativeGasUsed": "0x45d80", + "gasUsed": "0x45d80", + "contractAddress": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", + "logs": [], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "effectiveGasPrice": "0xee6b2800" + }, + { + "transactionHash": "0x064ad173b4867bdef2fb60060bbdaf01735fbf10414541ea857772974e74ea9d", + "transactionIndex": "0x0", + "blockHash": "0x8373d02109d3ee06a0225f23da4c161c656ccc48fe0fcee931d325508ae73e58", + "blockNumber": "0x3", + "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "cumulativeGasUsed": "0x45feb", + "gasUsed": "0x45feb", + "contractAddress": null, + "logs": [], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "effectiveGasPrice": "0xee6b2800" + }, + { + "transactionHash": "0xc6006863c267735a11476b7f15b15bc718e117e2da114a2be815dd651e1a509f", + "transactionIndex": "0x0", + "blockHash": "0x16712fae5c0e18f75045f84363fb6b4d9a9fe25e660c4ce286833a533c97f629", + "blockNumber": "0x4", + "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", + "to": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", + "cumulativeGasUsed": "0x5905", + "gasUsed": "0x5905", + "contractAddress": null, + "logs": [], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "effectiveGasPrice": "0xee6b2800" + }, + { + "transactionHash": "0xedf2b38d8d896519a947a1acf720f859bb35c0c5ecb8dd7511995b67b9853298", + "transactionIndex": "0x0", + "blockHash": "0x156b88c3eb9a1244ba00a1834f3f70de735b39e3e59006dd03af4fe7d5480c11", + "blockNumber": "0x5", + "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", + "to": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", + "cumulativeGasUsed": "0xa9c4", + "gasUsed": "0xa9c4", + "contractAddress": null, + "logs": [], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "effectiveGasPrice": "0xee6b2800" + }, + { + "transactionHash": "0xa57e8e3981a6c861442e46c9471bd19cb3e21f9a8a6c63a72e7b5c47c6675a7c", + "transactionIndex": "0x0", + "blockHash": "0xcf61faca67dbb2c28952b0b8a379e53b1505ae0821e84779679390cb8571cadb", + "blockNumber": "0x6", + "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", + "to": "0x7c6b4bbe207d642d98d5c537142d85209e585087", + "cumulativeGasUsed": "0x66c5", + "gasUsed": "0x66c5", + "contractAddress": null, + "logs": [ + { + "address": "0x7c6b4bbe207d642d98d5c537142d85209e585087", + "topics": [ + "0x0b2e13ff20ac7b474198655583edf70dedd2c1dc980e329c4fbb2fc0748b796b" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000046865726500000000000000000000000000000000000000000000000000000000", + "blockHash": "0xcf61faca67dbb2c28952b0b8a379e53b1505ae0821e84779679390cb8571cadb", + "blockNumber": "0x6", + "transactionHash": "0xa57e8e3981a6c861442e46c9471bd19cb3e21f9a8a6c63a72e7b5c47c6675a7c", + "transactionIndex": "0x1", + "logIndex": "0x0", + "transactionLogIndex": "0x0", + "removed": false + } + ], + "status": "0x1", + "logsBloom": "0x00000000000800000000000000000010000000000000000000000000000180000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100", + "effectiveGasPrice": "0xee6b2800" + }, + { + "transactionHash": "0x11fbb10230c168ca1e36a7e5c69a6dbcd04fd9e64ede39d10a83e36ee8065c16", + "transactionIndex": "0x0", + "blockHash": "0xf1e0ed2eda4e923626ec74621006ed50b3fc27580dc7b4cf68a07ca77420e29c", + "blockNumber": "0x7", + "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", + "to": "0x0000000000000000000000000000000000001337", + "cumulativeGasUsed": "0x5208", + "gasUsed": "0x5208", + "contractAddress": null, + "logs": [], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "effectiveGasPrice": "0xee6b2800" + } + ], + "libraries": [ + "src/Broadcast.t.sol:F:0x5fbdb2315678afecb367f032d93f642f64180aa3" + ], + "pending": [], + "path": "broadcast/Broadcast.t.sol/31337/run-latest.json", + "returns": {}, + "timestamp": 1655140035 +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/test/mocks/MockERC20.t.sol b/harness/solidity_sized_tx_contract/lib/forge-std/test/mocks/MockERC20.t.sol new file mode 100644 index 00000000..3649e602 --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/test/mocks/MockERC20.t.sol @@ -0,0 +1,441 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.7.0 <0.9.0; + +import {MockERC20} from "../../src/mocks/MockERC20.sol"; +import {StdCheats} from "../../src/StdCheats.sol"; +import {Test} from "../../src/Test.sol"; + +contract Token_ERC20 is MockERC20 { + constructor(string memory name, string memory symbol, uint8 decimals) { + initialize(name, symbol, decimals); + } + + function mint(address to, uint256 value) public virtual { + _mint(to, value); + } + + function burn(address from, uint256 value) public virtual { + _burn(from, value); + } +} + +contract MockERC20Test is StdCheats, Test { + Token_ERC20 token; + + bytes32 constant PERMIT_TYPEHASH = + keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); + + function setUp() public { + token = new Token_ERC20("Token", "TKN", 18); + } + + function invariantMetadata() public { + assertEq(token.name(), "Token"); + assertEq(token.symbol(), "TKN"); + assertEq(token.decimals(), 18); + } + + function testMint() public { + token.mint(address(0xBEEF), 1e18); + + assertEq(token.totalSupply(), 1e18); + assertEq(token.balanceOf(address(0xBEEF)), 1e18); + } + + function testBurn() public { + token.mint(address(0xBEEF), 1e18); + token.burn(address(0xBEEF), 0.9e18); + + assertEq(token.totalSupply(), 1e18 - 0.9e18); + assertEq(token.balanceOf(address(0xBEEF)), 0.1e18); + } + + function testApprove() public { + assertTrue(token.approve(address(0xBEEF), 1e18)); + + assertEq(token.allowance(address(this), address(0xBEEF)), 1e18); + } + + function testTransfer() public { + token.mint(address(this), 1e18); + + assertTrue(token.transfer(address(0xBEEF), 1e18)); + assertEq(token.totalSupply(), 1e18); + + assertEq(token.balanceOf(address(this)), 0); + assertEq(token.balanceOf(address(0xBEEF)), 1e18); + } + + function testTransferFrom() public { + address from = address(0xABCD); + + token.mint(from, 1e18); + + vm.prank(from); + token.approve(address(this), 1e18); + + assertTrue(token.transferFrom(from, address(0xBEEF), 1e18)); + assertEq(token.totalSupply(), 1e18); + + assertEq(token.allowance(from, address(this)), 0); + + assertEq(token.balanceOf(from), 0); + assertEq(token.balanceOf(address(0xBEEF)), 1e18); + } + + function testInfiniteApproveTransferFrom() public { + address from = address(0xABCD); + + token.mint(from, 1e18); + + vm.prank(from); + token.approve(address(this), type(uint256).max); + + assertTrue(token.transferFrom(from, address(0xBEEF), 1e18)); + assertEq(token.totalSupply(), 1e18); + + assertEq(token.allowance(from, address(this)), type(uint256).max); + + assertEq(token.balanceOf(from), 0); + assertEq(token.balanceOf(address(0xBEEF)), 1e18); + } + + function testPermit() public { + uint256 privateKey = 0xBEEF; + address owner = vm.addr(privateKey); + + (uint8 v, bytes32 r, bytes32 s) = vm.sign( + privateKey, + keccak256( + abi.encodePacked( + "\x19\x01", + token.DOMAIN_SEPARATOR(), + keccak256(abi.encode(PERMIT_TYPEHASH, owner, address(0xCAFE), 1e18, 0, block.timestamp)) + ) + ) + ); + + token.permit(owner, address(0xCAFE), 1e18, block.timestamp, v, r, s); + + assertEq(token.allowance(owner, address(0xCAFE)), 1e18); + assertEq(token.nonces(owner), 1); + } + + function testFailTransferInsufficientBalance() public { + token.mint(address(this), 0.9e18); + token.transfer(address(0xBEEF), 1e18); + } + + function testFailTransferFromInsufficientAllowance() public { + address from = address(0xABCD); + + token.mint(from, 1e18); + + vm.prank(from); + token.approve(address(this), 0.9e18); + + token.transferFrom(from, address(0xBEEF), 1e18); + } + + function testFailTransferFromInsufficientBalance() public { + address from = address(0xABCD); + + token.mint(from, 0.9e18); + + vm.prank(from); + token.approve(address(this), 1e18); + + token.transferFrom(from, address(0xBEEF), 1e18); + } + + function testFailPermitBadNonce() public { + uint256 privateKey = 0xBEEF; + address owner = vm.addr(privateKey); + + (uint8 v, bytes32 r, bytes32 s) = vm.sign( + privateKey, + keccak256( + abi.encodePacked( + "\x19\x01", + token.DOMAIN_SEPARATOR(), + keccak256(abi.encode(PERMIT_TYPEHASH, owner, address(0xCAFE), 1e18, 1, block.timestamp)) + ) + ) + ); + + token.permit(owner, address(0xCAFE), 1e18, block.timestamp, v, r, s); + } + + function testFailPermitBadDeadline() public { + uint256 privateKey = 0xBEEF; + address owner = vm.addr(privateKey); + + (uint8 v, bytes32 r, bytes32 s) = vm.sign( + privateKey, + keccak256( + abi.encodePacked( + "\x19\x01", + token.DOMAIN_SEPARATOR(), + keccak256(abi.encode(PERMIT_TYPEHASH, owner, address(0xCAFE), 1e18, 0, block.timestamp)) + ) + ) + ); + + token.permit(owner, address(0xCAFE), 1e18, block.timestamp + 1, v, r, s); + } + + function testFailPermitPastDeadline() public { + uint256 oldTimestamp = block.timestamp; + uint256 privateKey = 0xBEEF; + address owner = vm.addr(privateKey); + + (uint8 v, bytes32 r, bytes32 s) = vm.sign( + privateKey, + keccak256( + abi.encodePacked( + "\x19\x01", + token.DOMAIN_SEPARATOR(), + keccak256(abi.encode(PERMIT_TYPEHASH, owner, address(0xCAFE), 1e18, 0, oldTimestamp)) + ) + ) + ); + + vm.warp(block.timestamp + 1); + token.permit(owner, address(0xCAFE), 1e18, oldTimestamp, v, r, s); + } + + function testFailPermitReplay() public { + uint256 privateKey = 0xBEEF; + address owner = vm.addr(privateKey); + + (uint8 v, bytes32 r, bytes32 s) = vm.sign( + privateKey, + keccak256( + abi.encodePacked( + "\x19\x01", + token.DOMAIN_SEPARATOR(), + keccak256(abi.encode(PERMIT_TYPEHASH, owner, address(0xCAFE), 1e18, 0, block.timestamp)) + ) + ) + ); + + token.permit(owner, address(0xCAFE), 1e18, block.timestamp, v, r, s); + token.permit(owner, address(0xCAFE), 1e18, block.timestamp, v, r, s); + } + + function testMetadata(string calldata name, string calldata symbol, uint8 decimals) public { + Token_ERC20 tkn = new Token_ERC20(name, symbol, decimals); + assertEq(tkn.name(), name); + assertEq(tkn.symbol(), symbol); + assertEq(tkn.decimals(), decimals); + } + + function testMint(address from, uint256 amount) public { + token.mint(from, amount); + + assertEq(token.totalSupply(), amount); + assertEq(token.balanceOf(from), amount); + } + + function testBurn(address from, uint256 mintAmount, uint256 burnAmount) public { + burnAmount = bound(burnAmount, 0, mintAmount); + + token.mint(from, mintAmount); + token.burn(from, burnAmount); + + assertEq(token.totalSupply(), mintAmount - burnAmount); + assertEq(token.balanceOf(from), mintAmount - burnAmount); + } + + function testApprove(address to, uint256 amount) public { + assertTrue(token.approve(to, amount)); + + assertEq(token.allowance(address(this), to), amount); + } + + function testTransfer(address from, uint256 amount) public { + token.mint(address(this), amount); + + assertTrue(token.transfer(from, amount)); + assertEq(token.totalSupply(), amount); + + if (address(this) == from) { + assertEq(token.balanceOf(address(this)), amount); + } else { + assertEq(token.balanceOf(address(this)), 0); + assertEq(token.balanceOf(from), amount); + } + } + + function testTransferFrom(address to, uint256 approval, uint256 amount) public { + amount = bound(amount, 0, approval); + + address from = address(0xABCD); + + token.mint(from, amount); + + vm.prank(from); + token.approve(address(this), approval); + + assertTrue(token.transferFrom(from, to, amount)); + assertEq(token.totalSupply(), amount); + + uint256 app = from == address(this) || approval == type(uint256).max ? approval : approval - amount; + assertEq(token.allowance(from, address(this)), app); + + if (from == to) { + assertEq(token.balanceOf(from), amount); + } else { + assertEq(token.balanceOf(from), 0); + assertEq(token.balanceOf(to), amount); + } + } + + function testPermit(uint248 privKey, address to, uint256 amount, uint256 deadline) public { + uint256 privateKey = privKey; + if (deadline < block.timestamp) deadline = block.timestamp; + if (privateKey == 0) privateKey = 1; + + address owner = vm.addr(privateKey); + + (uint8 v, bytes32 r, bytes32 s) = vm.sign( + privateKey, + keccak256( + abi.encodePacked( + "\x19\x01", + token.DOMAIN_SEPARATOR(), + keccak256(abi.encode(PERMIT_TYPEHASH, owner, to, amount, 0, deadline)) + ) + ) + ); + + token.permit(owner, to, amount, deadline, v, r, s); + + assertEq(token.allowance(owner, to), amount); + assertEq(token.nonces(owner), 1); + } + + function testFailBurnInsufficientBalance(address to, uint256 mintAmount, uint256 burnAmount) public { + burnAmount = bound(burnAmount, mintAmount + 1, type(uint256).max); + + token.mint(to, mintAmount); + token.burn(to, burnAmount); + } + + function testFailTransferInsufficientBalance(address to, uint256 mintAmount, uint256 sendAmount) public { + sendAmount = bound(sendAmount, mintAmount + 1, type(uint256).max); + + token.mint(address(this), mintAmount); + token.transfer(to, sendAmount); + } + + function testFailTransferFromInsufficientAllowance(address to, uint256 approval, uint256 amount) public { + amount = bound(amount, approval + 1, type(uint256).max); + + address from = address(0xABCD); + + token.mint(from, amount); + + vm.prank(from); + token.approve(address(this), approval); + + token.transferFrom(from, to, amount); + } + + function testFailTransferFromInsufficientBalance(address to, uint256 mintAmount, uint256 sendAmount) public { + sendAmount = bound(sendAmount, mintAmount + 1, type(uint256).max); + + address from = address(0xABCD); + + token.mint(from, mintAmount); + + vm.prank(from); + token.approve(address(this), sendAmount); + + token.transferFrom(from, to, sendAmount); + } + + function testFailPermitBadNonce(uint256 privateKey, address to, uint256 amount, uint256 deadline, uint256 nonce) + public + { + if (deadline < block.timestamp) deadline = block.timestamp; + if (privateKey == 0) privateKey = 1; + if (nonce == 0) nonce = 1; + + address owner = vm.addr(privateKey); + + (uint8 v, bytes32 r, bytes32 s) = vm.sign( + privateKey, + keccak256( + abi.encodePacked( + "\x19\x01", + token.DOMAIN_SEPARATOR(), + keccak256(abi.encode(PERMIT_TYPEHASH, owner, to, amount, nonce, deadline)) + ) + ) + ); + + token.permit(owner, to, amount, deadline, v, r, s); + } + + function testFailPermitBadDeadline(uint256 privateKey, address to, uint256 amount, uint256 deadline) public { + if (deadline < block.timestamp) deadline = block.timestamp; + if (privateKey == 0) privateKey = 1; + + address owner = vm.addr(privateKey); + + (uint8 v, bytes32 r, bytes32 s) = vm.sign( + privateKey, + keccak256( + abi.encodePacked( + "\x19\x01", + token.DOMAIN_SEPARATOR(), + keccak256(abi.encode(PERMIT_TYPEHASH, owner, to, amount, 0, deadline)) + ) + ) + ); + + token.permit(owner, to, amount, deadline + 1, v, r, s); + } + + function testFailPermitPastDeadline(uint256 privateKey, address to, uint256 amount, uint256 deadline) public { + deadline = bound(deadline, 0, block.timestamp - 1); + if (privateKey == 0) privateKey = 1; + + address owner = vm.addr(privateKey); + + (uint8 v, bytes32 r, bytes32 s) = vm.sign( + privateKey, + keccak256( + abi.encodePacked( + "\x19\x01", + token.DOMAIN_SEPARATOR(), + keccak256(abi.encode(PERMIT_TYPEHASH, owner, to, amount, 0, deadline)) + ) + ) + ); + + token.permit(owner, to, amount, deadline, v, r, s); + } + + function testFailPermitReplay(uint256 privateKey, address to, uint256 amount, uint256 deadline) public { + if (deadline < block.timestamp) deadline = block.timestamp; + if (privateKey == 0) privateKey = 1; + + address owner = vm.addr(privateKey); + + (uint8 v, bytes32 r, bytes32 s) = vm.sign( + privateKey, + keccak256( + abi.encodePacked( + "\x19\x01", + token.DOMAIN_SEPARATOR(), + keccak256(abi.encode(PERMIT_TYPEHASH, owner, to, amount, 0, deadline)) + ) + ) + ); + + token.permit(owner, to, amount, deadline, v, r, s); + token.permit(owner, to, amount, deadline, v, r, s); + } +} diff --git a/harness/solidity_sized_tx_contract/lib/forge-std/test/mocks/MockERC721.t.sol b/harness/solidity_sized_tx_contract/lib/forge-std/test/mocks/MockERC721.t.sol new file mode 100644 index 00000000..3bf84c9f --- /dev/null +++ b/harness/solidity_sized_tx_contract/lib/forge-std/test/mocks/MockERC721.t.sol @@ -0,0 +1,721 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.7.0 <0.9.0; + +import {MockERC721, IERC721TokenReceiver} from "../../src/mocks/MockERC721.sol"; +import {StdCheats} from "../../src/StdCheats.sol"; +import {Test} from "../../src/Test.sol"; + +contract ERC721Recipient is IERC721TokenReceiver { + address public operator; + address public from; + uint256 public id; + bytes public data; + + function onERC721Received(address _operator, address _from, uint256 _id, bytes calldata _data) + public + virtual + override + returns (bytes4) + { + operator = _operator; + from = _from; + id = _id; + data = _data; + + return IERC721TokenReceiver.onERC721Received.selector; + } +} + +contract RevertingERC721Recipient is IERC721TokenReceiver { + function onERC721Received(address, address, uint256, bytes calldata) public virtual override returns (bytes4) { + revert(string(abi.encodePacked(IERC721TokenReceiver.onERC721Received.selector))); + } +} + +contract WrongReturnDataERC721Recipient is IERC721TokenReceiver { + function onERC721Received(address, address, uint256, bytes calldata) public virtual override returns (bytes4) { + return 0xCAFEBEEF; + } +} + +contract NonERC721Recipient {} + +contract Token_ERC721 is MockERC721 { + constructor(string memory _name, string memory _symbol) { + initialize(_name, _symbol); + } + + function tokenURI(uint256) public pure virtual override returns (string memory) {} + + function mint(address to, uint256 tokenId) public virtual { + _mint(to, tokenId); + } + + function burn(uint256 tokenId) public virtual { + _burn(tokenId); + } + + function safeMint(address to, uint256 tokenId) public virtual { + _safeMint(to, tokenId); + } + + function safeMint(address to, uint256 tokenId, bytes memory data) public virtual { + _safeMint(to, tokenId, data); + } +} + +contract MockERC721Test is StdCheats, Test { + Token_ERC721 token; + + function setUp() public { + token = new Token_ERC721("Token", "TKN"); + } + + function invariantMetadata() public { + assertEq(token.name(), "Token"); + assertEq(token.symbol(), "TKN"); + } + + function testMint() public { + token.mint(address(0xBEEF), 1337); + + assertEq(token.balanceOf(address(0xBEEF)), 1); + assertEq(token.ownerOf(1337), address(0xBEEF)); + } + + function testBurn() public { + token.mint(address(0xBEEF), 1337); + token.burn(1337); + + assertEq(token.balanceOf(address(0xBEEF)), 0); + + vm.expectRevert("NOT_MINTED"); + token.ownerOf(1337); + } + + function testApprove() public { + token.mint(address(this), 1337); + + token.approve(address(0xBEEF), 1337); + + assertEq(token.getApproved(1337), address(0xBEEF)); + } + + function testApproveBurn() public { + token.mint(address(this), 1337); + + token.approve(address(0xBEEF), 1337); + + token.burn(1337); + + assertEq(token.balanceOf(address(this)), 0); + assertEq(token.getApproved(1337), address(0)); + + vm.expectRevert("NOT_MINTED"); + token.ownerOf(1337); + } + + function testApproveAll() public { + token.setApprovalForAll(address(0xBEEF), true); + + assertTrue(token.isApprovedForAll(address(this), address(0xBEEF))); + } + + function testTransferFrom() public { + address from = address(0xABCD); + + token.mint(from, 1337); + + vm.prank(from); + token.approve(address(this), 1337); + + token.transferFrom(from, address(0xBEEF), 1337); + + assertEq(token.getApproved(1337), address(0)); + assertEq(token.ownerOf(1337), address(0xBEEF)); + assertEq(token.balanceOf(address(0xBEEF)), 1); + assertEq(token.balanceOf(from), 0); + } + + function testTransferFromSelf() public { + token.mint(address(this), 1337); + + token.transferFrom(address(this), address(0xBEEF), 1337); + + assertEq(token.getApproved(1337), address(0)); + assertEq(token.ownerOf(1337), address(0xBEEF)); + assertEq(token.balanceOf(address(0xBEEF)), 1); + assertEq(token.balanceOf(address(this)), 0); + } + + function testTransferFromApproveAll() public { + address from = address(0xABCD); + + token.mint(from, 1337); + + vm.prank(from); + token.setApprovalForAll(address(this), true); + + token.transferFrom(from, address(0xBEEF), 1337); + + assertEq(token.getApproved(1337), address(0)); + assertEq(token.ownerOf(1337), address(0xBEEF)); + assertEq(token.balanceOf(address(0xBEEF)), 1); + assertEq(token.balanceOf(from), 0); + } + + function testSafeTransferFromToEOA() public { + address from = address(0xABCD); + + token.mint(from, 1337); + + vm.prank(from); + token.setApprovalForAll(address(this), true); + + token.safeTransferFrom(from, address(0xBEEF), 1337); + + assertEq(token.getApproved(1337), address(0)); + assertEq(token.ownerOf(1337), address(0xBEEF)); + assertEq(token.balanceOf(address(0xBEEF)), 1); + assertEq(token.balanceOf(from), 0); + } + + function testSafeTransferFromToERC721Recipient() public { + address from = address(0xABCD); + ERC721Recipient recipient = new ERC721Recipient(); + + token.mint(from, 1337); + + vm.prank(from); + token.setApprovalForAll(address(this), true); + + token.safeTransferFrom(from, address(recipient), 1337); + + assertEq(token.getApproved(1337), address(0)); + assertEq(token.ownerOf(1337), address(recipient)); + assertEq(token.balanceOf(address(recipient)), 1); + assertEq(token.balanceOf(from), 0); + + assertEq(recipient.operator(), address(this)); + assertEq(recipient.from(), from); + assertEq(recipient.id(), 1337); + assertEq(recipient.data(), ""); + } + + function testSafeTransferFromToERC721RecipientWithData() public { + address from = address(0xABCD); + ERC721Recipient recipient = new ERC721Recipient(); + + token.mint(from, 1337); + + vm.prank(from); + token.setApprovalForAll(address(this), true); + + token.safeTransferFrom(from, address(recipient), 1337, "testing 123"); + + assertEq(token.getApproved(1337), address(0)); + assertEq(token.ownerOf(1337), address(recipient)); + assertEq(token.balanceOf(address(recipient)), 1); + assertEq(token.balanceOf(from), 0); + + assertEq(recipient.operator(), address(this)); + assertEq(recipient.from(), from); + assertEq(recipient.id(), 1337); + assertEq(recipient.data(), "testing 123"); + } + + function testSafeMintToEOA() public { + token.safeMint(address(0xBEEF), 1337); + + assertEq(token.ownerOf(1337), address(address(0xBEEF))); + assertEq(token.balanceOf(address(address(0xBEEF))), 1); + } + + function testSafeMintToERC721Recipient() public { + ERC721Recipient to = new ERC721Recipient(); + + token.safeMint(address(to), 1337); + + assertEq(token.ownerOf(1337), address(to)); + assertEq(token.balanceOf(address(to)), 1); + + assertEq(to.operator(), address(this)); + assertEq(to.from(), address(0)); + assertEq(to.id(), 1337); + assertEq(to.data(), ""); + } + + function testSafeMintToERC721RecipientWithData() public { + ERC721Recipient to = new ERC721Recipient(); + + token.safeMint(address(to), 1337, "testing 123"); + + assertEq(token.ownerOf(1337), address(to)); + assertEq(token.balanceOf(address(to)), 1); + + assertEq(to.operator(), address(this)); + assertEq(to.from(), address(0)); + assertEq(to.id(), 1337); + assertEq(to.data(), "testing 123"); + } + + function testFailMintToZero() public { + token.mint(address(0), 1337); + } + + function testFailDoubleMint() public { + token.mint(address(0xBEEF), 1337); + token.mint(address(0xBEEF), 1337); + } + + function testFailBurnUnMinted() public { + token.burn(1337); + } + + function testFailDoubleBurn() public { + token.mint(address(0xBEEF), 1337); + + token.burn(1337); + token.burn(1337); + } + + function testFailApproveUnMinted() public { + token.approve(address(0xBEEF), 1337); + } + + function testFailApproveUnAuthorized() public { + token.mint(address(0xCAFE), 1337); + + token.approve(address(0xBEEF), 1337); + } + + function testFailTransferFromUnOwned() public { + token.transferFrom(address(0xFEED), address(0xBEEF), 1337); + } + + function testFailTransferFromWrongFrom() public { + token.mint(address(0xCAFE), 1337); + + token.transferFrom(address(0xFEED), address(0xBEEF), 1337); + } + + function testFailTransferFromToZero() public { + token.mint(address(this), 1337); + + token.transferFrom(address(this), address(0), 1337); + } + + function testFailTransferFromNotOwner() public { + token.mint(address(0xFEED), 1337); + + token.transferFrom(address(0xFEED), address(0xBEEF), 1337); + } + + function testFailSafeTransferFromToNonERC721Recipient() public { + token.mint(address(this), 1337); + + token.safeTransferFrom(address(this), address(new NonERC721Recipient()), 1337); + } + + function testFailSafeTransferFromToNonERC721RecipientWithData() public { + token.mint(address(this), 1337); + + token.safeTransferFrom(address(this), address(new NonERC721Recipient()), 1337, "testing 123"); + } + + function testFailSafeTransferFromToRevertingERC721Recipient() public { + token.mint(address(this), 1337); + + token.safeTransferFrom(address(this), address(new RevertingERC721Recipient()), 1337); + } + + function testFailSafeTransferFromToRevertingERC721RecipientWithData() public { + token.mint(address(this), 1337); + + token.safeTransferFrom(address(this), address(new RevertingERC721Recipient()), 1337, "testing 123"); + } + + function testFailSafeTransferFromToERC721RecipientWithWrongReturnData() public { + token.mint(address(this), 1337); + + token.safeTransferFrom(address(this), address(new WrongReturnDataERC721Recipient()), 1337); + } + + function testFailSafeTransferFromToERC721RecipientWithWrongReturnDataWithData() public { + token.mint(address(this), 1337); + + token.safeTransferFrom(address(this), address(new WrongReturnDataERC721Recipient()), 1337, "testing 123"); + } + + function testFailSafeMintToNonERC721Recipient() public { + token.safeMint(address(new NonERC721Recipient()), 1337); + } + + function testFailSafeMintToNonERC721RecipientWithData() public { + token.safeMint(address(new NonERC721Recipient()), 1337, "testing 123"); + } + + function testFailSafeMintToRevertingERC721Recipient() public { + token.safeMint(address(new RevertingERC721Recipient()), 1337); + } + + function testFailSafeMintToRevertingERC721RecipientWithData() public { + token.safeMint(address(new RevertingERC721Recipient()), 1337, "testing 123"); + } + + function testFailSafeMintToERC721RecipientWithWrongReturnData() public { + token.safeMint(address(new WrongReturnDataERC721Recipient()), 1337); + } + + function testFailSafeMintToERC721RecipientWithWrongReturnDataWithData() public { + token.safeMint(address(new WrongReturnDataERC721Recipient()), 1337, "testing 123"); + } + + function testFailBalanceOfZeroAddress() public view { + token.balanceOf(address(0)); + } + + function testFailOwnerOfUnminted() public view { + token.ownerOf(1337); + } + + function testMetadata(string memory name, string memory symbol) public { + MockERC721 tkn = new Token_ERC721(name, symbol); + + assertEq(tkn.name(), name); + assertEq(tkn.symbol(), symbol); + } + + function testMint(address to, uint256 id) public { + if (to == address(0)) to = address(0xBEEF); + + token.mint(to, id); + + assertEq(token.balanceOf(to), 1); + assertEq(token.ownerOf(id), to); + } + + function testBurn(address to, uint256 id) public { + if (to == address(0)) to = address(0xBEEF); + + token.mint(to, id); + token.burn(id); + + assertEq(token.balanceOf(to), 0); + + vm.expectRevert("NOT_MINTED"); + token.ownerOf(id); + } + + function testApprove(address to, uint256 id) public { + if (to == address(0)) to = address(0xBEEF); + + token.mint(address(this), id); + + token.approve(to, id); + + assertEq(token.getApproved(id), to); + } + + function testApproveBurn(address to, uint256 id) public { + token.mint(address(this), id); + + token.approve(address(to), id); + + token.burn(id); + + assertEq(token.balanceOf(address(this)), 0); + assertEq(token.getApproved(id), address(0)); + + vm.expectRevert("NOT_MINTED"); + token.ownerOf(id); + } + + function testApproveAll(address to, bool approved) public { + token.setApprovalForAll(to, approved); + + assertEq(token.isApprovedForAll(address(this), to), approved); + } + + function testTransferFrom(uint256 id, address to) public { + address from = address(0xABCD); + + if (to == address(0) || to == from) to = address(0xBEEF); + + token.mint(from, id); + + vm.prank(from); + token.approve(address(this), id); + + token.transferFrom(from, to, id); + + assertEq(token.getApproved(id), address(0)); + assertEq(token.ownerOf(id), to); + assertEq(token.balanceOf(to), 1); + assertEq(token.balanceOf(from), 0); + } + + function testTransferFromSelf(uint256 id, address to) public { + if (to == address(0) || to == address(this)) to = address(0xBEEF); + + token.mint(address(this), id); + + token.transferFrom(address(this), to, id); + + assertEq(token.getApproved(id), address(0)); + assertEq(token.ownerOf(id), to); + assertEq(token.balanceOf(to), 1); + assertEq(token.balanceOf(address(this)), 0); + } + + function testTransferFromApproveAll(uint256 id, address to) public { + address from = address(0xABCD); + + if (to == address(0) || to == from) to = address(0xBEEF); + + token.mint(from, id); + + vm.prank(from); + token.setApprovalForAll(address(this), true); + + token.transferFrom(from, to, id); + + assertEq(token.getApproved(id), address(0)); + assertEq(token.ownerOf(id), to); + assertEq(token.balanceOf(to), 1); + assertEq(token.balanceOf(from), 0); + } + + function testSafeTransferFromToEOA(uint256 id, address to) public { + address from = address(0xABCD); + + if (to == address(0) || to == from) to = address(0xBEEF); + + if (uint256(uint160(to)) <= 18 || to.code.length > 0) return; + + token.mint(from, id); + + vm.prank(from); + token.setApprovalForAll(address(this), true); + + token.safeTransferFrom(from, to, id); + + assertEq(token.getApproved(id), address(0)); + assertEq(token.ownerOf(id), to); + assertEq(token.balanceOf(to), 1); + assertEq(token.balanceOf(from), 0); + } + + function testSafeTransferFromToERC721Recipient(uint256 id) public { + address from = address(0xABCD); + + ERC721Recipient recipient = new ERC721Recipient(); + + token.mint(from, id); + + vm.prank(from); + token.setApprovalForAll(address(this), true); + + token.safeTransferFrom(from, address(recipient), id); + + assertEq(token.getApproved(id), address(0)); + assertEq(token.ownerOf(id), address(recipient)); + assertEq(token.balanceOf(address(recipient)), 1); + assertEq(token.balanceOf(from), 0); + + assertEq(recipient.operator(), address(this)); + assertEq(recipient.from(), from); + assertEq(recipient.id(), id); + assertEq(recipient.data(), ""); + } + + function testSafeTransferFromToERC721RecipientWithData(uint256 id, bytes calldata data) public { + address from = address(0xABCD); + ERC721Recipient recipient = new ERC721Recipient(); + + token.mint(from, id); + + vm.prank(from); + token.setApprovalForAll(address(this), true); + + token.safeTransferFrom(from, address(recipient), id, data); + + assertEq(token.getApproved(id), address(0)); + assertEq(token.ownerOf(id), address(recipient)); + assertEq(token.balanceOf(address(recipient)), 1); + assertEq(token.balanceOf(from), 0); + + assertEq(recipient.operator(), address(this)); + assertEq(recipient.from(), from); + assertEq(recipient.id(), id); + assertEq(recipient.data(), data); + } + + function testSafeMintToEOA(uint256 id, address to) public { + if (to == address(0)) to = address(0xBEEF); + + if (uint256(uint160(to)) <= 18 || to.code.length > 0) return; + + token.safeMint(to, id); + + assertEq(token.ownerOf(id), address(to)); + assertEq(token.balanceOf(address(to)), 1); + } + + function testSafeMintToERC721Recipient(uint256 id) public { + ERC721Recipient to = new ERC721Recipient(); + + token.safeMint(address(to), id); + + assertEq(token.ownerOf(id), address(to)); + assertEq(token.balanceOf(address(to)), 1); + + assertEq(to.operator(), address(this)); + assertEq(to.from(), address(0)); + assertEq(to.id(), id); + assertEq(to.data(), ""); + } + + function testSafeMintToERC721RecipientWithData(uint256 id, bytes calldata data) public { + ERC721Recipient to = new ERC721Recipient(); + + token.safeMint(address(to), id, data); + + assertEq(token.ownerOf(id), address(to)); + assertEq(token.balanceOf(address(to)), 1); + + assertEq(to.operator(), address(this)); + assertEq(to.from(), address(0)); + assertEq(to.id(), id); + assertEq(to.data(), data); + } + + function testFailMintToZero(uint256 id) public { + token.mint(address(0), id); + } + + function testFailDoubleMint(uint256 id, address to) public { + if (to == address(0)) to = address(0xBEEF); + + token.mint(to, id); + token.mint(to, id); + } + + function testFailBurnUnMinted(uint256 id) public { + token.burn(id); + } + + function testFailDoubleBurn(uint256 id, address to) public { + if (to == address(0)) to = address(0xBEEF); + + token.mint(to, id); + + token.burn(id); + token.burn(id); + } + + function testFailApproveUnMinted(uint256 id, address to) public { + token.approve(to, id); + } + + function testFailApproveUnAuthorized(address owner, uint256 id, address to) public { + if (owner == address(0) || owner == address(this)) owner = address(0xBEEF); + + token.mint(owner, id); + + token.approve(to, id); + } + + function testFailTransferFromUnOwned(address from, address to, uint256 id) public { + token.transferFrom(from, to, id); + } + + function testFailTransferFromWrongFrom(address owner, address from, address to, uint256 id) public { + if (owner == address(0)) to = address(0xBEEF); + if (from == owner) revert(); + + token.mint(owner, id); + + token.transferFrom(from, to, id); + } + + function testFailTransferFromToZero(uint256 id) public { + token.mint(address(this), id); + + token.transferFrom(address(this), address(0), id); + } + + function testFailTransferFromNotOwner(address from, address to, uint256 id) public { + if (from == address(this)) from = address(0xBEEF); + + token.mint(from, id); + + token.transferFrom(from, to, id); + } + + function testFailSafeTransferFromToNonERC721Recipient(uint256 id) public { + token.mint(address(this), id); + + token.safeTransferFrom(address(this), address(new NonERC721Recipient()), id); + } + + function testFailSafeTransferFromToNonERC721RecipientWithData(uint256 id, bytes calldata data) public { + token.mint(address(this), id); + + token.safeTransferFrom(address(this), address(new NonERC721Recipient()), id, data); + } + + function testFailSafeTransferFromToRevertingERC721Recipient(uint256 id) public { + token.mint(address(this), id); + + token.safeTransferFrom(address(this), address(new RevertingERC721Recipient()), id); + } + + function testFailSafeTransferFromToRevertingERC721RecipientWithData(uint256 id, bytes calldata data) public { + token.mint(address(this), id); + + token.safeTransferFrom(address(this), address(new RevertingERC721Recipient()), id, data); + } + + function testFailSafeTransferFromToERC721RecipientWithWrongReturnData(uint256 id) public { + token.mint(address(this), id); + + token.safeTransferFrom(address(this), address(new WrongReturnDataERC721Recipient()), id); + } + + function testFailSafeTransferFromToERC721RecipientWithWrongReturnDataWithData(uint256 id, bytes calldata data) + public + { + token.mint(address(this), id); + + token.safeTransferFrom(address(this), address(new WrongReturnDataERC721Recipient()), id, data); + } + + function testFailSafeMintToNonERC721Recipient(uint256 id) public { + token.safeMint(address(new NonERC721Recipient()), id); + } + + function testFailSafeMintToNonERC721RecipientWithData(uint256 id, bytes calldata data) public { + token.safeMint(address(new NonERC721Recipient()), id, data); + } + + function testFailSafeMintToRevertingERC721Recipient(uint256 id) public { + token.safeMint(address(new RevertingERC721Recipient()), id); + } + + function testFailSafeMintToRevertingERC721RecipientWithData(uint256 id, bytes calldata data) public { + token.safeMint(address(new RevertingERC721Recipient()), id, data); + } + + function testFailSafeMintToERC721RecipientWithWrongReturnData(uint256 id) public { + token.safeMint(address(new WrongReturnDataERC721Recipient()), id); + } + + function testFailSafeMintToERC721RecipientWithWrongReturnDataWithData(uint256 id, bytes calldata data) public { + token.safeMint(address(new WrongReturnDataERC721Recipient()), id, data); + } + + function testFailOwnerOfUnminted(uint256 id) public view { + token.ownerOf(id); + } +} diff --git a/harness/solidity_sized_tx_contract/package.json b/harness/solidity_sized_tx_contract/package.json new file mode 100644 index 00000000..3174f0b9 --- /dev/null +++ b/harness/solidity_sized_tx_contract/package.json @@ -0,0 +1,21 @@ +{ + "name": "generate_sized_txs", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "start": "./script/start.sh", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "dotenv": "^16.3.1", + "ethers": "^6.9.2" + }, + "devDependencies": { + "@types/node": "^20.11.0", + "typescript": "^5.3.3" + } +} diff --git a/harness/solidity_sized_tx_contract/pnpm-lock.yaml b/harness/solidity_sized_tx_contract/pnpm-lock.yaml new file mode 100644 index 00000000..9d64b70f --- /dev/null +++ b/harness/solidity_sized_tx_contract/pnpm-lock.yaml @@ -0,0 +1,100 @@ +lockfileVersion: '6.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +dependencies: + dotenv: + specifier: ^16.3.1 + version: 16.3.1 + ethers: + specifier: ^6.9.2 + version: 6.9.2 + +devDependencies: + '@types/node': + specifier: ^20.11.0 + version: 20.11.0 + typescript: + specifier: ^5.3.3 + version: 5.3.3 + +packages: + + /@adraffy/ens-normalize@1.10.0: + resolution: {integrity: sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q==} + dev: false + + /@noble/curves@1.2.0: + resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} + dependencies: + '@noble/hashes': 1.3.2 + dev: false + + /@noble/hashes@1.3.2: + resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} + engines: {node: '>= 16'} + dev: false + + /@types/node@18.15.13: + resolution: {integrity: sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==} + dev: false + + /@types/node@20.11.0: + resolution: {integrity: sha512-o9bjXmDNcF7GbM4CNQpmi+TutCgap/K3w1JyKgxAjqx41zp9qlIAVFi0IhCNsJcXolEqLWhbFbEeL0PvYm4pcQ==} + dependencies: + undici-types: 5.26.5 + dev: true + + /aes-js@4.0.0-beta.5: + resolution: {integrity: sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==} + dev: false + + /dotenv@16.3.1: + resolution: {integrity: sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==} + engines: {node: '>=12'} + dev: false + + /ethers@6.9.2: + resolution: {integrity: sha512-YpkrtILnMQz5jSEsJQRTpduaGT/CXuLnUIuOYzHA0v/7c8IX91m2J48wSKjzGL5L9J/Us3tLoUdb+OwE3U+FFQ==} + engines: {node: '>=14.0.0'} + dependencies: + '@adraffy/ens-normalize': 1.10.0 + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.2 + '@types/node': 18.15.13 + aes-js: 4.0.0-beta.5 + tslib: 2.4.0 + ws: 8.5.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: false + + /tslib@2.4.0: + resolution: {integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==} + dev: false + + /typescript@5.3.3: + resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} + engines: {node: '>=14.17'} + hasBin: true + dev: true + + /undici-types@5.26.5: + resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + dev: true + + /ws@8.5.0: + resolution: {integrity: sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dev: false diff --git a/harness/solidity_sized_tx_contract/script/TransactionSender.s.sol b/harness/solidity_sized_tx_contract/script/TransactionSender.s.sol new file mode 100644 index 00000000..9d20c903 --- /dev/null +++ b/harness/solidity_sized_tx_contract/script/TransactionSender.s.sol @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.13; + +import {Script, console2} from "forge-std/Script.sol"; +import {TransactionSender} from "../src/TransactionSender.sol"; + +contract TransactionSenderScript is Script { + uint256 public constant TX_DATA_LARGE = 32768 - 64; + uint256 public constant TX_DATA_MAX = 130940 - 64; // actual max is 330000 but Forge has max of 131709 + uint256 public constant RC_LARGE_LOG_SIZE = 2048 - 64; + uint256 public constant RC_LARGE_NUM_LOGS = 80; + uint256 public constant RC_MAX_LOG_SIZE = 1024 - 64; + uint256 public constant RC_MAX_NUM_LOGS = 400; + + TransactionSender transactionSender; + + function setUp() public { + vm.startBroadcast(); + transactionSender = new TransactionSender(); + vm.stopBroadcast(); + } + + function run() public { + vm.startBroadcast(); + + transactionSender.sendTxWithCalldata(new bytes(TX_DATA_LARGE)); + transactionSender.sendTxWithCalldata(new bytes(TX_DATA_MAX)); + + transactionSender.sendTxWithLogs(new bytes(RC_LARGE_LOG_SIZE), RC_LARGE_NUM_LOGS); + transactionSender.sendTxWithLogs(new bytes(RC_MAX_LOG_SIZE), RC_MAX_NUM_LOGS); + + vm.stopBroadcast(); + } +} diff --git a/harness/solidity_sized_tx_contract/script/main.ts b/harness/solidity_sized_tx_contract/script/main.ts new file mode 100644 index 00000000..c76ac4fc --- /dev/null +++ b/harness/solidity_sized_tx_contract/script/main.ts @@ -0,0 +1,41 @@ +import { ethers } from "ethers"; +import dotenv from 'dotenv'; +dotenv.config(); + +const PROVIDER_URI = process.env.PROVIDER_URI as string; +const PRIVATE_KEY = process.env.PRIVATE_KEY as string; + +async function main() { + const provider = new ethers.JsonRpcProvider(PROVIDER_URI); + const signer = new ethers.Wallet(PRIVATE_KEY, provider); + + const contractAddress = "0x88941290daBd7884e31B047459d25cA530B293F0"; + const contract = new ethers.Contract(contractAddress, ["function sendTxWithCalldata(bytes calldata data)"], signer); + + const calldata = contract.interface.encodeFunctionData("sendTxWithCalldata", [ethers.randomBytes(7500)]); + + const accessList = []; + for (let i = 0; i < 50; i++) { + accessList.push({ + address: contractAddress, + storageKeys: ['0x' + i.toString(16).padStart(64, '0')] + }); + } + + const tx = { + to: contractAddress, + data: calldata, + type: 2, + accessList: accessList, + gasLimit: 10000000, + // gasPrice: 1000000000, + }; + + let txResponse = await signer.sendTransaction(tx); + console.log("Transaction Hash:", txResponse.hash); +} + +main().catch((error) => { + console.error(error); + process.exit(1); +}); diff --git a/harness/solidity_sized_tx_contract/script/start.sh b/harness/solidity_sized_tx_contract/script/start.sh new file mode 100755 index 00000000..6537af03 --- /dev/null +++ b/harness/solidity_sized_tx_contract/script/start.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +cd $(git rev-parse --show-toplevel) + +cd harness +source .env + +cd solidity_sized_tx_contract + +forge script ./script/TransactionSender.s.sol:TransactionSenderScript --private-key $PRIVATE_KEY --rpc-url $PROVIDER_URI --force -vvvv --broadcast + +cd ../.. \ No newline at end of file diff --git a/harness/solidity_sized_tx_contract/src/TransactionSender.sol b/harness/solidity_sized_tx_contract/src/TransactionSender.sol new file mode 100644 index 00000000..58438c08 --- /dev/null +++ b/harness/solidity_sized_tx_contract/src/TransactionSender.sol @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +contract TransactionSender { + event TransactionSent(); + event DataEvent(bytes data); + + function sendTxWithCalldata(bytes calldata) external { + emit TransactionSent(); + } + + function sendTxWithLogs(bytes calldata _data, uint256 numLogs) external { + for (uint256 i = 0; i < numLogs; i++) { + emit DataEvent(_data); + } + } +} diff --git a/harness/solidity_sized_tx_contract/tsconfig.json b/harness/solidity_sized_tx_contract/tsconfig.json new file mode 100644 index 00000000..e075f973 --- /dev/null +++ b/harness/solidity_sized_tx_contract/tsconfig.json @@ -0,0 +1,109 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + + /* Language and Environment */ + "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ + // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ + // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ + // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ + // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ + // "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ + + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ + // "outDir": "./", /* Specify an output folder for all emitted files. */ + // "removeComments": true, /* Disable emitting comments. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ + + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + } +} diff --git a/harness/src/cli/index.ts b/harness/src/cli/index.ts index dfff9783..2fa489ea 100644 --- a/harness/src/cli/index.ts +++ b/harness/src/cli/index.ts @@ -1,5 +1,6 @@ import { Command } from "commander"; -import { harness } from '../harness'; +import { run } from '../run/run'; +import { search } from "../search/search"; import { HARNESS_VERSION } from "../version"; const harnessCli = new Command('harness'); @@ -7,15 +8,30 @@ const harnessCli = new Command('harness'); harnessCli .name("harness") .version(HARNESS_VERSION) - .description("Axiom circuit harness"); + .description("Axiom circuit test harness"); + +harnessCli + .command("search") + .description("Search for a chain data and generate a json output") + .requiredOption("-p, --provider ", "Node provider for the chain") + .option("-s, --samples ", "Number of blocks to sample (default: 128)", Number) + .option("-i, --interval ", "Interval between samples (default: 64)", Number) + .option("-b, --block ", "Start at block number and work backwards (default: latest)", Number) + .option("-in, --include ", "Comma-separated block numbers to include in the search (useful if certain events happened at specific blocks)") + .option("-ig, --ignore ", "Comma-separated string slices of addresses to ignore") + .option("-o, --output ", "Output file path (default: ./output)", "./output") + .action(search); harnessCli .command("run") - .description("Get circuit parameters from javascript circuit") - .argument("", "js circuit path") - .option("-o, --outputs [outputs]", "outputs folder", "data") - .option("-f, --function [function]", "function name", "circuit") - .option("-p, --provider [provider]", "provider") - .action(harness); + .description("Run a test on a circuit file") + .requiredOption("-c, --circuit ", "js circuit path") + .requiredOption("-p, --provider ", "Node provider for the chain") + .requiredOption("-d, --data ", "Chain data json file path (output of `search` command)") + .option("-o, --output ", "Folder for outputs (default: ../output)", "../output") + .option("-o, --circuitInputsPath ", "Path to circuit inputs (default: /)") + .option("-f, --function ", "Function name (default: circuit)", "circuit") + .option("--send", "Send query after proving") + .action(run); harnessCli.parseAsync(process.argv); \ No newline at end of file diff --git a/harness/src/harness.ts b/harness/src/harness.ts deleted file mode 100644 index 1541f1c5..00000000 --- a/harness/src/harness.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { buildCircuit } from "./template/buildCircuit"; -import path from 'path'; -import fs from 'fs'; -import { compile, prove } from "@axiom-crypto/client/cli/components"; - -export const harness = async ( - inputPath: string, - options: { - outputs: string; - function: string; - chainId?: number | string | bigint; - provider?: string; - skipProve?: boolean; - } -) => { - const fileName = path.basename(inputPath).split(".js")[0]; - const outputsFileBase = `${options.outputs}/${fileName}`; - - // Build the typescript circuit - const circuit = buildCircuit(inputPath); - const circuitPath = path.resolve(`${outputsFileBase}.circuit.ts`); - - // Write the typescript circuit - fs.mkdirSync(path.resolve(options.outputs), { recursive: true }); - fs.writeFileSync(circuitPath, circuit.circuit); - - // Write the inputs - const inputsFile = `${outputsFileBase}.inputs.json`; - fs.writeFileSync(inputsFile, JSON.stringify(circuit.inputs, null, 2)); - - // Compile the circuit - const compiledFile = `${outputsFileBase}.compiled.json`; - await compile( - circuitPath, - { - stats: false, - function: options.function, - outputs: compiledFile, - chainId: options.chainId, - provider: options.provider, - } - ); - - if (options.skipProve) return; - - // Prove the circuit - const outputsFile = `${outputsFileBase}.proven.json`; - console.log(`Proving ${compiledFile} with inputs from ${inputsFile}`); - await prove( - compiledFile, - inputsFile, - { - stats: false, - outputs: outputsFile, - chainId: options.chainId, - provider: options.provider, - } - ); -}; diff --git a/harness/src/index.ts b/harness/src/index.ts index 4d99447c..2f46d874 100644 --- a/harness/src/index.ts +++ b/harness/src/index.ts @@ -1 +1,2 @@ -export * from './harness'; +export * from './run'; +export * from './search'; diff --git a/harness/src/run/circuitTest.ts b/harness/src/run/circuitTest.ts new file mode 100644 index 00000000..1bd5037c --- /dev/null +++ b/harness/src/run/circuitTest.ts @@ -0,0 +1,122 @@ +import { execSync } from "child_process"; +import { existsSync, rmSync } from "fs"; +import path from "path"; +import { Axiom, AxiomV2CompiledCircuit, UserInput } from "@axiom-crypto/client"; +import { TransactionReceipt } from "viem"; + +export function parseArgs(): { chainId: string } { + let args: { chainId: string } = { chainId: "" }; + console.log(process.argv); + process.argv.map((arg) => { + let [key, value] = arg.split("="); + key = key.replace("--", ""); + args[key as keyof typeof args] = value; + }); + if (args["chainId"] === undefined) { + throw new Error("`chainId` argument is required"); + } + return args; +} + +export async function generateCircuitArtifacts( + chainId: string, + circuitPath: string, + circuitInputsPath: string, + outputPath: string, +) { + const provider = process.env[`PROVIDER_URI_${chainId}`] as string; + const circuitPathResolved = path.resolve(circuitPath); + const pathToFile = path.dirname(circuitPathResolved); + const filename = path.basename(circuitPathResolved); + const filebase = filename.split(".")[0]; + const folder = path.basename(path.dirname(circuitPathResolved)); + + const compiledPath = path.resolve(`${outputPath}/${filebase}.compiled.json`); + const inputsPath = path.resolve(`${circuitInputsPath}/${filebase}.inputs.json`); + const defaultInputsPath = path.resolve(`${circuitInputsPath}/${filebase}.defaultInputs.json`); + + let externalDefaults = false; + if (existsSync(defaultInputsPath)) { + externalDefaults = true; + } + + if (existsSync(compiledPath)) { + rmSync(compiledPath); + } + + execSync(`npx axiom circuit compile ${circuitPathResolved} -o ${compiledPath} ${externalDefaults ? "-d " + defaultInputsPath : ""} -p ${provider}`, { stdio: 'inherit' }); + + if (externalDefaults) { + const defaultInputs = (await import(defaultInputsPath)).default; + console.log("External defaultInputs:", defaultInputsPath, defaultInputs); + } + + let inputs = {}; + if (existsSync(inputsPath)) { + inputs = (await import(inputsPath)).default; + console.log("Inputs:", inputsPath, inputs); + } + + return { + circuit: (await import(circuitPathResolved)).circuit, + compiledCircuit: await import(compiledPath), + inputs, + }; +} + +export async function runTestProve( + chainId: string, + circuit: (inputs: UserInput) => Promise, + compiledCircuit: AxiomV2CompiledCircuit, + inputs: UserInput, + options?: any, +): Promise> { + let targetOverride = undefined; + if (options?.callback?.target !== undefined) { + targetOverride = options.callback.target; + } + const axiom = new Axiom({ + circuit, + compiledCircuit, + chainId, + provider: process.env[`PROVIDER_URI_${chainId}`] as string, + privateKey: process.env[`PRIVATE_KEY_${chainId}`] as string, + callback: { + target: getTarget(chainId, targetOverride), + }, + ...options, + }); + await axiom.init(); + await axiom.prove(inputs); + return axiom; +} + +export async function runTestSendQuery( + chainId: string, + circuit: (inputs: any) => Promise, + compiledCircuit: AxiomV2CompiledCircuit, + inputs: UserInput, + options?: object, +): Promise { + const axiom = await runTestProve(chainId, circuit, compiledCircuit, inputs, options); + const receipt = await axiom.sendQuery(); + return receipt; +} + +export function getTarget(chainId: string, override?: string) { + if (override) { + return override; + } + switch(chainId) { + case "1": + return "0x4D36100eA7BD6F685Fd44EB6BE5ccE7A92047581"; + case "11155111": + return "0x4A4e2D8f3fBb3525aD61db7Fc843c9bf097c362e"; + case "8453": + return "0x89C6FbABf570dc53b64b5D52095A8d955dABAE16"; + case "84532": + return "0x3b49DE82B86d677C072Dcc7ED47bcA9F20f0CF46"; + default: + throw new Error(`No target found for chainId: ${chainId}`); + } +} diff --git a/harness/src/run/index.ts b/harness/src/run/index.ts new file mode 100644 index 00000000..67f03ee4 --- /dev/null +++ b/harness/src/run/index.ts @@ -0,0 +1,3 @@ +export * from "./run"; +export * from "./circuitTest"; +export * from "./inputs"; diff --git a/harness/src/run/inputs.ts b/harness/src/run/inputs.ts new file mode 100644 index 00000000..2e7006a6 --- /dev/null +++ b/harness/src/run/inputs.ts @@ -0,0 +1,77 @@ +import fs from 'fs'; +import path from 'path'; + +export function generateInputs(file: string, outputPath: string, chainData: any) { + // Read the entire file content + const fileContent = fs.readFileSync(file, 'utf8'); + + // Split the content by new lines to get an array of lines + const lines = fileContent.split(/\r?\n/); + + // Inputs objects to store + const inputs: {[key: string]: string} = {}; + const defaultInputs: {[key: string]: string} = {}; + + // Iterate over each line and check for your condition + for (const line of lines) { + if (line.match(/.*\/\/\$ .*/)) { + const key = line.split(":")[0].trim().replace(/"/g, ''); + const cmd = line.split("//$")[1].trim(); + if (cmd.includes("chainId")) { + const chains = cmd.split("=")[1].split(","); + if (!chains.includes(chainData.chainId)) { + return; + } + continue; + } + const idx = extractIndex(cmd); + const newIdx = idx + 1; + const value = eval(`chainData.${cmd}`); + const replacedCmd = cmd.replace(`[${idx}]`, `[${newIdx}]`); + const defaultValue = eval(`chainData.${replacedCmd}`); + inputs[key] = value; + defaultInputs[key] = defaultValue; + } + } + + if (Object.keys(inputs).length === 0) { + return; + } + + // Save inputs files + const fileName = path.basename(file).split(".")[0]; + fs.mkdirSync(outputPath, { recursive: true }); + const inputsPath = path.join(outputPath, `${fileName}.inputs.json`); + const defaultInputsPath = path.join(outputPath, `${fileName}.defaultInputs.json`); + fs.writeFileSync(inputsPath, JSON.stringify(inputs, null, 4)); + fs.writeFileSync(defaultInputsPath, JSON.stringify(defaultInputs, null, 4)); +} + +export function findCircuitFiles(dir: string): string[] { + return findCircuitFilesRecursive(dir, []); +} + +function findCircuitFilesRecursive(dir: string, circuitFiles: string[]): string[] { + const files = fs.readdirSync(dir); + for (const file of files) { + const filePath = path.join(dir, file); + const stat = fs.statSync(filePath); + if (stat.isDirectory()) { + circuitFiles = findCircuitFilesRecursive(filePath, circuitFiles); + } else { + if (file.endsWith('.circuit.ts')) { + circuitFiles.push(filePath); + } + } + } + return circuitFiles; +} + +function extractIndex(s: string): number { + const match = s.match(/\[(\d+)\](?![^\[]*"\])/); + if (match && match[1]) { + const number = parseInt(match[1], 10); + return number; + } + return -1; +} diff --git a/harness/src/run/run.ts b/harness/src/run/run.ts new file mode 100644 index 00000000..23238830 --- /dev/null +++ b/harness/src/run/run.ts @@ -0,0 +1,49 @@ +import fs from 'fs'; +import path from 'path'; +import { JsonRpcProvider } from "ethers"; +import { generateCircuitArtifacts, runTestProve, runTestSendQuery } from "./circuitTest"; +import { generateInputs } from './inputs'; + +export const run = async ( + options: { + circuit: string; + provider: string; + data: string; + circuitInputsPath?: string; + output?: string; + function?: string; + send?: boolean; + options?: any; + } +): Promise => { + const chainDataPath = path.dirname(options.data); + const data = JSON.parse(fs.readFileSync(options.data, 'utf8')); + const provider = new JsonRpcProvider(options.provider); + const chainId = (await provider.getNetwork()).chainId.toString(); + + let outputPath = path.join(path.dirname(options.circuit), '../output'); + if (options.output) { + outputPath = options.output; + } + let circuitInputsPath = path.join(chainDataPath, chainId); + if (options.circuitInputsPath) { + circuitInputsPath = options.circuitInputsPath; + } + + // Geneate the input values for this circuit file + generateInputs(options.circuit, circuitInputsPath, data); + + // Compile the circuit + const { + circuit, + compiledCircuit, + inputs, + } = await generateCircuitArtifacts(chainId, options.circuit, circuitInputsPath, outputPath); + + // Prove or prove+send the query + if (!options.send) { + return await runTestProve(chainId, circuit, compiledCircuit, inputs, options.options); + } else { + return await runTestSendQuery(chainId, circuit, compiledCircuit, inputs, options.options); + } +}; diff --git a/harness/src/search/defaults.ts b/harness/src/search/defaults.ts new file mode 100644 index 00000000..d3bbd11c --- /dev/null +++ b/harness/src/search/defaults.ts @@ -0,0 +1,53 @@ +import { AddressId, RcId, StorageId, TxId } from "../types"; + +// Number of blocks to sample +export const BLOCK_SAMPLES = 128; + +// Interval between blocks to sample +export const BLOCK_INTERVAL = 64; + +export let data = { + chainId: "0", + blockRange: { + start: 0, + end: 0, + }, + blockSamples: 0, + blockInterval: 0, + account: { + eoa: [] as AddressId[], + contract: [] as AddressId[], + }, + storage: { + nonzero: [] as StorageId[], // nonzero at slot 0 + }, + tx: { + type: { + "0": [] as TxId[], + "1": [] as TxId[], + "2": [] as TxId[], + "3": [] as TxId[], + }, + category: { + "default": [] as TxId[], // 8192b, 4096b rlp + "large": [] as TxId[], // 32768b, 16384b rlp + "max": [] as TxId[], // 330000b, 131072b rlp + "oversize": [] as TxId[], + }, + }, + rc: { + events: [] as RcId[], + category: { + "default": [] as TxId[], // 800b, 20 logs + "medium": [] as TxId[], // 1024b, 80 logs + "large": [] as TxId[], // 2048b, 80 logs + "max": [] as TxId[], // 1024b, 400 logs + "oversize": [] as TxId[], + }, + }, +} + +export const matchIgnoreAddrs = [ + "0xdeaddeaddeaddeaddeaddeaddeaddeaddead", + "0000000000000000000000000000000", +] diff --git a/harness/src/search/index.ts b/harness/src/search/index.ts new file mode 100644 index 00000000..03fdb729 --- /dev/null +++ b/harness/src/search/index.ts @@ -0,0 +1 @@ +export * from "./search"; diff --git a/harness/src/search/search.ts b/harness/src/search/search.ts new file mode 100644 index 00000000..2d00a9b0 --- /dev/null +++ b/harness/src/search/search.ts @@ -0,0 +1,264 @@ +import fs from 'fs'; +import path from 'path'; +import dotenv from "dotenv"; +import { ethers, JsonRpcProvider } from "ethers"; +import { getFullBlock, getRawReceipt, getNumBytes, objectToRlp, bytes32 } from "@axiom-crypto/tools"; +import { AddressId, RcId, StorageId, TxId } from "../types"; +import { BLOCK_INTERVAL, BLOCK_SAMPLES, data, matchIgnoreAddrs } from "./defaults"; +dotenv.config(); + +export const search = async ( + options: { + provider: string; + samples?: number; + interval?: number; + block?: number; + include?: string; + ignore?: string; + output?: string; + } +) => { + const provider = new ethers.JsonRpcProvider(options.provider); + let currentBlock = await provider.getBlockNumber(); + const numSamples = options.samples ?? BLOCK_SAMPLES; + const interval = options.interval ?? BLOCK_INTERVAL; + + let includeBlocks: number[] = []; + if (options.include !== undefined) { + includeBlocks = options.include.split(",").map(Number); + } + let outputPath = './output'; + if (options.output !== undefined) { + outputPath = options.output; + } + + let ignoreAddrs: string[] = [...matchIgnoreAddrs]; + + const chainId = (await provider.getNetwork()).chainId.toString(); + data.chainId = chainId; + if (options.block !== undefined){ + currentBlock = options.block; + } + data.blockRange.start = currentBlock; + data.blockRange.end = currentBlock; + + let blocksToProcess: number[] = [...includeBlocks]; + for (let i = 0; i < numSamples; i++) { + blocksToProcess.push(currentBlock - i * interval); + } + for (let i = 0; i < blocksToProcess.length; i++) { + console.log("Currently processing block:", blocksToProcess[i]); + const blockNumber = blocksToProcess[i]; + if (blockNumber < data.blockRange.start) { + data.blockRange.start = blockNumber; + } + + const block = await getFullBlock(provider, blockNumber); + // console.log(blockNumber, block) + + if (!block || block.transactions.length === 0) { + continue; + } + // Pick random transaction index from block of account to include + const idx = Math.floor(Math.random() * block.transactions.length); + + // Include one per block + let storageIncl = false; + let eventIncl = false; + const numEvents = data.rc.events.length; + + for (let j = 0; j < block.transactions.length; j++) { + const tx = block.transactions[j]; // Full transaction from FullBlock + + const contracts = await parseAccount(provider, tx, idx, ignoreAddrs); + if (!storageIncl) { + storageIncl = await parseStorage(provider, contracts, tx.blockNumber); + } + await parseTx(tx); + + // Include one event per block + if (data.rc.events.length > numEvents) { + eventIncl = true; + } + await parseReceipt(provider, tx, eventIncl); + } + + console.log(JSON.stringify(data, null, 2)); + console.log("Remaining iterations:", blocksToProcess.length - i - 1); + } + + // Write output file + const outfile = `${chainId} ${data.blockRange.start}-${data.blockRange.end}.json`; + fs.mkdirSync(outputPath, { recursive: true }); + fs.writeFileSync(path.join(outputPath, outfile), JSON.stringify(data, null, 2)); +} + +/** + * Pushes to an array up to a certain size (no-op if array is already at size) + * @param arr Array to push to + * @param itm Object to add to array + * @param size Max size of the target array + */ +function pushArrayUpto(arr: T[], itm: T, size: number = 32) { + if (arr.length >= size) { + return; + } + arr.push(itm); +} + +/** + * Parses the to and from fields of from the transaction object into EOAs or contracts + * @param provider ethers JsonRpcProvider + * @param tx Raw transaction object from the node + * @param idx Index + * @param ignoreAddrs Ignore any addresses that match these patterns + * @returns Returns any addresses that are contracts + */ +async function parseAccount(provider: JsonRpcProvider, tx: any, idx: number, ignoreAddrs: string[]): Promise { + const accounts = [tx.from, tx.to]; + let contracts: string[] = []; + for await (const account of accounts) { + if (!account) { + continue; + } + // Check if account matches any part of the addresses in ignoreAddrs + const shouldIgnore = ignoreAddrs.some(ignoreAddr => account.includes(ignoreAddr)); + if (shouldIgnore) { + continue; // Skip this account if it matches any ignore address pattern + } + const code = await provider.getCode(account); + if (code === '0x') { + if (Number(tx.transactionIndex) === idx) { + pushArrayUpto(data.account.eoa, { + blockNumber: Number(tx.blockNumber), + address: account + }); + } + } else { + if (Number(tx.transactionIndex) === idx) { + pushArrayUpto(data.account.contract, { + blockNumber: Number(tx.blockNumber), + address: account + }); + } + contracts.push(account); + } + } + return contracts; +} + +/** + * Parses the storage of a contract. We choose a random slot to check if it is non-zero because a lot of accounts will come in during the + * search and we want adequate distribution of storage values across the search range. + * @param provider ethers JsonRpcProvider + * @param contracts List of contracts to check storage for + * @param blockNumber Blocknumber to check storage at + * @returns True if we found a storage slot that is nonzero, false otherwise + */ +async function parseStorage(provider: JsonRpcProvider, contracts: string[], blockNumber: string): Promise { + if (contracts.length === 0) { + return false; + } + for await (const contract of contracts) { + // Random slot from 0 to 10 + const randomSlot = Math.floor(Math.random() * 11); + const storage = await provider.getStorage(contract, randomSlot, blockNumber); + if (storage !== bytes32(0)) { + pushArrayUpto(data.storage.nonzero, { + blockNumber: Number(blockNumber), + address: contract, + slot: randomSlot, + }); + return true; + } + } + return false; +} + +/** + * Parse a transaction and determine its type and size category + * @param tx + */ +async function parseTx(tx: any) { + const type = Number(tx.type).toString() as keyof typeof data.tx.type; + const txId: TxId = { + hash: tx.hash, + blockNumber: Number(tx.blockNumber), + txIdx: Number(tx.transactionIndex), + }; + if (!(type === "0" || type === "1" || type === "2" || type === "3")) { + return; + } + const numBytesTxData = getNumBytes(tx.input); + // if (tx.accessList !== undefined && tx.accessList !== null && tx.accessList.length !== 0) { + // return; + // } + const accessListRlp = objectToRlp(tx.accessList ?? {}); + const aclNumBytesRlp = getNumBytes(accessListRlp); + + // TODO: Use QueryBuilder module to determine category + if (numBytesTxData <= 8192 && aclNumBytesRlp <= 800) { + pushArrayUpto(data.tx.category.default, txId); + pushArrayUpto(data.tx.type[type], txId); + } else if (numBytesTxData <= 32768 && aclNumBytesRlp <= 1024) { + pushArrayUpto(data.tx.category.large, txId); + } else if (numBytesTxData <= 333000 && aclNumBytesRlp <= 131072) { + pushArrayUpto(data.tx.category.max, txId); + } else { + pushArrayUpto(data.tx.category.oversize, txId); + } +} + +/** + * Parse a receipt and determine its category and include an event + * @param provider + * @param tx + * @param eventIncl Ignore if an event is already included in this block + */ +async function parseReceipt(provider: JsonRpcProvider, tx: any, eventIncl: boolean) { + const receipt = await getRawReceipt(provider, tx.hash); + const numLogs = receipt.logs.length; + if (receipt.logs.length === 0) { + return; + } + + let maxLogDataSize = 0; + for (let i = 0; i < numLogs; i++) { + const log = receipt.logs[i]; + const logData = log.data; + const logDataSize = getNumBytes(logData); + if (logDataSize > maxLogDataSize) { + maxLogDataSize = logDataSize; + } + if (!eventIncl && !(log.data === '0x' || log.topics.length < 2) && logDataSize <= 800) { + const rcId: RcId = { + hash: tx.hash, + blockNumber: Number(tx.blockNumber), + txIdx: Number(tx.transactionIndex), + logIdx: i, + eventSchema: log.topics[0], + }; + pushArrayUpto(data.rc.events, rcId); + } + } + + const txId: TxId = { + hash: tx.hash, + blockNumber: Number(tx.blockNumber), + txIdx: Number(tx.transactionIndex), + }; + + // TODO: Use QueryBuilder module to determine category + if (numLogs <= 20 && maxLogDataSize <= 800) { + pushArrayUpto(data.rc.category.default, txId); + } else if (numLogs <= 80 && maxLogDataSize <= 1024) { + pushArrayUpto(data.rc.category.medium, txId); + } else if (numLogs <= 80 && maxLogDataSize <= 2048) { + pushArrayUpto(data.rc.category.large, txId); + } else if (numLogs <= 400 && maxLogDataSize <= 1024){ + pushArrayUpto(data.rc.category.max, txId); + } else { + pushArrayUpto(data.rc.category.oversize, txId); + } +} + diff --git a/harness/src/types.ts b/harness/src/types.ts new file mode 100644 index 00000000..2fc78ddf --- /dev/null +++ b/harness/src/types.ts @@ -0,0 +1,24 @@ +export interface AddressId { + blockNumber: number; + address: string; +} + +export interface StorageId { + blockNumber: number; + address: string; + slot: number; +} + +export interface TxId { + hash: string; + blockNumber: number; + txIdx: number; +} + +export interface RcId { + hash: string; + blockNumber: number; + txIdx: number; + logIdx: number; + eventSchema: string; +} \ No newline at end of file diff --git a/harness/src/version.ts b/harness/src/version.ts index 94f47332..bc6d8b3f 100644 --- a/harness/src/version.ts +++ b/harness/src/version.ts @@ -1,4 +1,4 @@ // This is an autogenerated file. It should match the version number in package.json. // Do not modify this file directly. -export const HARNESS_VERSION = "2.0.8"; \ No newline at end of file +export const HARNESS_VERSION = "2.0.9"; \ No newline at end of file diff --git a/harness/test/chainData/11155111.json b/harness/test/chainData/11155111.json new file mode 100644 index 00000000..2fcc5309 --- /dev/null +++ b/harness/test/chainData/11155111.json @@ -0,0 +1,2111 @@ +{ + "chainId": "11155111", + "blockRange": { + "start": 5658516, + "end": 5672435 + }, + "blockSamples": 0, + "blockInterval": 0, + "account": { + "eoa": [ + { + "blockNumber": 5658516, + "address": "0x02b59783ae72a0a0c43dfdb31a4364fb93853973" + }, + { + "blockNumber": 5672435, + "address": "0x7e6d3ce1d282c11c3f7d75e4f73133ca66b7a95a" + }, + { + "blockNumber": 5672371, + "address": "0x7777f1a58497aeaab0326e22e2017e0830d528d0" + }, + { + "blockNumber": 5672307, + "address": "0x1fc35b79fb11ea7d4532da128dfa9db573c51b09" + }, + { + "blockNumber": 5672307, + "address": "0xf0915838d2a4f66904b895502fe8d838abb910c3" + }, + { + "blockNumber": 5672243, + "address": "0xda69829748a90d2ef053c5bc106f0711acf1d024" + }, + { + "blockNumber": 5672179, + "address": "0xd21d202855506b7ca75066928e98d693290032f5" + }, + { + "blockNumber": 5672115, + "address": "0xfe8b3731d7b5965c2ecdf10075c39be1b82146fe" + }, + { + "blockNumber": 5672115, + "address": "0x71840f52d4285e6aaa2c563da26d51f9a29102a5" + }, + { + "blockNumber": 5672051, + "address": "0x1fc35b79fb11ea7d4532da128dfa9db573c51b09" + }, + { + "blockNumber": 5672051, + "address": "0xa7c0a56605d8b43c13cfd7370be094847e1ffaf4" + }, + { + "blockNumber": 5671987, + "address": "0x897a3107bcb8e20b9ca1ef256adbf881763d3fc2" + }, + { + "blockNumber": 5671923, + "address": "0x1fc35b79fb11ea7d4532da128dfa9db573c51b09" + }, + { + "blockNumber": 5671923, + "address": "0x06201790ad00c8e2bc89cdae483ded7ae35fbe15" + }, + { + "blockNumber": 5671859, + "address": "0x73640519ddd76c32292fc4db1eb2f1737470b676" + }, + { + "blockNumber": 5671795, + "address": "0x7dd2913241c4a0d38ba22514752aa5a46aaa5b9b" + }, + { + "blockNumber": 5671731, + "address": "0x30f1a8c6f6f99984fcec4e9d59b3b2409be975ae" + }, + { + "blockNumber": 5671667, + "address": "0x5b98b836969a60fec50fa925905dd1d382a7db43" + }, + { + "blockNumber": 5671603, + "address": "0xabbc08b1e43139f8d0f603131295c46ed7ec4aca" + }, + { + "blockNumber": 5671539, + "address": "0x1fc35b79fb11ea7d4532da128dfa9db573c51b09" + }, + { + "blockNumber": 5671539, + "address": "0x95eea3180f682d8cee12b1625795abdc4c9552cb" + }, + { + "blockNumber": 5671475, + "address": "0x1d6d5ee9a5e77c3f65d9ba867f58f26f542c09ba" + }, + { + "blockNumber": 5671411, + "address": "0xa1a05af7d0cda269dbce3dd0a557eceba29ea53d" + }, + { + "blockNumber": 5671347, + "address": "0x642343927754f1884ea51b8254d54bad89f7851d" + }, + { + "blockNumber": 5671347, + "address": "0xd2536366c7cfdac351943fb35c6b05255c554e66" + }, + { + "blockNumber": 5671283, + "address": "0xc1a1ca1ecce30fdc285b825fa4758860897f62c9" + }, + { + "blockNumber": 5671219, + "address": "0x09855fcb2c3e81d6bd1d0e5ef8539fe7633d86f8" + }, + { + "blockNumber": 5671155, + "address": "0xef6abfc69070912198bba956aa599a5badc57ba2" + }, + { + "blockNumber": 5671091, + "address": "0x73c83707880273bc9c2dfc1da7d7d8a0b4d75bcf" + }, + { + "blockNumber": 5670963, + "address": "0x4fb211ab9e4c9204ad193fc46f583ec6f87bdbe8" + }, + { + "blockNumber": 5670899, + "address": "0xd2743aab1212908b870014a01e1f0fa0193964ea" + }, + { + "blockNumber": 5670899, + "address": "0xa25319a6c75d9ce68bea66269422c03ec5b24d6c" + } + ], + "contract": [ + { + "blockNumber": 5658516, + "address": "0x4c16d8c078ef6b56700c1be19a336915962df072" + }, + { + "blockNumber": 5672435, + "address": "0xf1d6d31b577a2e54f6909813bfefcd73b9341f1f" + }, + { + "blockNumber": 5672371, + "address": "0x5f4c7d793d898e64eddd1fc82d27ecfb5f6e4596" + }, + { + "blockNumber": 5672243, + "address": "0x1abddd7d12ad2076fd91f179a1a2b573e6a9ba29" + }, + { + "blockNumber": 5672179, + "address": "0xed6a79b95138b11268915e619507bacc5e27b714" + }, + { + "blockNumber": 5671987, + "address": "0xed6a79b95138b11268915e619507bacc5e27b714" + }, + { + "blockNumber": 5671859, + "address": "0xed6a79b95138b11268915e619507bacc5e27b714" + }, + { + "blockNumber": 5671795, + "address": "0x1b240fa1e884cb5e09a7a22edf2563f371c5f882" + }, + { + "blockNumber": 5671667, + "address": "0xe2bb56ee936fd6433dc0f6e7e3b8365c906aa057" + }, + { + "blockNumber": 5671603, + "address": "0x76021ab81403ac4ff0d9ce432c2fbd2d6a09daeb" + }, + { + "blockNumber": 5671475, + "address": "0xf1d6d31b577a2e54f6909813bfefcd73b9341f1f" + }, + { + "blockNumber": 5671411, + "address": "0x18d09ab904ea2150ac077d85bce16421f349e7b9" + }, + { + "blockNumber": 5671219, + "address": "0x23cb48dc37495ce1b0265c461232b30e1692a615" + }, + { + "blockNumber": 5671155, + "address": "0x5b29dae7cf1a1dcb593c36d74a87b20a2396891e" + }, + { + "blockNumber": 5670963, + "address": "0x5c00a5ddbb2e361bcd6e854f6883a70a7460fc26" + }, + { + "blockNumber": 5670835, + "address": "0xe69c601ad9417c30d99bc30d0872193ab8601727" + }, + { + "blockNumber": 5670771, + "address": "0xed6a79b95138b11268915e619507bacc5e27b714" + }, + { + "blockNumber": 5670643, + "address": "0xaae29b0366299461418f5324a79afc425be5ae21" + }, + { + "blockNumber": 5670387, + "address": "0xb76863c593d59eb08ae3f84a40039e84eeca2d95" + }, + { + "blockNumber": 5670195, + "address": "0x27764270686975a498718d62e864736332ae9a9d" + }, + { + "blockNumber": 5669875, + "address": "0x9581a212d622081719524ccfe9c632a34f5b17b1" + }, + { + "blockNumber": 5669747, + "address": "0x384528a4efc565bb10d33a58a7da64c404f4602c" + }, + { + "blockNumber": 5669683, + "address": "0x9dad05893305352cdd142f79e36bc39393f23770" + }, + { + "blockNumber": 5669555, + "address": "0xed6a79b95138b11268915e619507bacc5e27b714" + }, + { + "blockNumber": 5669363, + "address": "0x7c9e161ebe55000a3220f972058fb83273653a6e" + }, + { + "blockNumber": 5669235, + "address": "0x147617a1cc30a64bc35dc1cc6e239db5c8e85e53" + }, + { + "blockNumber": 5669171, + "address": "0x1cac39dc151354e2035c6db28e49151c9579e879" + }, + { + "blockNumber": 5668979, + "address": "0x12e2ca2cc70f1742eda01c2980ac43ca5f12cbfd" + }, + { + "blockNumber": 5668915, + "address": "0xdf2cf2ce358c60ab9c48abb2f8187aed0d28dd26" + }, + { + "blockNumber": 5668851, + "address": "0x557c5ce22f877d975c2cb13d0a961a182d740fd5" + }, + { + "blockNumber": 5668787, + "address": "0xaae29b0366299461418f5324a79afc425be5ae21" + }, + { + "blockNumber": 5668723, + "address": "0x26839364ea94a8f5758539605e75dcf2522cf34e" + } + ] + }, + "storage": { + "nonzero": [ + { + "blockNumber": 5658516, + "address": "0x53844f9577c2334e541aec7df7174ece5df1fcf0", + "slot": 3 + }, + { + "blockNumber": 5672435, + "address": "0x01469dacfdda885d68ff0f8628f2629c14f95a20", + "slot": 2 + }, + { + "blockNumber": 5672371, + "address": "0x318b13467537f58890002847fe71eb2a74b6a5a5", + "slot": 1 + }, + { + "blockNumber": 5672307, + "address": "0x6977ec5fae3862d3471f0f5b6dcc64cdf5cfd959", + "slot": 2 + }, + { + "blockNumber": 5672243, + "address": "0xc3f6476c6c05a963462af50d4c51f1290ba31c0b", + "slot": 5 + }, + { + "blockNumber": 5672179, + "address": "0x491d755a33f6eb77a890925414dd5daea42e3d7c", + "slot": 3 + }, + { + "blockNumber": 5672115, + "address": "0x422ae3c25eb0eb2c5df2ce1f53123ca862b67659", + "slot": 8 + }, + { + "blockNumber": 5672051, + "address": "0xe877139db8095dd59fcbbfd65a02ae08592ac8ea", + "slot": 2 + }, + { + "blockNumber": 5671987, + "address": "0x4e8059f4df6174a5a88376e4aa959b9e7f36f2c3", + "slot": 4 + }, + { + "blockNumber": 5671923, + "address": "0xcdee63eba9149219bb3ed23b08c4f14cc239f512", + "slot": 0 + }, + { + "blockNumber": 5671859, + "address": "0x5c00a5ddbb2e361bcd6e854f6883a70a7460fc26", + "slot": 0 + }, + { + "blockNumber": 5671795, + "address": "0x1b240fa1e884cb5e09a7a22edf2563f371c5f882", + "slot": 0 + }, + { + "blockNumber": 5671731, + "address": "0x1abddd7d12ad2076fd91f179a1a2b573e6a9ba29", + "slot": 1 + }, + { + "blockNumber": 5671667, + "address": "0xfd57b4ddbf88a4e07ff4e34c487b99af2fe82a05", + "slot": 9 + }, + { + "blockNumber": 5671603, + "address": "0xbb5ed4265de177516699f59bddab841ddde97e5e", + "slot": 1 + }, + { + "blockNumber": 5671539, + "address": "0xb4d360459f32dd641ef5a6985ffbac5c4e5521aa", + "slot": 4 + }, + { + "blockNumber": 5671475, + "address": "0xbde2aed54521000dc033b67fb522034e0f93a7e5", + "slot": 1 + }, + { + "blockNumber": 5671411, + "address": "0xab260022803e6735a81256604d73115d663c6b82", + "slot": 7 + }, + { + "blockNumber": 5671347, + "address": "0x803d4e0b5fee1463b23592a3ef57f015d455eb67", + "slot": 1 + }, + { + "blockNumber": 5671283, + "address": "0xbb5ed4265de177516699f59bddab841ddde97e5e", + "slot": 1 + }, + { + "blockNumber": 5671219, + "address": "0xbc7155a7bb411563a5b518b76f2c1ec51b380632", + "slot": 6 + }, + { + "blockNumber": 5671155, + "address": "0xbde2aed54521000dc033b67fb522034e0f93a7e5", + "slot": 1 + }, + { + "blockNumber": 5671091, + "address": "0xe877139db8095dd59fcbbfd65a02ae08592ac8ea", + "slot": 2 + }, + { + "blockNumber": 5670963, + "address": "0x306b9a8953b9462f8b826e6768a93c8ea7454965", + "slot": 0 + }, + { + "blockNumber": 5670899, + "address": "0xb24696afae649023d95f46eca348e4482ad77dfd", + "slot": 6 + }, + { + "blockNumber": 5670835, + "address": "0x19fc4f304c1198c8ae1c23630a1611b27883693a", + "slot": 7 + }, + { + "blockNumber": 5670771, + "address": "0x491d755a33f6eb77a890925414dd5daea42e3d7c", + "slot": 5 + }, + { + "blockNumber": 5670707, + "address": "0x4e8059f4df6174a5a88376e4aa959b9e7f36f2c3", + "slot": 3 + }, + { + "blockNumber": 5670643, + "address": "0x239d2c5c552bdca54f021800f22eee4dd46e77c5", + "slot": 0 + }, + { + "blockNumber": 5670579, + "address": "0xa2a620c234cd6c113412a350ce390757e0e73898", + "slot": 1 + }, + { + "blockNumber": 5670515, + "address": "0xe877139db8095dd59fcbbfd65a02ae08592ac8ea", + "slot": 7 + }, + { + "blockNumber": 5670451, + "address": "0xed6a79b95138b11268915e619507bacc5e27b714", + "slot": 0 + } + ] + }, + "tx": { + "type": { + "0": [ + { + "hash": "0x345448ac0b6d9146f9396c19c934504dce6ad7e36c2cf38b42bfcf083b0e9b76", + "blockNumber": 5658516, + "txIdx": 0 + }, + { + "hash": "0xb79ce1617b170f893cf2caba8a972d1dda057b0e986d136f52a0bf5f842d97ef", + "blockNumber": 5658516, + "txIdx": 1 + }, + { + "hash": "0xf9307a635215f89a27bfa12e6f05a16b2feae8993c98774b5c20c185fc852a14", + "blockNumber": 5658516, + "txIdx": 47 + }, + { + "hash": "0xbf0c62d06c7dce0d95d3f4e48f1e47093f2f9a9c570ed8c17d510cbb84351b51", + "blockNumber": 5658516, + "txIdx": 48 + }, + { + "hash": "0xdeb90a584f2325d47c1ccc6e067cbee9d75bf8807696e129e30fbbc79de086f2", + "blockNumber": 5658516, + "txIdx": 90 + }, + { + "hash": "0xc96ec672e144987d366dc99a8697b34fb643b604933f5d6c61313839b06b88b4", + "blockNumber": 5658516, + "txIdx": 91 + }, + { + "hash": "0xe98374d33749e86e1b81da708aa1b619dfb80fff005958aff2a5e304e422d82c", + "blockNumber": 5658516, + "txIdx": 92 + }, + { + "hash": "0x541a90fd7c5b476ba1b0fb4d86e5c362c5cebe82d57513f18e74bf4bbf0f3f29", + "blockNumber": 5672435, + "txIdx": 0 + }, + { + "hash": "0xf0b38b89e523298533c8e9b200a215d0163bde27fbfc3d446527d6e0b91e5a77", + "blockNumber": 5672435, + "txIdx": 1 + }, + { + "hash": "0xa75a1a626df63439cb6d8a12e08833a7c1b6b4dd3f022499f6d292e2ade63eb6", + "blockNumber": 5672435, + "txIdx": 6 + }, + { + "hash": "0x8ab0d8dfe52f39d8deafc3b9aabff6eed46e584a6518bef7f29bb8b923671a9b", + "blockNumber": 5672435, + "txIdx": 7 + }, + { + "hash": "0x66f1e4af508c88fcbf3d243d012bd629a8ce2442ba96410469a164c69f389dc0", + "blockNumber": 5672435, + "txIdx": 9 + }, + { + "hash": "0x74adcd782303ef27e430424affcf174b3b6fd20278ef6038460355e1f5a1e906", + "blockNumber": 5672435, + "txIdx": 10 + }, + { + "hash": "0xe9b1085d7fe950ac7941f4248be41d6061a2171b604e8a1f7e81c56b01f17ae9", + "blockNumber": 5672435, + "txIdx": 47 + }, + { + "hash": "0xaaefc43c93834f4a7ba504ca87ad781bca5299419f183277a361dcd0a1dd8dc5", + "blockNumber": 5672435, + "txIdx": 48 + }, + { + "hash": "0xda55bd42d9297c0e8f29d7bcd12a1ee315e68a9a0e6b9429f0bd0cf2e487fa71", + "blockNumber": 5672435, + "txIdx": 49 + }, + { + "hash": "0x046c9d91446454bf513d3a0c5166ce464326cc3196f8d36305d34eb7b2069bd1", + "blockNumber": 5672435, + "txIdx": 50 + }, + { + "hash": "0xfc07416b01b9e0d162032ece2aa0ba09bdc4737a4d1d3b2c93d266af3e01883d", + "blockNumber": 5672435, + "txIdx": 51 + }, + { + "hash": "0xca8fabdaf1785a13a6ec3f3185085fad2a627b5942efd809ecbb59e83e535718", + "blockNumber": 5672435, + "txIdx": 52 + }, + { + "hash": "0x32903fdcdc1d0aaa5526e023e00eb486ed80c8db231cfac97bb0025b2a2c33ce", + "blockNumber": 5672435, + "txIdx": 53 + }, + { + "hash": "0xa0f882605fc6e18db7e991edc41a11e652bc574094d1bbf13fb45598af82047d", + "blockNumber": 5672435, + "txIdx": 54 + }, + { + "hash": "0xdd7a925b33d5a95ec0507b46d3f97f28b805753abfc065be20b7549de5f7cc3e", + "blockNumber": 5672435, + "txIdx": 55 + }, + { + "hash": "0x8e6b0f1e53caac802e85b40502cdbe35f0f215241352a58e95c66a5f087deba7", + "blockNumber": 5672435, + "txIdx": 56 + }, + { + "hash": "0x2158178b59466b932642f64adc3d687c7605d694d64231ca9268e7aee378638d", + "blockNumber": 5672435, + "txIdx": 57 + }, + { + "hash": "0xe6e321596dfc4986680e84b7a7692c26a5db6e0d8438b8dfe98c1e5d62df360c", + "blockNumber": 5672435, + "txIdx": 58 + }, + { + "hash": "0xa734fa7e2337a73f6bbb34b6bcd3ba14caa6808cc752ef11fc32640c49b7953b", + "blockNumber": 5672435, + "txIdx": 59 + }, + { + "hash": "0x354093ff089f8d9ed2a591cde93e409408184e258a8efcb0b38272d41669d949", + "blockNumber": 5672435, + "txIdx": 60 + }, + { + "hash": "0x49de8cbce7351737ba50d971451954154901d0e6c3f36efacb772a0f4f1b8d4c", + "blockNumber": 5672435, + "txIdx": 61 + }, + { + "hash": "0x71e0ff3fdb4925f1eed7dc3da443754ad84c3c1aabf7728a60ba6b8b9980d6cf", + "blockNumber": 5672435, + "txIdx": 62 + }, + { + "hash": "0xb93500121558a4441ee29bf68fa0087b01dff7ef00ee8124781e09125c5f8d38", + "blockNumber": 5672435, + "txIdx": 63 + }, + { + "hash": "0xea2527df26938327f3b64c537fee05a4aedde177c055e5f31a3eecfa9da20d7f", + "blockNumber": 5672371, + "txIdx": 0 + }, + { + "hash": "0x23663494cbd45fa412f663aaaae3507f65472ff1fac1024faec8d88d4cc6f875", + "blockNumber": 5672371, + "txIdx": 25 + } + ], + "1": [ + { + "hash": "0x83b721d438055defac77c668ca410499fe71443a931e9948d64b1fb93f31af38", + "blockNumber": 5670515, + "txIdx": 45 + }, + { + "hash": "0xe14ff0d930fe39f4d8c0ca83b54e374a967d401eebc896292a39c23673e136f9", + "blockNumber": 5670515, + "txIdx": 46 + }, + { + "hash": "0xff837e93cd4f08e90f08b0bb73e96110039a3e56b0e28d3814bad285de35ec07", + "blockNumber": 5670515, + "txIdx": 47 + }, + { + "hash": "0x2e5b18405aa288feb2eb312c0afa25e722f50bda26dc4caeca706a749c37de20", + "blockNumber": 5670515, + "txIdx": 48 + }, + { + "hash": "0xa9686f91cee9ec07148152edf8f45901dc8a71f129208651337f3052b866d09e", + "blockNumber": 5670515, + "txIdx": 49 + }, + { + "hash": "0x39c5eebf1f90e005124bc63736d7a2d39e4118d81d3b513d47b281ea3ad29f35", + "blockNumber": 5670515, + "txIdx": 50 + }, + { + "hash": "0x50893834fa14b6ff3db9d7b6a144dfd7c9ffe08c280491e90cb87a8b5c9df51b", + "blockNumber": 5670195, + "txIdx": 36 + } + ], + "2": [ + { + "hash": "0x98bdbbbb6f1d2476149d7bb1e776d4ec2c2a0044a91f61bcb5a8b7c6d9e196fb", + "blockNumber": 5658516, + "txIdx": 2 + }, + { + "hash": "0x013a9d2206cb9633a5c990eb5729ab50ba6b6877276d2aec061747de3983cd9c", + "blockNumber": 5658516, + "txIdx": 3 + }, + { + "hash": "0x65f9ccddd0a4eb0a038374d623c4c5df074ef378abb17a2e6a6852ce4a72e3cb", + "blockNumber": 5658516, + "txIdx": 4 + }, + { + "hash": "0xf527470577bf44e330e734f930c92b936df5b750b821e62ac4098a25f3fe809e", + "blockNumber": 5658516, + "txIdx": 5 + }, + { + "hash": "0x830c35bca49dea066349cbebc2538e5e9b8e75d7e7cfb37006d4245112041d2a", + "blockNumber": 5658516, + "txIdx": 6 + }, + { + "hash": "0xe69c64d5469ac429c6ce932ed605dd752d617e82dff500e690e3057324c61444", + "blockNumber": 5658516, + "txIdx": 7 + }, + { + "hash": "0x70df3b2b2d42b840996898f624382b2f0e1fbc18da7e78a7c04207f41720a868", + "blockNumber": 5658516, + "txIdx": 8 + }, + { + "hash": "0x0c54a63947e9853e234ca2a25b0800618c7a80af7b8e26e96407dd497723d3a5", + "blockNumber": 5658516, + "txIdx": 9 + }, + { + "hash": "0xfe847d18c7d83a07f170d838f1d420bca0bf6ce8c69d53ef2e87a15a6d012934", + "blockNumber": 5658516, + "txIdx": 10 + }, + { + "hash": "0xf6e748f71bb4b98086dca90fdd208c564cdc4ba9eb137542b82c8058acf377f0", + "blockNumber": 5658516, + "txIdx": 11 + }, + { + "hash": "0xf6abc7334dcaf3ea635c41693ce2c44bfc3fac43ad146b5d2f99cd81247b1a36", + "blockNumber": 5658516, + "txIdx": 12 + }, + { + "hash": "0x5cb6951c94aa0d369758f16df585cb90f5492be73687cff9748c81ac48b7e236", + "blockNumber": 5658516, + "txIdx": 13 + }, + { + "hash": "0x904ed694d7c6f451ec5a65dcfc26d146abb738bd9710d4ec508452affb1a2a5c", + "blockNumber": 5658516, + "txIdx": 14 + }, + { + "hash": "0xa28998b6677f4f009b66a697af63f10a2a354eceba408f888b7948fe7a14153c", + "blockNumber": 5658516, + "txIdx": 15 + }, + { + "hash": "0x0948cf012776f60df59aa31eb2bfbe665825854d45168a3c29bbc8280d43195e", + "blockNumber": 5658516, + "txIdx": 16 + }, + { + "hash": "0xf2f5d3ffc324db90a22459fe4c06249a3245983cb5f15cba9967314f58fdf58f", + "blockNumber": 5658516, + "txIdx": 17 + }, + { + "hash": "0x685e714ce88bf4dda95a3e0fac4badcac33e482559fe635ed71f990bdbd58c72", + "blockNumber": 5658516, + "txIdx": 18 + }, + { + "hash": "0xdd2e109abc903b045a696073cfd919b24f994b088ce3da15c261fafaa4855bbd", + "blockNumber": 5658516, + "txIdx": 19 + }, + { + "hash": "0xf8535005a7584dc0b1416349d2b7d5b357f6a6ff775bd3ac4d45097e96ab17b7", + "blockNumber": 5658516, + "txIdx": 20 + }, + { + "hash": "0x2d4323b55a6e49fa09a00020557f57353dddfcd80ca4bcb27d4c3738af989767", + "blockNumber": 5658516, + "txIdx": 21 + }, + { + "hash": "0x5dfdeea1641316995fdfead8e27220d1f57daba1ecab24e6985c3c43e8809ac0", + "blockNumber": 5658516, + "txIdx": 22 + }, + { + "hash": "0xc9654dcade2014319a7f39e043a61e1e6db0197a386b1d2d6eb7291cbdcdfb22", + "blockNumber": 5658516, + "txIdx": 23 + }, + { + "hash": "0x24d1fca522c1e84ad8ea08a42ff80ababdbf956d4db85d206c318f8d76e84a95", + "blockNumber": 5658516, + "txIdx": 24 + }, + { + "hash": "0xc7a1485168c06b55c4811255499a53d5b9c0fe256e27aaeda4d3452da1bdf119", + "blockNumber": 5658516, + "txIdx": 25 + }, + { + "hash": "0x3840b93d2afbe1d9176877628b687cdb7a6751dff6622c722fdf17d2694487c3", + "blockNumber": 5658516, + "txIdx": 26 + }, + { + "hash": "0xba50a11ee3af20dd725a3a01fdf50ab0c22a9a400f091ccf1472c7b631a98fa9", + "blockNumber": 5658516, + "txIdx": 27 + }, + { + "hash": "0x5572b5ec03502c40ba04502a28d2f70b641716aa01198dbd438ac52c87e3200f", + "blockNumber": 5658516, + "txIdx": 28 + }, + { + "hash": "0x92ca7e60350b2eeb82d1fd9f346c7d9564e90ea70a43858bed62639a6371532a", + "blockNumber": 5658516, + "txIdx": 29 + }, + { + "hash": "0x08916be1e5c9c28ee730ae0fa40579662134c3f7d0f290be71eab5e93733caf9", + "blockNumber": 5658516, + "txIdx": 30 + }, + { + "hash": "0x740c90c98bfdc39c048d235752d52286ea21cf730bd3ebda8d39b982466ab67a", + "blockNumber": 5658516, + "txIdx": 31 + }, + { + "hash": "0x85bc03b274607c794e4b8b7ce815e58aa034595a5b78209c989da021f8506c26", + "blockNumber": 5658516, + "txIdx": 32 + }, + { + "hash": "0x819170c8cf05626963ddce4e6b6a44c273795f5388f4bd4469ed23a5e2db4722", + "blockNumber": 5658516, + "txIdx": 33 + } + ], + "3": [ + { + "hash": "0x2ee14573f5f2d487065406dfe11564978a4ae0cc661e9126a82984056abfbb90", + "blockNumber": 5672435, + "txIdx": 5 + }, + { + "hash": "0x13f4c932d341a654e4ab7fce0afddac99c55cc1566ee9be2dd7bd3069e0e7870", + "blockNumber": 5672435, + "txIdx": 82 + }, + { + "hash": "0xa63ae6c5029741fcefb73d153cc9458b92e100d010f630930148f366b1af9246", + "blockNumber": 5672435, + "txIdx": 83 + }, + { + "hash": "0xe6a7be27fea2c544f3f79298c156bb56630bf6fa6acc7a63f165e30438af0935", + "blockNumber": 5672371, + "txIdx": 24 + }, + { + "hash": "0x040be635310331478528a2f77cf8e813c0bb1d3eca2f9e4b80350ee878dacecb", + "blockNumber": 5672371, + "txIdx": 30 + }, + { + "hash": "0x913e176ab96173c61230ef3f65799f8f249fc50d4beb47570bd2a8d5e140fe7e", + "blockNumber": 5672371, + "txIdx": 78 + }, + { + "hash": "0x8d4e7254972e9ecf6883345702ac12abaf561466f5154073b60dc2173647a0cc", + "blockNumber": 5672371, + "txIdx": 79 + }, + { + "hash": "0x48459714c9c1d8f92d87f02ec5491a673d5a78892ff7db38533a00e9ea5f3c3f", + "blockNumber": 5672371, + "txIdx": 80 + }, + { + "hash": "0x414be213de9b1869f6a5c0300c9f5bc8819d09248398c81a3048f63b762274e7", + "blockNumber": 5672371, + "txIdx": 81 + }, + { + "hash": "0x708fe81ea8d6333401d38fa1ec6f9c433092f87c5c6d1dc5a427b861dba092eb", + "blockNumber": 5672307, + "txIdx": 77 + }, + { + "hash": "0x3b5542322c145d157130ba96a85a97586a38104a9398a9e8f32066da0c458905", + "blockNumber": 5672243, + "txIdx": 80 + }, + { + "hash": "0x00a60575e119fac3b6999080aed2fc2ef5e2c6c93189d4be615df31deac08f20", + "blockNumber": 5672179, + "txIdx": 23 + }, + { + "hash": "0xe852d2b908933d30e695af5247da225c3e850ba436dea243dc01dedf0ed070bf", + "blockNumber": 5672179, + "txIdx": 73 + }, + { + "hash": "0xc37eb8d862395f4bfe2ee76eea31939fe3a8862e8810ec5b72b3f519e84dd99a", + "blockNumber": 5672179, + "txIdx": 74 + }, + { + "hash": "0xd64fa0628a77599603799645e17609a075b0dbd3f82b1a6176ab7ea37f45fc97", + "blockNumber": 5672115, + "txIdx": 87 + }, + { + "hash": "0xb5f1b1780fa1bbfd822664eed06469ee57549cdc524a3c20191c136c63d4cd02", + "blockNumber": 5672115, + "txIdx": 88 + }, + { + "hash": "0x8adf00a882963b8227ae9843c82a571ca23cc1c6b2a0b0e8bbcf8cb5576265bd", + "blockNumber": 5672051, + "txIdx": 34 + }, + { + "hash": "0x25a76241df80f2deaa5407a98e18e1404bd800219b74d15f9a04caa054a4dad9", + "blockNumber": 5672051, + "txIdx": 35 + }, + { + "hash": "0x82bd64762e1824221f41032ad5e9649ae3097c5c4713728e1e60b29e85bb330a", + "blockNumber": 5672051, + "txIdx": 36 + }, + { + "hash": "0xfb25a156b45572a6914bd3f8a1688c6159ca935b3ad47d1e41a899ccafcba7d7", + "blockNumber": 5672051, + "txIdx": 182 + }, + { + "hash": "0xdb7481a82fd4fccf6510dc0d91b6cabc52afa86066201d1d1d9487cc1298ca46", + "blockNumber": 5672051, + "txIdx": 183 + }, + { + "hash": "0xbf048dac277c48337f8a58ddecf271715ae4247dc084cbf4dea085b489322869", + "blockNumber": 5671987, + "txIdx": 0 + }, + { + "hash": "0x51ed2c2d8976d912cf2b39c459f72afbf5b7eb1d97ad12c77bd3723ae94b425e", + "blockNumber": 5671987, + "txIdx": 1 + }, + { + "hash": "0xcd244c0da7c7816ae6a28d5f4498f6e08014d4f7e41ada5d891cfbb34474b442", + "blockNumber": 5671923, + "txIdx": 22 + }, + { + "hash": "0x5e1539c95f047450c6b2ead9305268aa57cd5cdbeb3d6f01e16834c69275c8eb", + "blockNumber": 5671923, + "txIdx": 23 + }, + { + "hash": "0xb2cd94796e086c0349ce0bbfd85835afbdbe14cac77dfde3eb148c8be16151f9", + "blockNumber": 5671923, + "txIdx": 28 + }, + { + "hash": "0x733b99afe081bb8a425cac5460198bdd0bd00e01e8654da9dac990c496b60a3a", + "blockNumber": 5671923, + "txIdx": 29 + }, + { + "hash": "0x1244cc638943e2f5e1c20f92355da0fe7bca439ff8c8f919a1c3e752f8925cf1", + "blockNumber": 5671923, + "txIdx": 85 + }, + { + "hash": "0x1056046e00bfef0ea4f1a1ed5ba7efcd96d4aa31de94bfa7660d14f921749dca", + "blockNumber": 5671923, + "txIdx": 86 + }, + { + "hash": "0x26db3c7657f3b2042393531e12a098697f986a15d45b68f1baf6a6bc2763aace", + "blockNumber": 5671859, + "txIdx": 14 + }, + { + "hash": "0x23d38f55bde5dc6a467244690a8283b2065edb95b9bb27080ca943bb7dc149ae", + "blockNumber": 5671859, + "txIdx": 62 + }, + { + "hash": "0x5322870bda9eacea7e75626bf1165c296545de343021a5042638b7d78001e232", + "blockNumber": 5671795, + "txIdx": 6 + } + ] + }, + "category": { + "default": [ + { + "hash": "0x345448ac0b6d9146f9396c19c934504dce6ad7e36c2cf38b42bfcf083b0e9b76", + "blockNumber": 5658516, + "txIdx": 0 + }, + { + "hash": "0xb79ce1617b170f893cf2caba8a972d1dda057b0e986d136f52a0bf5f842d97ef", + "blockNumber": 5658516, + "txIdx": 1 + }, + { + "hash": "0x98bdbbbb6f1d2476149d7bb1e776d4ec2c2a0044a91f61bcb5a8b7c6d9e196fb", + "blockNumber": 5658516, + "txIdx": 2 + }, + { + "hash": "0x013a9d2206cb9633a5c990eb5729ab50ba6b6877276d2aec061747de3983cd9c", + "blockNumber": 5658516, + "txIdx": 3 + }, + { + "hash": "0x65f9ccddd0a4eb0a038374d623c4c5df074ef378abb17a2e6a6852ce4a72e3cb", + "blockNumber": 5658516, + "txIdx": 4 + }, + { + "hash": "0xf527470577bf44e330e734f930c92b936df5b750b821e62ac4098a25f3fe809e", + "blockNumber": 5658516, + "txIdx": 5 + }, + { + "hash": "0x70df3b2b2d42b840996898f624382b2f0e1fbc18da7e78a7c04207f41720a868", + "blockNumber": 5658516, + "txIdx": 8 + }, + { + "hash": "0x0c54a63947e9853e234ca2a25b0800618c7a80af7b8e26e96407dd497723d3a5", + "blockNumber": 5658516, + "txIdx": 9 + }, + { + "hash": "0xfe847d18c7d83a07f170d838f1d420bca0bf6ce8c69d53ef2e87a15a6d012934", + "blockNumber": 5658516, + "txIdx": 10 + }, + { + "hash": "0xf6e748f71bb4b98086dca90fdd208c564cdc4ba9eb137542b82c8058acf377f0", + "blockNumber": 5658516, + "txIdx": 11 + }, + { + "hash": "0xf6abc7334dcaf3ea635c41693ce2c44bfc3fac43ad146b5d2f99cd81247b1a36", + "blockNumber": 5658516, + "txIdx": 12 + }, + { + "hash": "0x5cb6951c94aa0d369758f16df585cb90f5492be73687cff9748c81ac48b7e236", + "blockNumber": 5658516, + "txIdx": 13 + }, + { + "hash": "0x904ed694d7c6f451ec5a65dcfc26d146abb738bd9710d4ec508452affb1a2a5c", + "blockNumber": 5658516, + "txIdx": 14 + }, + { + "hash": "0xa28998b6677f4f009b66a697af63f10a2a354eceba408f888b7948fe7a14153c", + "blockNumber": 5658516, + "txIdx": 15 + }, + { + "hash": "0x0948cf012776f60df59aa31eb2bfbe665825854d45168a3c29bbc8280d43195e", + "blockNumber": 5658516, + "txIdx": 16 + }, + { + "hash": "0xf2f5d3ffc324db90a22459fe4c06249a3245983cb5f15cba9967314f58fdf58f", + "blockNumber": 5658516, + "txIdx": 17 + }, + { + "hash": "0x685e714ce88bf4dda95a3e0fac4badcac33e482559fe635ed71f990bdbd58c72", + "blockNumber": 5658516, + "txIdx": 18 + }, + { + "hash": "0xdd2e109abc903b045a696073cfd919b24f994b088ce3da15c261fafaa4855bbd", + "blockNumber": 5658516, + "txIdx": 19 + }, + { + "hash": "0xf8535005a7584dc0b1416349d2b7d5b357f6a6ff775bd3ac4d45097e96ab17b7", + "blockNumber": 5658516, + "txIdx": 20 + }, + { + "hash": "0x2d4323b55a6e49fa09a00020557f57353dddfcd80ca4bcb27d4c3738af989767", + "blockNumber": 5658516, + "txIdx": 21 + }, + { + "hash": "0x5dfdeea1641316995fdfead8e27220d1f57daba1ecab24e6985c3c43e8809ac0", + "blockNumber": 5658516, + "txIdx": 22 + }, + { + "hash": "0xc9654dcade2014319a7f39e043a61e1e6db0197a386b1d2d6eb7291cbdcdfb22", + "blockNumber": 5658516, + "txIdx": 23 + }, + { + "hash": "0x24d1fca522c1e84ad8ea08a42ff80ababdbf956d4db85d206c318f8d76e84a95", + "blockNumber": 5658516, + "txIdx": 24 + }, + { + "hash": "0xc7a1485168c06b55c4811255499a53d5b9c0fe256e27aaeda4d3452da1bdf119", + "blockNumber": 5658516, + "txIdx": 25 + }, + { + "hash": "0x3840b93d2afbe1d9176877628b687cdb7a6751dff6622c722fdf17d2694487c3", + "blockNumber": 5658516, + "txIdx": 26 + }, + { + "hash": "0xba50a11ee3af20dd725a3a01fdf50ab0c22a9a400f091ccf1472c7b631a98fa9", + "blockNumber": 5658516, + "txIdx": 27 + }, + { + "hash": "0x5572b5ec03502c40ba04502a28d2f70b641716aa01198dbd438ac52c87e3200f", + "blockNumber": 5658516, + "txIdx": 28 + }, + { + "hash": "0x92ca7e60350b2eeb82d1fd9f346c7d9564e90ea70a43858bed62639a6371532a", + "blockNumber": 5658516, + "txIdx": 29 + }, + { + "hash": "0x08916be1e5c9c28ee730ae0fa40579662134c3f7d0f290be71eab5e93733caf9", + "blockNumber": 5658516, + "txIdx": 30 + }, + { + "hash": "0x740c90c98bfdc39c048d235752d52286ea21cf730bd3ebda8d39b982466ab67a", + "blockNumber": 5658516, + "txIdx": 31 + }, + { + "hash": "0x85bc03b274607c794e4b8b7ce815e58aa034595a5b78209c989da021f8506c26", + "blockNumber": 5658516, + "txIdx": 32 + }, + { + "hash": "0x819170c8cf05626963ddce4e6b6a44c273795f5388f4bd4469ed23a5e2db4722", + "blockNumber": 5658516, + "txIdx": 33 + } + ], + "large": [ + { + "hash": "0x430045c7b096d7aa136e6911be5e7a604d2789c65b58579c7d68d96dfa41ae55", + "blockNumber": 5658516, + "txIdx": 57 + }, + { + "hash": "0xf13afd48285f59f9c4914d3ce8a3008914e8d644278b27a329e7d4dc476d50df", + "blockNumber": 5658516, + "txIdx": 58 + }, + { + "hash": "0xa38446e612c11eec2b11ba7aa92540439ee4dae91b84094b71cc19c178887d28", + "blockNumber": 5658516, + "txIdx": 63 + }, + { + "hash": "0xcb57531bcdd52280384e0f981ee78cdfbc6646e1e5eaaeb891295ac1abbb26ce", + "blockNumber": 5658516, + "txIdx": 68 + }, + { + "hash": "0xdeb90a584f2325d47c1ccc6e067cbee9d75bf8807696e129e30fbbc79de086f2", + "blockNumber": 5658516, + "txIdx": 90 + }, + { + "hash": "0xff79c84339d8c6cfcec5232c40844c87190392fb6ab971201e08d6325e8bd9a3", + "blockNumber": 5672435, + "txIdx": 71 + }, + { + "hash": "0xf72ed1892a7cc610369f4bb3ac78abad08976f9c36f4c00c8d688dd51a5668a7", + "blockNumber": 5672371, + "txIdx": 72 + }, + { + "hash": "0x3b588c43da8d69d8faa52e71f8a29957195540a3ebf0bd4f89337c2e74d7da61", + "blockNumber": 5672371, + "txIdx": 120 + }, + { + "hash": "0x07f5d8230407254b2321da949369ce68e3cbcd628b1eda68f225085fbe5ab588", + "blockNumber": 5672243, + "txIdx": 55 + }, + { + "hash": "0x1b9e1a0a9a8e49198b28b5e2ee9153135efd11e89b111553794c121d6f87c8f9", + "blockNumber": 5672051, + "txIdx": 49 + }, + { + "hash": "0x704116ff8b366fce1949f9cce81d198f7b3564fb35ad3460a4011df9b91d76ea", + "blockNumber": 5672051, + "txIdx": 165 + }, + { + "hash": "0x2fd212d9d36f41794d580d5c46776ea6b62261f7487429954fa0a8303c883ecc", + "blockNumber": 5671923, + "txIdx": 34 + }, + { + "hash": "0x58ebfd171aa7fddc5a762a1a4383acaf4730568e1c6bdcd34b565ede014c26ae", + "blockNumber": 5671923, + "txIdx": 40 + }, + { + "hash": "0x1b5acd8dd82411ee07dcef6fd8a66ef58aacb68c868971fcc69165ef24ca04f9", + "blockNumber": 5671859, + "txIdx": 90 + }, + { + "hash": "0x25f5555173bf3b3d41f84cb20b692fbb07bc0fb063a66f65b9077ecc48a342e9", + "blockNumber": 5671795, + "txIdx": 19 + }, + { + "hash": "0xfce380d39c72969042d25fff99b6f02d209920eea43612b1f3127e0128c51cd1", + "blockNumber": 5671731, + "txIdx": 10 + }, + { + "hash": "0x2de468dd36a4b2d81b844ec07323540c36493019ab6c590605ee64d1b12ed9bf", + "blockNumber": 5671731, + "txIdx": 67 + }, + { + "hash": "0xc7c037baca295f870ecc2d4930825e029e2e3699c8e41cf02449248318fc3ce7", + "blockNumber": 5671667, + "txIdx": 46 + }, + { + "hash": "0x949c9c41dcdc3b9b086b3c9379115b0c7a99b1e4a94903de4516906e5a400222", + "blockNumber": 5671475, + "txIdx": 59 + }, + { + "hash": "0xabed40d114051f538e071f6939b25ddcfb973f411ab94650ebd2602b2976e33c", + "blockNumber": 5671155, + "txIdx": 0 + }, + { + "hash": "0x251d2efeb00082133360e4c4d981aae3fa408803d9daa34c46ef3ba689214693", + "blockNumber": 5671155, + "txIdx": 1 + }, + { + "hash": "0xa3d68a8db7b366648b89f7e02399acbbb645429dcbedf06c8ae9878111916ac2", + "blockNumber": 5671155, + "txIdx": 55 + }, + { + "hash": "0x131816b7101eb3b9043c34c340f2038ad1294f6775cb86ced5394d2db9c30d50", + "blockNumber": 5671091, + "txIdx": 8 + }, + { + "hash": "0x59ebf08691ec1842c9ac6bf75908c25da1ef0d1e7a33374beaa71d44d638d5d6", + "blockNumber": 5671091, + "txIdx": 19 + }, + { + "hash": "0xe042a863e31a95b8d4937c6a536484f092d7e1b19f9725c9ef8031fcaf4871f5", + "blockNumber": 5670963, + "txIdx": 6 + }, + { + "hash": "0xe7f84bb1184508cf57d87348319c4ed4cf025b3c888e1d49c907be993b53dac9", + "blockNumber": 5670707, + "txIdx": 41 + }, + { + "hash": "0xb64a608ba2851749eceb513dda1be5d58e4e362fb8476ad81bc27129a38abb7e", + "blockNumber": 5670579, + "txIdx": 73 + }, + { + "hash": "0x997f4d91fa0dc20a5c90448013778f25fff356c879af4b8837b6d65f979eb8bd", + "blockNumber": 5670451, + "txIdx": 1 + }, + { + "hash": "0xb9e5ecd796d326dbb37c6e7be21290afad017a0b18d102ede58aeb17b6ed9bd5", + "blockNumber": 5670451, + "txIdx": 32 + }, + { + "hash": "0x7176abf4b2d4d69e543d03ef097145777a469e1765b07a3ba0b60aad829af3ae", + "blockNumber": 5670387, + "txIdx": 13 + }, + { + "hash": "0x6a96f8b22e751545d3f3c40ff49da6bb3973fb9ef5ed05476d5beb05d3f5ec00", + "blockNumber": 5670387, + "txIdx": 14 + }, + { + "hash": "0x39e53eeb2a492a75c666832995f2728e7216a66538d7d8405c0ed3d5da5a7816", + "blockNumber": 5670387, + "txIdx": 15 + } + ], + "max": [ + { + "hash": "0x830c35bca49dea066349cbebc2538e5e9b8e75d7e7cfb37006d4245112041d2a", + "blockNumber": 5658516, + "txIdx": 6 + }, + { + "hash": "0xe69c64d5469ac429c6ce932ed605dd752d617e82dff500e690e3057324c61444", + "blockNumber": 5658516, + "txIdx": 7 + }, + { + "hash": "0x35cf2493df09ac08653d9afceebce7921ad2cc6baf4310e25deb53350dc50ab4", + "blockNumber": 5658516, + "txIdx": 51 + }, + { + "hash": "0xfa0e1aa56daef7b052d8f29d1107c340e248c78c35e004bff5a6f540b6b03964", + "blockNumber": 5672435, + "txIdx": 72 + }, + { + "hash": "0x8e0bc8ccef9e8965a3094ae363ad4da1b7e17e766441468b9635741b985e92fe", + "blockNumber": 5672051, + "txIdx": 170 + }, + { + "hash": "0x18d8bea43e6c8d11394f8e280051b20b3d11c16e80a76155ee5561dc256e0de4", + "blockNumber": 5671539, + "txIdx": 61 + }, + { + "hash": "0xaa2772378731740dd0d5f42eac34ffe91cb3cc284b1d67a11deda0f76913adba", + "blockNumber": 5671411, + "txIdx": 24 + }, + { + "hash": "0x81754d2757e0b88464da38ff163c4971d2b83c3e480704b41e483c4dc384d666", + "blockNumber": 5671411, + "txIdx": 41 + }, + { + "hash": "0xbf13685d10fb6b34ba2270cb56859a158157e857cad5794a3b57951864ac4510", + "blockNumber": 5671283, + "txIdx": 55 + }, + { + "hash": "0x8bfa01a917470ae49f42e34eaab304c3d4d2ce14672ac3a42bba02aca41fadbe", + "blockNumber": 5671091, + "txIdx": 49 + }, + { + "hash": "0x763c7502feccd416dfef5cd23e24330cf8e43ee5b0650c47159050e3de8f8600", + "blockNumber": 5671091, + "txIdx": 55 + }, + { + "hash": "0x4f00a6a405a973f25c6f502f6519c4ebb152659ecada32e99f5a570c27bf3bd6", + "blockNumber": 5670963, + "txIdx": 76 + }, + { + "hash": "0x499cc7c6d46c708a53a166ab5371d44cfd818bd6add5d9e3d561bd9522bbee47", + "blockNumber": 5670963, + "txIdx": 81 + }, + { + "hash": "0xfbf963ddb07d21b188cbdd578cf0cba2361f0d510d4042b67a2682b216775de1", + "blockNumber": 5670771, + "txIdx": 31 + }, + { + "hash": "0xcb7c1c5bc14e772ae41f04d8f097c33adc97905bf21757018bd37d31cfde4d3f", + "blockNumber": 5670771, + "txIdx": 51 + }, + { + "hash": "0xf7a6d6eec39cc46a5178c7d00f37e03e8d2f96d9a01b9c986d934da25c67c13a", + "blockNumber": 5670707, + "txIdx": 46 + }, + { + "hash": "0xa6e8c63195e75344b8334cb8395ea4f321aa9b238968a10075edccd8e52eccb2", + "blockNumber": 5670643, + "txIdx": 70 + }, + { + "hash": "0x32781422fc40ff6d3184b89a6fe3befb7fb78f363565e20737bc7075ff7b0364", + "blockNumber": 5670451, + "txIdx": 2 + }, + { + "hash": "0xab9429fa4b96f1e1be2de962bffe47a627a6df7e54d24a7a56578d13f98842c8", + "blockNumber": 5670387, + "txIdx": 42 + }, + { + "hash": "0xb85343f7e4d59ff2994f1024dda8ff2916291f2a379d7ab8bbeb9ba324217609", + "blockNumber": 5670259, + "txIdx": 51 + }, + { + "hash": "0xa82dec86a433c90a772a0625c784b65f52732443c4eb844da8795305de6cdb4f", + "blockNumber": 5670003, + "txIdx": 49 + }, + { + "hash": "0x96c8b45dda2691ce7493aaece2fae3e6f944a3331b31c69a6032e09b441c2011", + "blockNumber": 5669427, + "txIdx": 67 + }, + { + "hash": "0x498859c13a8606f7331b1136237e7086b0cf88d5f7ca349f68ce20ba4dc6887f", + "blockNumber": 5669363, + "txIdx": 99 + }, + { + "hash": "0xf2e9775caa15fdb3d0da1ffd7664f2dc27be58865a06722416887ffedb5051cf", + "blockNumber": 5669363, + "txIdx": 107 + }, + { + "hash": "0x9cc2b8944fee9b07d67c0e8957de4bb8c4b682f59e13b3f10da21e956190fd9d", + "blockNumber": 5669235, + "txIdx": 60 + }, + { + "hash": "0xe1241283938eae7e6d372bca425985053b6bc4f04623f52ea7a3b65102c75547", + "blockNumber": 5669235, + "txIdx": 81 + }, + { + "hash": "0x14b3a23fd97409fdab49513bc85bf975a011325f0c091d8750a40d4a3e385999", + "blockNumber": 5669171, + "txIdx": 94 + }, + { + "hash": "0xa04a9126e018c47461e7518360c52a1be756513145354c1e13a2c7f5ec9df3fe", + "blockNumber": 5669171, + "txIdx": 120 + }, + { + "hash": "0x5bf07d7f41664f44065e0e6512f3fc852ec512d3a13664df9080e69b5378f5e8", + "blockNumber": 5668915, + "txIdx": 61 + }, + { + "hash": "0xa3d56aba45415ee36a214c51729b8a72070914d52f0e35443338d114fdbacf98", + "blockNumber": 5668595, + "txIdx": 62 + }, + { + "hash": "0xc50509057c4535aa785208d3c2357208826a88e72efcffab47354a51d49bddb4", + "blockNumber": 5668531, + "txIdx": 2 + }, + { + "hash": "0x4d4b12800c570619571bcbc3a83fe2bc8ef3c0fcb8544b50565f351e0b30461f", + "blockNumber": 5668531, + "txIdx": 4 + } + ], + "oversize": [] + } + }, + "rc": { + "events": [ + { + "hash": "0x98bdbbbb6f1d2476149d7bb1e776d4ec2c2a0044a91f61bcb5a8b7c6d9e196fb", + "blockNumber": 5658516, + "txIdx": 2, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x66f1e4af508c88fcbf3d243d012bd629a8ce2442ba96410469a164c69f389dc0", + "blockNumber": 5672435, + "txIdx": 9, + "logIdx": 0, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x66f1e4af508c88fcbf3d243d012bd629a8ce2442ba96410469a164c69f389dc0", + "blockNumber": 5672435, + "txIdx": 9, + "logIdx": 1, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x66f1e4af508c88fcbf3d243d012bd629a8ce2442ba96410469a164c69f389dc0", + "blockNumber": 5672435, + "txIdx": 9, + "logIdx": 2, + "eventSchema": "0x1d9f30260051d51d70339da239ea7b080021adcaabfa71c9b0ea339a20cf9a25" + }, + { + "hash": "0x66f1e4af508c88fcbf3d243d012bd629a8ce2442ba96410469a164c69f389dc0", + "blockNumber": 5672435, + "txIdx": 9, + "logIdx": 3, + "eventSchema": "0x3e54d0825ed78523037d00a81759237eb436ce774bd546993ee67a1b67b6e766" + }, + { + "hash": "0xcae9f330427268a387d5da11ba1501a9073adc5f2a453cee14390747131285c5", + "blockNumber": 5672371, + "txIdx": 32, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x515110d808dfa1988231fd0ce9a32e235286d0a87746c72afe2eda1fa868b3a7", + "blockNumber": 5672307, + "txIdx": 28, + "logIdx": 0, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x515110d808dfa1988231fd0ce9a32e235286d0a87746c72afe2eda1fa868b3a7", + "blockNumber": 5672307, + "txIdx": 28, + "logIdx": 1, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x515110d808dfa1988231fd0ce9a32e235286d0a87746c72afe2eda1fa868b3a7", + "blockNumber": 5672307, + "txIdx": 28, + "logIdx": 3, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x515110d808dfa1988231fd0ce9a32e235286d0a87746c72afe2eda1fa868b3a7", + "blockNumber": 5672307, + "txIdx": 28, + "logIdx": 4, + "eventSchema": "0x644b21690d79fb866de971982f0f2ac1f3775377bff4262ff72f2cc9bafdbee8" + }, + { + "hash": "0x515110d808dfa1988231fd0ce9a32e235286d0a87746c72afe2eda1fa868b3a7", + "blockNumber": 5672307, + "txIdx": 28, + "logIdx": 5, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x515110d808dfa1988231fd0ce9a32e235286d0a87746c72afe2eda1fa868b3a7", + "blockNumber": 5672307, + "txIdx": 28, + "logIdx": 6, + "eventSchema": "0xf01da32686223933d8a18a391060918c7f11a3648639edd87ae013e2e2731743" + }, + { + "hash": "0x515110d808dfa1988231fd0ce9a32e235286d0a87746c72afe2eda1fa868b3a7", + "blockNumber": 5672307, + "txIdx": 28, + "logIdx": 7, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x515110d808dfa1988231fd0ce9a32e235286d0a87746c72afe2eda1fa868b3a7", + "blockNumber": 5672307, + "txIdx": 28, + "logIdx": 8, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x515110d808dfa1988231fd0ce9a32e235286d0a87746c72afe2eda1fa868b3a7", + "blockNumber": 5672307, + "txIdx": 28, + "logIdx": 10, + "eventSchema": "0xe54d289cb860073b2834abd3362a8d819971ed455fe5e41d097e6c578fc063e3" + }, + { + "hash": "0xd59647da0405c82db1ee9a6a7056fef66e1c08fbba8768f7d7d7f4cd70967750", + "blockNumber": 5672243, + "txIdx": 1, + "logIdx": 0, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x37bb6aa4a945f50c7324d827eb19a2ca41992fbab59130f258a8d405448e3613", + "blockNumber": 5672179, + "txIdx": 30, + "logIdx": 0, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x155441826e80f8c1bd1b410a68f8559df8cfa46c5ef80bf21b694224f8a97d71", + "blockNumber": 5672115, + "txIdx": 1, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x155441826e80f8c1bd1b410a68f8559df8cfa46c5ef80bf21b694224f8a97d71", + "blockNumber": 5672115, + "txIdx": 1, + "logIdx": 1, + "eventSchema": "0x53bb90500b4bcd81f514e255a8d31018839272f80fc8c3d7f7f153e58c056568" + }, + { + "hash": "0x9a0cc7042673438ccb0a138c2edf640dbe5cdf75e6258f205b28841c7351cbd7", + "blockNumber": 5672051, + "txIdx": 1, + "logIdx": 0, + "eventSchema": "0x53bb90500b4bcd81f514e255a8d31018839272f80fc8c3d7f7f153e58c056568" + }, + { + "hash": "0xa722cafa4602f10c5fa9581a2830071a7142b97878cfb4458bcee85c122529dd", + "blockNumber": 5671987, + "txIdx": 23, + "logIdx": 0, + "eventSchema": "0x35d79ab81f2b2017e19afb5c5571778877782d7a8786f5907f93b0f4702f4f23" + }, + { + "hash": "0xa722cafa4602f10c5fa9581a2830071a7142b97878cfb4458bcee85c122529dd", + "blockNumber": 5671987, + "txIdx": 23, + "logIdx": 1, + "eventSchema": "0x2849b43074093a05396b6f2a937dee8565b15a48a7b3d4bffb732a5017380af5" + }, + { + "hash": "0xa722cafa4602f10c5fa9581a2830071a7142b97878cfb4458bcee85c122529dd", + "blockNumber": 5671987, + "txIdx": 23, + "logIdx": 2, + "eventSchema": "0xb3813568d9991fc951961fcb4c784893574240a28925604d09fc577c55bb7c32" + }, + { + "hash": "0xa722cafa4602f10c5fa9581a2830071a7142b97878cfb4458bcee85c122529dd", + "blockNumber": 5671987, + "txIdx": 23, + "logIdx": 3, + "eventSchema": "0xcb0f7ffd78f9aee47a248fae8db181db6eee833039123e026dcbff529522e52a" + }, + { + "hash": "0xa722cafa4602f10c5fa9581a2830071a7142b97878cfb4458bcee85c122529dd", + "blockNumber": 5671987, + "txIdx": 23, + "logIdx": 4, + "eventSchema": "0x8ebb2ec2465bdb2a06a66fc37a0963af8a2a6a1479d81d56fdb8cbb98096d546" + }, + { + "hash": "0xbdea38d936af8c22061a4025946bf70db0090229350b8992c566cd070cb51b1e", + "blockNumber": 5671923, + "txIdx": 21, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x3d8dd0ac5b946e79de4bf113148c884f6ca147cbeca0e73c36d68d69c3cdd125", + "blockNumber": 5671859, + "txIdx": 25, + "logIdx": 0, + "eventSchema": "0x52f50aa6d1a95a4595361ecf953d095f125d442e4673716dede699e049de148a" + }, + { + "hash": "0x3d8dd0ac5b946e79de4bf113148c884f6ca147cbeca0e73c36d68d69c3cdd125", + "blockNumber": 5671859, + "txIdx": 25, + "logIdx": 1, + "eventSchema": "0x52f50aa6d1a95a4595361ecf953d095f125d442e4673716dede699e049de148a" + }, + { + "hash": "0x3d8dd0ac5b946e79de4bf113148c884f6ca147cbeca0e73c36d68d69c3cdd125", + "blockNumber": 5671859, + "txIdx": 25, + "logIdx": 2, + "eventSchema": "0x52f50aa6d1a95a4595361ecf953d095f125d442e4673716dede699e049de148a" + }, + { + "hash": "0x3d8dd0ac5b946e79de4bf113148c884f6ca147cbeca0e73c36d68d69c3cdd125", + "blockNumber": 5671859, + "txIdx": 25, + "logIdx": 3, + "eventSchema": "0xdd84a3fa9ef9409f550d54d6affec7e9c480c878c6ab27b78912a03e1b371c6e" + }, + { + "hash": "0x71ff53367838d9d69c033df0eab4b8ece41bf6f54a62fbd2d3a4a74c482fa176", + "blockNumber": 5671795, + "txIdx": 7, + "logIdx": 1, + "eventSchema": "0x9592d37825c744e33fa80c469683bbd04d336241bb600b574758efd182abe26a" + }, + { + "hash": "0x71ff53367838d9d69c033df0eab4b8ece41bf6f54a62fbd2d3a4a74c482fa176", + "blockNumber": 5671795, + "txIdx": 7, + "logIdx": 2, + "eventSchema": "0x9592d37825c744e33fa80c469683bbd04d336241bb600b574758efd182abe26a" + } + ], + "category": { + "default": [ + { + "hash": "0x98bdbbbb6f1d2476149d7bb1e776d4ec2c2a0044a91f61bcb5a8b7c6d9e196fb", + "blockNumber": 5658516, + "txIdx": 2 + }, + { + "hash": "0x013a9d2206cb9633a5c990eb5729ab50ba6b6877276d2aec061747de3983cd9c", + "blockNumber": 5658516, + "txIdx": 3 + }, + { + "hash": "0xf527470577bf44e330e734f930c92b936df5b750b821e62ac4098a25f3fe809e", + "blockNumber": 5658516, + "txIdx": 5 + }, + { + "hash": "0x830c35bca49dea066349cbebc2538e5e9b8e75d7e7cfb37006d4245112041d2a", + "blockNumber": 5658516, + "txIdx": 6 + }, + { + "hash": "0xe69c64d5469ac429c6ce932ed605dd752d617e82dff500e690e3057324c61444", + "blockNumber": 5658516, + "txIdx": 7 + }, + { + "hash": "0xf6e748f71bb4b98086dca90fdd208c564cdc4ba9eb137542b82c8058acf377f0", + "blockNumber": 5658516, + "txIdx": 11 + }, + { + "hash": "0xf6abc7334dcaf3ea635c41693ce2c44bfc3fac43ad146b5d2f99cd81247b1a36", + "blockNumber": 5658516, + "txIdx": 12 + }, + { + "hash": "0x5cb6951c94aa0d369758f16df585cb90f5492be73687cff9748c81ac48b7e236", + "blockNumber": 5658516, + "txIdx": 13 + }, + { + "hash": "0x685e714ce88bf4dda95a3e0fac4badcac33e482559fe635ed71f990bdbd58c72", + "blockNumber": 5658516, + "txIdx": 18 + }, + { + "hash": "0xf8535005a7584dc0b1416349d2b7d5b357f6a6ff775bd3ac4d45097e96ab17b7", + "blockNumber": 5658516, + "txIdx": 20 + }, + { + "hash": "0x2d4323b55a6e49fa09a00020557f57353dddfcd80ca4bcb27d4c3738af989767", + "blockNumber": 5658516, + "txIdx": 21 + }, + { + "hash": "0x5572b5ec03502c40ba04502a28d2f70b641716aa01198dbd438ac52c87e3200f", + "blockNumber": 5658516, + "txIdx": 28 + }, + { + "hash": "0x85bc03b274607c794e4b8b7ce815e58aa034595a5b78209c989da021f8506c26", + "blockNumber": 5658516, + "txIdx": 32 + }, + { + "hash": "0x819170c8cf05626963ddce4e6b6a44c273795f5388f4bd4469ed23a5e2db4722", + "blockNumber": 5658516, + "txIdx": 33 + }, + { + "hash": "0x18e5ae1211eb432be394d0629857805d51a504f3ebc532bb53315e94c87966dd", + "blockNumber": 5658516, + "txIdx": 34 + }, + { + "hash": "0xfc9527a3adb72f6495cb8d41e7b2529fecc541a08bb0b3d9c30672fd3bcfa185", + "blockNumber": 5658516, + "txIdx": 36 + }, + { + "hash": "0xbd22dc36708ad6fda6ca0479998d6b9a85458c889a96ac063fed3a02859fa194", + "blockNumber": 5658516, + "txIdx": 37 + }, + { + "hash": "0x3b18cdd70a439b5474b0fdb95413a7d5cdb98a8931b1dbd3912bd31cad2cadc4", + "blockNumber": 5658516, + "txIdx": 38 + }, + { + "hash": "0xaf5d44554aec8c8a8efe832a6433119bda9d9e6d2b05b4e7fb3afb7cc40bda42", + "blockNumber": 5658516, + "txIdx": 39 + }, + { + "hash": "0x8c24c569d1c1ef404dbeb43e69e03e3895208c31baa9f62e84715ac398f37f7c", + "blockNumber": 5658516, + "txIdx": 40 + }, + { + "hash": "0x3abdee2eb14d245de6a638408fd9118df9f362fa1e711f6a5160af2565f2a17f", + "blockNumber": 5658516, + "txIdx": 41 + }, + { + "hash": "0x0975eebbc55f40bc41c7e97bbae80b93ddf1787ea7ebf48741c18345a7d530bc", + "blockNumber": 5658516, + "txIdx": 42 + }, + { + "hash": "0x57b85acc980ca21c4f96c113eb62f724ee5e89db61e418e39aac0e858a9e4dc1", + "blockNumber": 5658516, + "txIdx": 43 + }, + { + "hash": "0x3672a29575250a3517c38abe5009f130f5069b402a3f1d05b51fc72a3de8e15e", + "blockNumber": 5658516, + "txIdx": 45 + }, + { + "hash": "0xbf0c62d06c7dce0d95d3f4e48f1e47093f2f9a9c570ed8c17d510cbb84351b51", + "blockNumber": 5658516, + "txIdx": 48 + }, + { + "hash": "0x34ff1a3b9502406fd6a54493ff87df679938d26b6fd7a43eeefaad523c3fc778", + "blockNumber": 5658516, + "txIdx": 49 + }, + { + "hash": "0x8f77dfccd41de8526166abeb7464d7d481234b6520349f53cc1abe3285239a96", + "blockNumber": 5658516, + "txIdx": 50 + }, + { + "hash": "0xa8ce3a8fa68e97b0ef2b3863f189ae4b0b900d9db7126bc8d8e31e109723b79d", + "blockNumber": 5658516, + "txIdx": 54 + }, + { + "hash": "0xf2bc81cb9247f49b0966883240f6e004405f4a96c0a2a7156d5fc173f01af6fd", + "blockNumber": 5658516, + "txIdx": 65 + }, + { + "hash": "0xacf7cd809442fc537adf8b190ca54fd8b10a4c4c0177c31cb6b4b9722e70f94e", + "blockNumber": 5658516, + "txIdx": 74 + }, + { + "hash": "0x3d2f1bbf9d8791c9373a6cf8ead343d9c0714739e2d1e53fb829e02164deca2a", + "blockNumber": 5658516, + "txIdx": 75 + }, + { + "hash": "0x128c6ea4d8a817f10a96f337afcfbab0ec7d7aa4b9af5ea42a74bbe3e31f6f40", + "blockNumber": 5658516, + "txIdx": 76 + } + ], + "medium": [ + { + "hash": "0x624b0c38a203484576e974bf59ef5ccefdc6d9d9a9ea38c00e2ab145e690a613", + "blockNumber": 5672051, + "txIdx": 41 + }, + { + "hash": "0xa153330601e11f656bfba1772cd76a639431eedd9ec6116deb1599768f5c58ba", + "blockNumber": 5671539, + "txIdx": 105 + }, + { + "hash": "0xd29cd8d7c9ce00c6a15a4e396468f7bb64ec727d9818fb3149380019c4b05f4e", + "blockNumber": 5671347, + "txIdx": 28 + }, + { + "hash": "0xc718f0507c97b5e4b0bf713a6d0cbf4f48e127665f18a1ce4182cf87172dd5a4", + "blockNumber": 5669619, + "txIdx": 17 + }, + { + "hash": "0xf830524f7348f3bf9880cecb4dfa621ca49b00b91c89e56eb0e4ba0de2929323", + "blockNumber": 5668851, + "txIdx": 62 + }, + { + "hash": "0xbb9d4727f8f51f8811a35e791b407d0d6df0749419a7f71120866ca4155d2715", + "blockNumber": 5668275, + "txIdx": 30 + }, + { + "hash": "0xdf9b22b3b9f892cfd42109edaaefc872924f73e7ab50565646ece83c956e4cc0", + "blockNumber": 5668211, + "txIdx": 7 + } + ], + "large": [ + { + "hash": "0x70df3b2b2d42b840996898f624382b2f0e1fbc18da7e78a7c04207f41720a868", + "blockNumber": 5658516, + "txIdx": 8 + }, + { + "hash": "0xc9654dcade2014319a7f39e043a61e1e6db0197a386b1d2d6eb7291cbdcdfb22", + "blockNumber": 5658516, + "txIdx": 23 + }, + { + "hash": "0x24d1fca522c1e84ad8ea08a42ff80ababdbf956d4db85d206c318f8d76e84a95", + "blockNumber": 5658516, + "txIdx": 24 + }, + { + "hash": "0xc7a1485168c06b55c4811255499a53d5b9c0fe256e27aaeda4d3452da1bdf119", + "blockNumber": 5658516, + "txIdx": 25 + }, + { + "hash": "0x3840b93d2afbe1d9176877628b687cdb7a6751dff6622c722fdf17d2694487c3", + "blockNumber": 5658516, + "txIdx": 26 + }, + { + "hash": "0xba50a11ee3af20dd725a3a01fdf50ab0c22a9a400f091ccf1472c7b631a98fa9", + "blockNumber": 5658516, + "txIdx": 27 + }, + { + "hash": "0x92ca7e60350b2eeb82d1fd9f346c7d9564e90ea70a43858bed62639a6371532a", + "blockNumber": 5658516, + "txIdx": 29 + }, + { + "hash": "0x08916be1e5c9c28ee730ae0fa40579662134c3f7d0f290be71eab5e93733caf9", + "blockNumber": 5658516, + "txIdx": 30 + }, + { + "hash": "0x740c90c98bfdc39c048d235752d52286ea21cf730bd3ebda8d39b982466ab67a", + "blockNumber": 5658516, + "txIdx": 31 + }, + { + "hash": "0x2559aaa4a85781386b2a54ee7fb723ada54cf27958e8e9d8ab2637671ac329e8", + "blockNumber": 5658516, + "txIdx": 35 + }, + { + "hash": "0xba3c71c22206011df4a2dd4415c3fede575a7cd3058ec0352d6db35d49ee62c9", + "blockNumber": 5658516, + "txIdx": 44 + }, + { + "hash": "0xe8a72002b60096b7bfc748bf8e5691086fcf4fb7ba63eb6eafe34b4d579cc094", + "blockNumber": 5672243, + "txIdx": 39 + }, + { + "hash": "0x6b3010f415716fe020a3b0731e55c9deb04874c0db2cebf7e04a6e2a70dd7891", + "blockNumber": 5671923, + "txIdx": 43 + }, + { + "hash": "0x197c773932bf67e670912d64369ac69cb79bb9fae4bb50b4cb0c43b5e9ed435f", + "blockNumber": 5671283, + "txIdx": 14 + }, + { + "hash": "0xdb89d7e48540a045b9c8388d542910f2f0d354641419048e177886af54720961", + "blockNumber": 5671219, + "txIdx": 21 + }, + { + "hash": "0xe607f8ad3b14e10c28883edd352cf6a22fbc157eb65adde9cf25518e6727d5b7", + "blockNumber": 5671155, + "txIdx": 2 + }, + { + "hash": "0xe7be2eb4d3cc57c9452c96be95acd32b614e240eefd3522b69a5f803ff1b4638", + "blockNumber": 5670707, + "txIdx": 19 + }, + { + "hash": "0x39202e78bb51ae1354389b26cda29679044c65c0ef3e14e7289cada39b0fc326", + "blockNumber": 5670195, + "txIdx": 16 + }, + { + "hash": "0x36db3820057c6b118a21c61e646a00fb100291b27ccf8d4ee44aa0711169e95f", + "blockNumber": 5669939, + "txIdx": 20 + }, + { + "hash": "0x4acc863786ec17bd54078ae6c62691fcc8c9aaa51929769654a41ff303a2b6df", + "blockNumber": 5669875, + "txIdx": 15 + }, + { + "hash": "0x5695cbb06ad6df8abc27d0878abd5e42bd267a0866022b75d045fc28b92caad3", + "blockNumber": 5669875, + "txIdx": 41 + }, + { + "hash": "0x1fddc6000e281d08bc9ade423caa65fbbe15f3333615143817a64c33231fe0ef", + "blockNumber": 5669619, + "txIdx": 29 + }, + { + "hash": "0x858bd6ac8ddf32008befaf55d3675307b79323348b7e5f1a2a692c521bd23012", + "blockNumber": 5669363, + "txIdx": 50 + }, + { + "hash": "0x221b90aad5412528b051781b7e5e7886046b94e1a47e4c7f5f33f05633a59690", + "blockNumber": 5669363, + "txIdx": 55 + }, + { + "hash": "0xd8e675ca86cf64c3426119d6402a19616af3162941b2edb523168b67126c516e", + "blockNumber": 5669171, + "txIdx": 19 + }, + { + "hash": "0xb854f03fc9f5b96bdc9d8bd49402ceb31ca91c7aa3ca1bc76d6a70414bbff34d", + "blockNumber": 5668915, + "txIdx": 51 + }, + { + "hash": "0x1f070512a3ba1aab2e28fe56b17341ad4ac1fe16e04b0b9ddfb13ed8f089f546", + "blockNumber": 5668787, + "txIdx": 15 + }, + { + "hash": "0x9a4c82571ef1057b4c8549f86cfa9ab0c0726a07d3431114cf822167590f1c81", + "blockNumber": 5668467, + "txIdx": 30 + }, + { + "hash": "0xc32cdb0408ee656712c953ff8fb14fe7b325f6ca6c18ce1c7c95e9391b940d3e", + "blockNumber": 5668339, + "txIdx": 26 + }, + { + "hash": "0x438d043bd66b8f041db5479224d67560fa7413c286b39e716e0ccc40a3bc7116", + "blockNumber": 5668339, + "txIdx": 29 + }, + { + "hash": "0xba53e86dad06f7752f13ba821f3941e435a164486866b06b5ea714e90764f6f1", + "blockNumber": 5668339, + "txIdx": 40 + }, + { + "hash": "0x09890d3c4e5f278d0a509890feb1e7892f41acfa2f522e6ff61bb5e1c8998f54", + "blockNumber": 5668339, + "txIdx": 84 + } + ], + "max": [ + { + "hash": "0x0c54a63947e9853e234ca2a25b0800618c7a80af7b8e26e96407dd497723d3a5", + "blockNumber": 5658516, + "txIdx": 9 + }, + { + "hash": "0x1609e79a58dedb0420d0d6535c9656a34fb6ee87d4537d11f0beae9e00bebf27", + "blockNumber": 5672778, + "txIdx": 35 + }, + { + "hash": "0xb44d1f77557ad423411c90b6a476530d982ad75b117029830a507292fdbd5d82", + "blockNumber": 5672780, + "txIdx": 53 + }, + { + "hash": "0xad0897388db0144f67e8a223902f24526a9e00de928aa1adfbc7b413091a2c83", + "blockNumber": 5672787, + "txIdx": 13 + }, + { + "hash": "0x40fdc02c99c41ea5a1e0d5eec3eca79ce8549d20db2df66b55661b29107240ea", + "blockNumber": 5675149, + "txIdx": 19 + } + ], + "oversize": [ + { + "hash": "0x06f6b8d5ee08ab892eb2976dd2fa278767f5adc2a17f3205f605053bfcaba5a3", + "blockNumber": 5672371, + "txIdx": 122 + }, + { + "hash": "0x75435343ab4a1ff6a8eea9fa6514845fedb9807659671b0303512a2db99c709b", + "blockNumber": 5671475, + "txIdx": 61 + }, + { + "hash": "0x4fafe15e0678b07bf54cf4f9a12358441e12b9dc0ca40fb33d4c7dfa849cba0c", + "blockNumber": 5668787, + "txIdx": 88 + }, + { + "hash": "0x06c7cf1ba6f1a84bbb7f74a8df481427fd37ed855ad596c6e2c4f5b4fb8b61d1", + "blockNumber": 5668787, + "txIdx": 89 + }, + { + "hash": "0x380ab1471ed82f107e5640e0fa1e735e8b1e58148a84100cb0743aa3df49e7a5", + "blockNumber": 5668083, + "txIdx": 110 + }, + { + "hash": "0x82c08317ed222cbbecee17307edffd25871a9036115382787cddcca2640e68f1", + "blockNumber": 5668083, + "txIdx": 123 + }, + { + "hash": "0x0c3f84133c2d1cb4e7b43d56ebfa6e363050826e026b46c50b63cf8e7c79cd8c", + "blockNumber": 5667955, + "txIdx": 23 + }, + { + "hash": "0x1cfa8ecfc64f5b5a5a8b2b080ae3c8c024e2acd52a266f88bc77692cdb0227ea", + "blockNumber": 5667955, + "txIdx": 127 + } + ] + } + } + } \ No newline at end of file diff --git a/harness/test/chainData/11155111/average.defaultInputs.json b/harness/test/chainData/11155111/average.defaultInputs.json new file mode 100644 index 00000000..6e8b7741 --- /dev/null +++ b/harness/test/chainData/11155111/average.defaultInputs.json @@ -0,0 +1,4 @@ +{ + "blockNumber": 5671923, + "address": "0x06201790ad00c8e2bc89cdae483ded7ae35fbe15" +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/average.inputs.json b/harness/test/chainData/11155111/average.inputs.json new file mode 100644 index 00000000..93c9ddb4 --- /dev/null +++ b/harness/test/chainData/11155111/average.inputs.json @@ -0,0 +1,4 @@ +{ + "blockNumber": 5671923, + "address": "0x1fc35b79fb11ea7d4532da128dfa9db573c51b09" +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/basic.defaultInputs.json b/harness/test/chainData/11155111/basic.defaultInputs.json new file mode 100644 index 00000000..88a88134 --- /dev/null +++ b/harness/test/chainData/11155111/basic.defaultInputs.json @@ -0,0 +1,3 @@ +{ + "blockNumber": 5671923 +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/basic.inputs.json b/harness/test/chainData/11155111/basic.inputs.json new file mode 100644 index 00000000..c1eb4daa --- /dev/null +++ b/harness/test/chainData/11155111/basic.inputs.json @@ -0,0 +1,3 @@ +{ + "blockNumber": 5671987 +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/default.defaultInputs.json b/harness/test/chainData/11155111/default.defaultInputs.json new file mode 100644 index 00000000..b0b5e5b2 --- /dev/null +++ b/harness/test/chainData/11155111/default.defaultInputs.json @@ -0,0 +1,12 @@ +{ + "address": "0x7e6d3ce1d282c11c3f7d75e4f73133ca66b7a95a", + "claimedBlockNumber": 5672435, + "block": 5672307, + "addr": "0x7777f1a58497aeaab0326e22e2017e0830d528d0", + "txBlockNumber": 5672435, + "txIdx": 9, + "logIdx": 0, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "slot": 2, + "mappingSlot": 3 +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/default.inputs.json b/harness/test/chainData/11155111/default.inputs.json new file mode 100644 index 00000000..443e7995 --- /dev/null +++ b/harness/test/chainData/11155111/default.inputs.json @@ -0,0 +1,12 @@ +{ + "address": "0x02b59783ae72a0a0c43dfdb31a4364fb93853973", + "claimedBlockNumber": 5658516, + "block": 5672371, + "addr": "0x7e6d3ce1d282c11c3f7d75e4f73133ca66b7a95a", + "txBlockNumber": 5658516, + "txIdx": 2, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "slot": 3, + "mappingSlot": 2 +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/eip4844receipt.defaultInputs.json b/harness/test/chainData/11155111/eip4844receipt.defaultInputs.json new file mode 100644 index 00000000..ca2390e9 --- /dev/null +++ b/harness/test/chainData/11155111/eip4844receipt.defaultInputs.json @@ -0,0 +1,4 @@ +{ + "blockNumber": 5672435, + "txIdx": 82 +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/eip4844receipt.inputs.json b/harness/test/chainData/11155111/eip4844receipt.inputs.json new file mode 100644 index 00000000..b8983ab6 --- /dev/null +++ b/harness/test/chainData/11155111/eip4844receipt.inputs.json @@ -0,0 +1,4 @@ +{ + "blockNumber": 5672435, + "txIdx": 5 +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/max128.defaultInputs.json b/harness/test/chainData/11155111/max128.defaultInputs.json new file mode 100644 index 00000000..466118d9 --- /dev/null +++ b/harness/test/chainData/11155111/max128.defaultInputs.json @@ -0,0 +1,14 @@ +{ + "blockNumber": 5672179, + "eoa": "0xd21d202855506b7ca75066928e98d693290032f5", + "contractBlock0": 5672115, + "contractBlock1": 5672051, + "contract0": "0x422ae3c25eb0eb2c5df2ce1f53123ca862b67659", + "contract1": "0xe877139db8095dd59fcbbfd65a02ae08592ac8ea", + "slot0": 8, + "slot1": 2, + "txBlockNumber": 5658516, + "txTxIdx": 3, + "rcBlockNumber": 5672435, + "rcTxIdx": 9 +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/max128.inputs.json b/harness/test/chainData/11155111/max128.inputs.json new file mode 100644 index 00000000..b44849e1 --- /dev/null +++ b/harness/test/chainData/11155111/max128.inputs.json @@ -0,0 +1,14 @@ +{ + "blockNumber": 5672243, + "eoa": "0xda69829748a90d2ef053c5bc106f0711acf1d024", + "contractBlock0": 5672179, + "contractBlock1": 5672115, + "contract0": "0x491d755a33f6eb77a890925414dd5daea42e3d7c", + "contract1": "0x422ae3c25eb0eb2c5df2ce1f53123ca862b67659", + "slot0": 3, + "slot1": 8, + "txBlockNumber": 5658516, + "txTxIdx": 2, + "rcBlockNumber": 5658516, + "rcTxIdx": 2 +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/max30-1.defaultInputs.json b/harness/test/chainData/11155111/max30-1.defaultInputs.json new file mode 100644 index 00000000..d7e0eaf4 --- /dev/null +++ b/harness/test/chainData/11155111/max30-1.defaultInputs.json @@ -0,0 +1,11 @@ +{ + "blockNumber": 5672307, + "contract0": "0xc3f6476c6c05a963462af50d4c51f1290ba31c0b", + "storBlockNumber": 5672179, + "storAddress": "0x491d755a33f6eb77a890925414dd5daea42e3d7c", + "storSlot": 3, + "txBlockNumber": 5658516, + "txTxIdx": 2, + "rcBlockNumber": 5672435, + "rcTxIdx": 9 +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/max30-1.inputs.json b/harness/test/chainData/11155111/max30-1.inputs.json new file mode 100644 index 00000000..571c464f --- /dev/null +++ b/harness/test/chainData/11155111/max30-1.inputs.json @@ -0,0 +1,11 @@ +{ + "blockNumber": 5672307, + "contract0": "0x6977ec5fae3862d3471f0f5b6dcc64cdf5cfd959", + "storBlockNumber": 5672243, + "storAddress": "0xc3f6476c6c05a963462af50d4c51f1290ba31c0b", + "storSlot": 5, + "txBlockNumber": 5658516, + "txTxIdx": 1, + "rcBlockNumber": 5672435, + "rcTxIdx": 9 +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/max30-2.defaultInputs.json b/harness/test/chainData/11155111/max30-2.defaultInputs.json new file mode 100644 index 00000000..138dcbec --- /dev/null +++ b/harness/test/chainData/11155111/max30-2.defaultInputs.json @@ -0,0 +1,9 @@ +{ + "blockNumber": 5672243, + "contractBlock": 5672179, + "contract": "0x491d755a33f6eb77a890925414dd5daea42e3d7c", + "txBlockNumber": 5658516, + "txTxIdx": 68, + "rcBlockNumber": 5672435, + "rcTxIdx": 9 +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/max30-2.inputs.json b/harness/test/chainData/11155111/max30-2.inputs.json new file mode 100644 index 00000000..e8bd06f0 --- /dev/null +++ b/harness/test/chainData/11155111/max30-2.inputs.json @@ -0,0 +1,9 @@ +{ + "blockNumber": 5672307, + "contractBlock": 5672243, + "contract": "0xc3f6476c6c05a963462af50d4c51f1290ba31c0b", + "txBlockNumber": 5658516, + "txTxIdx": 63, + "rcBlockNumber": 5672435, + "rcTxIdx": 9 +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/oneOfEach.defaultInputs.json b/harness/test/chainData/11155111/oneOfEach.defaultInputs.json new file mode 100644 index 00000000..5daf3eb5 --- /dev/null +++ b/harness/test/chainData/11155111/oneOfEach.defaultInputs.json @@ -0,0 +1,11 @@ +{ + "blockNumber": 5672435, + "address": "0x7e6d3ce1d282c11c3f7d75e4f73133ca66b7a95a", + "storBlockNumber": 5672435, + "storAddress": "0x01469dacfdda885d68ff0f8628f2629c14f95a20", + "storSlot": 2, + "txBlockNumber": 5658516, + "txTxIdx": 1, + "rcBlockNumber": 5672435, + "rcTxIdx": 9 +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/oneOfEach.inputs.json b/harness/test/chainData/11155111/oneOfEach.inputs.json new file mode 100644 index 00000000..1aa26669 --- /dev/null +++ b/harness/test/chainData/11155111/oneOfEach.inputs.json @@ -0,0 +1,11 @@ +{ + "blockNumber": 5658516, + "address": "0x02b59783ae72a0a0c43dfdb31a4364fb93853973", + "storBlockNumber": 5658516, + "storAddress": "0x53844f9577c2334e541aec7df7174ece5df1fcf0", + "storSlot": 3, + "txBlockNumber": 5658516, + "txTxIdx": 0, + "rcBlockNumber": 5658516, + "rcTxIdx": 2 +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/receipt+tx+mapping+storage.defaultInputs.json b/harness/test/chainData/11155111/receipt+tx+mapping+storage.defaultInputs.json new file mode 100644 index 00000000..881a1127 --- /dev/null +++ b/harness/test/chainData/11155111/receipt+tx+mapping+storage.defaultInputs.json @@ -0,0 +1,9 @@ +{ + "blockNumber": 5672051, + "contract0": "0xcdee63eba9149219bb3ed23b08c4f14cc239f512", + "contract1": "0x5c00a5ddbb2e361bcd6e854f6883a70a7460fc26", + "txBlockNumber": 5658516, + "txTxIdx": 8, + "rcBlockNumber": 5672307, + "rcTxIdx": 28 +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/receipt+tx+mapping+storage.inputs.json b/harness/test/chainData/11155111/receipt+tx+mapping+storage.inputs.json new file mode 100644 index 00000000..9969bf99 --- /dev/null +++ b/harness/test/chainData/11155111/receipt+tx+mapping+storage.inputs.json @@ -0,0 +1,9 @@ +{ + "blockNumber": 5672115, + "contract0": "0x4e8059f4df6174a5a88376e4aa959b9e7f36f2c3", + "contract1": "0xcdee63eba9149219bb3ed23b08c4f14cc239f512", + "txBlockNumber": 5658516, + "txTxIdx": 5, + "rcBlockNumber": 5672371, + "rcTxIdx": 32 +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/receipt+tx+mapping.defaultInputs.json b/harness/test/chainData/11155111/receipt+tx+mapping.defaultInputs.json new file mode 100644 index 00000000..0157cf5b --- /dev/null +++ b/harness/test/chainData/11155111/receipt+tx+mapping.defaultInputs.json @@ -0,0 +1,8 @@ +{ + "blockNumber": 5672115, + "contract": "0x4e8059f4df6174a5a88376e4aa959b9e7f36f2c3", + "txBlockNumber": 5658516, + "txTxIdx": 5, + "rcBlockNumber": 5672371, + "rcTxIdx": 32 +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/receipt+tx+mapping.inputs.json b/harness/test/chainData/11155111/receipt+tx+mapping.inputs.json new file mode 100644 index 00000000..48f44c21 --- /dev/null +++ b/harness/test/chainData/11155111/receipt+tx+mapping.inputs.json @@ -0,0 +1,8 @@ +{ + "blockNumber": 5672115, + "contract": "0xe877139db8095dd59fcbbfd65a02ae08592ac8ea", + "txBlockNumber": 5658516, + "txTxIdx": 4, + "rcBlockNumber": 5672435, + "rcTxIdx": 9 +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/receipt+tx.defaultInputs.json b/harness/test/chainData/11155111/receipt+tx.defaultInputs.json new file mode 100644 index 00000000..77cd8e72 --- /dev/null +++ b/harness/test/chainData/11155111/receipt+tx.defaultInputs.json @@ -0,0 +1,6 @@ +{ + "txBlockNumber": 5658516, + "txTxIdx": 6, + "rcBlockNumber": 5672435, + "rcTxIdx": 9 +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/receipt+tx.inputs.json b/harness/test/chainData/11155111/receipt+tx.inputs.json new file mode 100644 index 00000000..2f2d2932 --- /dev/null +++ b/harness/test/chainData/11155111/receipt+tx.inputs.json @@ -0,0 +1,6 @@ +{ + "txBlockNumber": 5658516, + "txTxIdx": 5, + "rcBlockNumber": 5672435, + "rcTxIdx": 9 +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/simple.defaultInputs.json b/harness/test/chainData/11155111/simple.defaultInputs.json new file mode 100644 index 00000000..cc239e0b --- /dev/null +++ b/harness/test/chainData/11155111/simple.defaultInputs.json @@ -0,0 +1,4 @@ +{ + "blockNumber": 5672051, + "addr": "0xf1d6d31b577a2e54f6909813bfefcd73b9341f1f" +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/simple.inputs.json b/harness/test/chainData/11155111/simple.inputs.json new file mode 100644 index 00000000..924e1f58 --- /dev/null +++ b/harness/test/chainData/11155111/simple.inputs.json @@ -0,0 +1,4 @@ +{ + "blockNumber": 5672051, + "addr": "0x76021ab81403ac4ff0d9ce432c2fbd2d6a09daeb" +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/simpleWithCapacity.defaultInputs.json b/harness/test/chainData/11155111/simpleWithCapacity.defaultInputs.json new file mode 100644 index 00000000..42a16954 --- /dev/null +++ b/harness/test/chainData/11155111/simpleWithCapacity.defaultInputs.json @@ -0,0 +1,8 @@ +{ + "blockNumber": 5671987, + "addr": "0x18d09ab904ea2150ac077d85bce16421f349e7b9", + "txBlockNumber": 5658516, + "txTxIdx": 9, + "rcBlockNumber": 5672307, + "rcTxIdx": 28 +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/simpleWithCapacity.inputs.json b/harness/test/chainData/11155111/simpleWithCapacity.inputs.json new file mode 100644 index 00000000..ce18af8d --- /dev/null +++ b/harness/test/chainData/11155111/simpleWithCapacity.inputs.json @@ -0,0 +1,8 @@ +{ + "blockNumber": 5672051, + "addr": "0xf1d6d31b577a2e54f6909813bfefcd73b9341f1f", + "txBlockNumber": 5658516, + "txTxIdx": 8, + "rcBlockNumber": 5672307, + "rcTxIdx": 28 +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/size128Header.defaultInputs.json b/harness/test/chainData/11155111/size128Header.defaultInputs.json new file mode 100644 index 00000000..ff1c35ac --- /dev/null +++ b/harness/test/chainData/11155111/size128Header.defaultInputs.json @@ -0,0 +1,3 @@ +{ + "blockNumber": 5672371 +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/size128Header.inputs.json b/harness/test/chainData/11155111/size128Header.inputs.json new file mode 100644 index 00000000..26aa4aed --- /dev/null +++ b/harness/test/chainData/11155111/size128Header.inputs.json @@ -0,0 +1,3 @@ +{ + "blockNumber": 5672435 +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/size129Header.defaultInputs.json b/harness/test/chainData/11155111/size129Header.defaultInputs.json new file mode 100644 index 00000000..ff1c35ac --- /dev/null +++ b/harness/test/chainData/11155111/size129Header.defaultInputs.json @@ -0,0 +1,3 @@ +{ + "blockNumber": 5672371 +} \ No newline at end of file diff --git a/harness/test/chainData/11155111/size129Header.inputs.json b/harness/test/chainData/11155111/size129Header.inputs.json new file mode 100644 index 00000000..26aa4aed --- /dev/null +++ b/harness/test/chainData/11155111/size129Header.inputs.json @@ -0,0 +1,3 @@ +{ + "blockNumber": 5672435 +} \ No newline at end of file diff --git a/harness/test/chainData/8453.json b/harness/test/chainData/8453.json new file mode 100644 index 00000000..21bcb6fa --- /dev/null +++ b/harness/test/chainData/8453.json @@ -0,0 +1,1850 @@ +{ + "chainId": "8453", + "blockRange": { + "start": 12998594, + "end": 13006722 + }, + "blockSamples": 0, + "blockInterval": 0, + "account": { + "eoa": [ + { + "blockNumber": 13006428, + "address": "0x032755a65e6270af77a77c3efa9714b283e6e2e7" + }, + { + "blockNumber": 13006722, + "address": "0xf77eb030e5fd9419aa5b5bc1d4f16bf706a28b76" + }, + { + "blockNumber": 13006658, + "address": "0x50c2eb6a8d2132a6506c7360486283febdf4b9af" + }, + { + "blockNumber": 13006594, + "address": "0x63d55707de72db25a3817c07c56932d74331c37c" + }, + { + "blockNumber": 13006530, + "address": "0x751b77c43643a63362ab024d466fcc1d75354295" + }, + { + "blockNumber": 13006466, + "address": "0xa7c55ed504046dae4364f1a7dec5ab2e77f83128" + }, + { + "blockNumber": 13006402, + "address": "0x6bfccb86ea229ff8f690cad4780d2e39937b4d6f" + }, + { + "blockNumber": 13006338, + "address": "0x3e5e8b141f8e6d96ffc8259c2ce4b26d20d73ed4" + }, + { + "blockNumber": 13006274, + "address": "0xd2b8d5cb5cec982f8e1e88047542175dfac50f1f" + }, + { + "blockNumber": 13006210, + "address": "0x66aee3eecb2bbcccb527cb80096398f8e7f7b257" + }, + { + "blockNumber": 13006146, + "address": "0xe91663bbdc6b71540cc6b484392ebc18db8e4d48" + }, + { + "blockNumber": 13006082, + "address": "0x69b862a6225ca0ef67d30841e70a707518800698" + }, + { + "blockNumber": 13006018, + "address": "0x22b46c1f7a85fca009dd7e993cc43e4b4d23a87b" + }, + { + "blockNumber": 13005954, + "address": "0x3304e22ddaa22bcdc5fca2269b418046ae7b566a" + }, + { + "blockNumber": 13005954, + "address": "0xa9f360246d32dab016eaa41d7aa0f6000c73eb8c" + }, + { + "blockNumber": 13005890, + "address": "0x0ad0b0471dfed8953d5dcd79af9c1db9243742fe" + }, + { + "blockNumber": 13005890, + "address": "0xfd92f4e91d54b9ef91cc3f97c011a6af0c2a7eda" + }, + { + "blockNumber": 13005826, + "address": "0x737119578eb2a897afb9be0ee29ab7aaefa06e94" + }, + { + "blockNumber": 13005762, + "address": "0x6b9d97f292f8347a7ed6cc04cd34ea51150d6554" + }, + { + "blockNumber": 13005762, + "address": "0x6dcbce46a8b494c885d0e7b6817d2b519df64467" + }, + { + "blockNumber": 13005698, + "address": "0x15ca4615b7f40dd6e3288c6d6e01269efc107a57" + }, + { + "blockNumber": 13005634, + "address": "0x3ebd14954522bc975d16999ebc9b1f5ac7602989" + }, + { + "blockNumber": 13005570, + "address": "0x1179318af482ee66bdfedb23049c32931b287a28" + }, + { + "blockNumber": 13005506, + "address": "0xafec862a2830801b20c74e4f8d75d8c8a6a653b2" + }, + { + "blockNumber": 13005442, + "address": "0xbbfc6bb3ed3c988488e6f835fbfa60f4381338e9" + }, + { + "blockNumber": 13005378, + "address": "0x13fe7cbcf1fc807ea6cf540b283ce8e34300f2da" + }, + { + "blockNumber": 13005314, + "address": "0xe2e920c039ff150a657f66e890667e5e3c4e9714" + }, + { + "blockNumber": 13005250, + "address": "0xdd1533354d57a4e00c3453a280916e4edccc6097" + }, + { + "blockNumber": 13005250, + "address": "0x20fe51a9229eef2cf8ad9e89d91cab9312cf3b7a" + }, + { + "blockNumber": 13005186, + "address": "0xe93685f3bba03016f02bd1828badd6195988d950" + }, + { + "blockNumber": 13005122, + "address": "0x0cf5072065a85de03340d645ef47ef9298db7f99" + }, + { + "blockNumber": 13005058, + "address": "0xa051c3b9aa27b9158029947f0f82d4d3b44a845c" + } + ], + "contract": [ + { + "blockNumber": 13006428, + "address": "0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24" + }, + { + "blockNumber": 13006658, + "address": "0x2e86a5583a6fdfb921632876875e1053e29b2d03" + }, + { + "blockNumber": 13006594, + "address": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad" + }, + { + "blockNumber": 13006530, + "address": "0xfb5ff9cf1fc844812c4ee7c2926b562d9d842e0e" + }, + { + "blockNumber": 13006466, + "address": "0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24" + }, + { + "blockNumber": 13006402, + "address": "0x198ef79f1f515f02dfe9e3115ed9fc07183f02fc" + }, + { + "blockNumber": 13006338, + "address": "0xe1c14b9f065dead2e89ee35382f8bd42bdb87a04" + }, + { + "blockNumber": 13006274, + "address": "0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24" + }, + { + "blockNumber": 13006210, + "address": "0xba3dc701b93d875e340c562bf05f8199daf0f506" + }, + { + "blockNumber": 13006146, + "address": "0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24" + }, + { + "blockNumber": 13006082, + "address": "0x6b2c0c7be2048daa9b5527982c29f48062b34d58" + }, + { + "blockNumber": 13006018, + "address": "0x524254eedcd8221f8993ba234cb53771e68dcf4c" + }, + { + "blockNumber": 13005826, + "address": "0x802b65b5d9016621e66003aed0b16615093f328b" + }, + { + "blockNumber": 13005698, + "address": "0x0e22b5f3e11944578b37ed04f5312dfc246f443c" + }, + { + "blockNumber": 13005634, + "address": "0x2d5dfe0e4582c905233df527242616017f36e192" + }, + { + "blockNumber": 13005570, + "address": "0x1111111254eeb25477b68fb85ed929f73a960582" + }, + { + "blockNumber": 13005506, + "address": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad" + }, + { + "blockNumber": 13005442, + "address": "0xecb03b9a0e7f7b5e261d3ef752865af6621a54fe" + }, + { + "blockNumber": 13005378, + "address": "0xa82d848e06f93767fa68639026b798e5daa3462a" + }, + { + "blockNumber": 13005314, + "address": "0x6131b5fae19ea4f9d964eac0408e4408b66337b5" + }, + { + "blockNumber": 13005186, + "address": "0xcb566e3b6934fa77258d68ea18e931fa75e1aaaa" + }, + { + "blockNumber": 13005122, + "address": "0xb3da098a7251a647892203e0c256b4398d131a54" + }, + { + "blockNumber": 13005058, + "address": "0x1a8f43e01b78979eb4ef7febec60f32c9a72f58e" + }, + { + "blockNumber": 13004994, + "address": "0x1195cf65f83b3a5768f3c496d3a05ad6412c64b7" + }, + { + "blockNumber": 13004930, + "address": "0x0000000000000068f116a894984e2db1123eb395" + }, + { + "blockNumber": 13004866, + "address": "0x47fbe95e981c0df9737b6971b451fb15fdc989d9" + }, + { + "blockNumber": 13004802, + "address": "0x198ef79f1f515f02dfe9e3115ed9fc07183f02fc" + }, + { + "blockNumber": 13004738, + "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913" + }, + { + "blockNumber": 13004674, + "address": "0xe7351fd770a37282b91d153ee690b63579d6dd7f" + }, + { + "blockNumber": 13004610, + "address": "0x47fbe95e981c0df9737b6971b451fb15fdc989d9" + }, + { + "blockNumber": 13004546, + "address": "0xff404f58aea7ca290dabb6f62b8287fce28a6863" + }, + { + "blockNumber": 13004482, + "address": "0x866edeaa416f0f253db14392eb0d15a08318d87a" + } + ] + }, + "storage": { + "nonzero": [ + { + "blockNumber": 13006428, + "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", + "slot": 7 + }, + { + "blockNumber": 13006722, + "address": "0x198ef79f1f515f02dfe9e3115ed9fc07183f02fc", + "slot": 1 + }, + { + "blockNumber": 13006658, + "address": "0x3b1228c3ede7e0898d57054cd9b8f812d24315c1", + "slot": 6 + }, + { + "blockNumber": 13006594, + "address": "0x1a8f43e01b78979eb4ef7febec60f32c9a72f58e", + "slot": 5 + }, + { + "blockNumber": 13006530, + "address": "0x2eb1380bf83282ecc1135249f3f2256ea69464b2", + "slot": 2 + }, + { + "blockNumber": 13006466, + "address": "0xcf205808ed36593aa40a44f10c7f7c2f67d4a4d4", + "slot": 0 + }, + { + "blockNumber": 13006402, + "address": "0xd18917b31118fe249722e770eed12a4d6e6542cc", + "slot": 9 + }, + { + "blockNumber": 13006338, + "address": "0x1a8f43e01b78979eb4ef7febec60f32c9a72f58e", + "slot": 5 + }, + { + "blockNumber": 13006274, + "address": "0x198ef79f1f515f02dfe9e3115ed9fc07183f02fc", + "slot": 1 + }, + { + "blockNumber": 13006210, + "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", + "slot": 5 + }, + { + "blockNumber": 13006146, + "address": "0xf4ad189f436e736ca6ba5aa2972e524e9beff570", + "slot": 1 + }, + { + "blockNumber": 13006082, + "address": "0x1b6b717d9ed5006b892083fc70359a19e8d2ad0e", + "slot": 0 + }, + { + "blockNumber": 13006018, + "address": "0x50a04c0b29d2ea8c2bfde3507425d59dd788d475", + "slot": 7 + }, + { + "blockNumber": 13005954, + "address": "0x28823dbba80ec9a69ff817093cae260f2b16e5f4", + "slot": 3 + }, + { + "blockNumber": 13005890, + "address": "0xcf205808ed36593aa40a44f10c7f7c2f67d4a4d4", + "slot": 1 + }, + { + "blockNumber": 13005826, + "address": "0xe3086852a4b125803c815a158249ae468a3254ca", + "slot": 2 + }, + { + "blockNumber": 13005762, + "address": "0x198ef79f1f515f02dfe9e3115ed9fc07183f02fc", + "slot": 1 + }, + { + "blockNumber": 13005698, + "address": "0x2e86a5583a6fdfb921632876875e1053e29b2d03", + "slot": 0 + }, + { + "blockNumber": 13005634, + "address": "0x198ef79f1f515f02dfe9e3115ed9fc07183f02fc", + "slot": 1 + }, + { + "blockNumber": 13005570, + "address": "0x2e86a5583a6fdfb921632876875e1053e29b2d03", + "slot": 2 + }, + { + "blockNumber": 13005506, + "address": "0x2626664c2603336e57b271c5c0b26f421741e481", + "slot": 0 + }, + { + "blockNumber": 13005442, + "address": "0x198ef79f1f515f02dfe9e3115ed9fc07183f02fc", + "slot": 0 + }, + { + "blockNumber": 13005378, + "address": "0x198ef79f1f515f02dfe9e3115ed9fc07183f02fc", + "slot": 1 + }, + { + "blockNumber": 13005314, + "address": "0x1a8f43e01b78979eb4ef7febec60f32c9a72f58e", + "slot": 6 + }, + { + "blockNumber": 13005250, + "address": "0xecb03b9a0e7f7b5e261d3ef752865af6621a54fe", + "slot": 0 + }, + { + "blockNumber": 13005186, + "address": "0xd18917b31118fe249722e770eed12a4d6e6542cc", + "slot": 9 + }, + { + "blockNumber": 13005122, + "address": "0x42069de48741db40aef864f8764432bbccbd0b69", + "slot": 4 + }, + { + "blockNumber": 13005058, + "address": "0x198ef79f1f515f02dfe9e3115ed9fc07183f02fc", + "slot": 0 + }, + { + "blockNumber": 13004994, + "address": "0xe3086852a4b125803c815a158249ae468a3254ca", + "slot": 4 + }, + { + "blockNumber": 13004930, + "address": "0xac1bd2486aaf3b5c0fc3fd868558b082a531b2b4", + "slot": 2 + }, + { + "blockNumber": 13004866, + "address": "0xecb03b9a0e7f7b5e261d3ef752865af6621a54fe", + "slot": 4 + }, + { + "blockNumber": 13004802, + "address": "0xc64e1d954086610b05ce9d7432749f594f9ff151", + "slot": 1 + } + ] + }, + "tx": { + "type": { + "0": [ + { + "hash": "0xc1ec91428bf3b9f2ce49f666aec857ec8a38bdbf3ab4ae988af78f547a200f89", + "blockNumber": 13381360, + "txIdx": 6 + }, + { + "hash": "0x54b45f66e9aa3d148b24d1243eb42a5b8347d3803224925851fb5deeb5839ba8", + "blockNumber": 13381360, + "txIdx": 7 + }, + { + "hash": "0x5eebbcd0d5404a77604d7d20c4683e89cd9528f4062094741865c5f3d17dd4a0", + "blockNumber": 13381360, + "txIdx": 8 + }, + { + "hash": "0x69e892d63af69941b71e4696b5588ee534e5845791de79d5e8d34a09ed11db16", + "blockNumber": 13381360, + "txIdx": 10 + }, + { + "hash": "0x07c9139d9389bd66c0817484120236181adea6fdb635d65c4cd39561e88da6b0", + "blockNumber": 13381360, + "txIdx": 11 + }, + { + "hash": "0xf3e3448e16d571b7746de41390598a564386f6168085eb5f1e5d3972216ef45c", + "blockNumber": 13381360, + "txIdx": 12 + }, + { + "hash": "0x1e5fb2bbcdc681a20ac768a68b1e8c3d02c44a73e7b570ce4eaab45b9adf3206", + "blockNumber": 13381360, + "txIdx": 13 + }, + { + "hash": "0x2e0ef1c54d136193b8818cac6ca0a7d9e9c8699f6cfb0d6c31b7ec4072c968bc", + "blockNumber": 13381360, + "txIdx": 14 + }, + { + "hash": "0x17aff8ef8795bfc6af367905ca1be04e3ba94ac963adf5cce154dcafad791cb0", + "blockNumber": 13381360, + "txIdx": 15 + }, + { + "hash": "0xe6fd5bcb779e1fabbd6ebcdcf3c2ee6f23e418016c029efb85026b16cf8a2f00", + "blockNumber": 13381360, + "txIdx": 20 + }, + { + "hash": "0x6c3764ec65cd7531988c5cd570776917a30177b13e321715b917d6e05d488949", + "blockNumber": 13381360, + "txIdx": 41 + }, + { + "hash": "0x9923671cd630fabc7a0a7d0b89b7dd22f2067fc6a9a05761a66d3bacfa5593e7", + "blockNumber": 13381360, + "txIdx": 43 + }, + { + "hash": "0x7b65d07314acfb8b4c7ccf2a240150e8352c577be1510f62e8ace5aa083c15b5", + "blockNumber": 13381360, + "txIdx": 45 + }, + { + "hash": "0x8d4e28746547fcc1abe12f69ed448eae9fedb932704f97ce645f13a15f4c3148", + "blockNumber": 13381360, + "txIdx": 48 + }, + { + "hash": "0x79af9247523cd692a68071c149586692666d8a5f2a876bebaf4aaa6f05b8a35b", + "blockNumber": 13381360, + "txIdx": 49 + }, + { + "hash": "0xae47f31725f6fd27b83fc5650f3b8b386caa2c508c26859cceb0f30c4c5b03c6", + "blockNumber": 13381296, + "txIdx": 5 + }, + { + "hash": "0xfd95de0da9574274ed190396d625b0ffbc0a98a77bfc34fae137357a643626df", + "blockNumber": 13381296, + "txIdx": 6 + }, + { + "hash": "0x648fbd1935c466b0982bb4ff9cc05d73cf750eae5475fc8e25770722a0d93958", + "blockNumber": 13381296, + "txIdx": 9 + }, + { + "hash": "0xa3edcf8d092c0e773a74da31473a9972977ed376c0bb73d67ae568775d7cc944", + "blockNumber": 13381296, + "txIdx": 10 + }, + { + "hash": "0x09531e85355f2afb6d450a469f0fa1951487bb4094677c5126a97dcd9a9815f4", + "blockNumber": 13381296, + "txIdx": 11 + }, + { + "hash": "0x35927f4fc95d9328b4cbc32f1fd8523a8bb414086c7688bb16503012cdd26e5f", + "blockNumber": 13381296, + "txIdx": 12 + }, + { + "hash": "0x7f2a06956ed1018cd51be081407d6ebc56d046912756c28d53ec208249db6a17", + "blockNumber": 13381296, + "txIdx": 13 + }, + { + "hash": "0x0b800f9711dab71ebca2cf56d424d47d20b5df746e8472770b88095a0e63bc6c", + "blockNumber": 13381296, + "txIdx": 14 + }, + { + "hash": "0x6136841f29bea66a630febcd847f58a45d011047f88cc6284c4e51053443f6fd", + "blockNumber": 13381296, + "txIdx": 15 + }, + { + "hash": "0x7158365f0d22610bf7b60e71f2abdbd889caf68e211d43c6cc3765d5cc920c04", + "blockNumber": 13381296, + "txIdx": 16 + }, + { + "hash": "0x1c0eef40ed809c4ad2c7508465aca74307deb4935a873a5ae21f049581d183c4", + "blockNumber": 13381296, + "txIdx": 17 + }, + { + "hash": "0x631c8384369ae830294bbcf352b83d6ad33979061763c132e7a82a71cd13537d", + "blockNumber": 13381296, + "txIdx": 19 + }, + { + "hash": "0x63b44d35db706ed0e59daa39144a98a72aba048b36acfc5a48f31ba1027c6c49", + "blockNumber": 13381296, + "txIdx": 20 + }, + { + "hash": "0xff4ccdcda89b7c906d157974203aa279e0d094378597235c25c778e7ee1af364", + "blockNumber": 13381296, + "txIdx": 21 + }, + { + "hash": "0x73eaa169beca7c3e87def36a6b92918d575faa24b968259c8d7a223a6339495c", + "blockNumber": 13381296, + "txIdx": 22 + }, + { + "hash": "0x1287b44c506bdfbd5f5e7c63e5b62009aa40fcbf8e24b1f579fe7f6be9bc97ff", + "blockNumber": 13381296, + "txIdx": 24 + }, + { + "hash": "0xecc48abbdfe83d5b5f3c7fa38d386efc3514935dae6b20b8b23d4cba774239d3", + "blockNumber": 13381296, + "txIdx": 27 + } + ], + "1": [ + { + "hash": "0xf2b52e148831df6033b0819f06e46c2e9087c8bb79454dc800b8fcd8fe6da387", + "blockNumber": 13381296, + "txIdx": 4 + }, + { + "hash": "0xb681c9e6164b8d1a2f66649340880473f37dd33de9e525b47c33e8e24d0c8605", + "blockNumber": 13381040, + "txIdx": 2 + }, + { + "hash": "0xf16d2aac2f4eb6432af02721b22afcdfcc64ee5b2fedfdc6dd989baa48170fb6", + "blockNumber": 13380976, + "txIdx": 4 + }, + { + "hash": "0x6599c83e845300896729665832bd671071fe5b39bce60b9a2da6fccf84748b4f", + "blockNumber": 13380336, + "txIdx": 2 + } + ], + "2": [ + { + "hash": "0x319f51d164360b1b515983422254da095caf977ff6de1155446a3c620eef2ce0", + "blockNumber": 13381360, + "txIdx": 3 + }, + { + "hash": "0x1cfe63f88e935e3d9853921730f89b5a84572ed8cdb285d29e0d4e9a03aa71df", + "blockNumber": 13381360, + "txIdx": 4 + }, + { + "hash": "0xba9a88a6b931f08207dd233de5d9a8888b943e7648c8fb00d4fdc35a9076b972", + "blockNumber": 13381360, + "txIdx": 5 + }, + { + "hash": "0x74e31e0b34669ecfe5d5d13c8a7033d2910263d616ef7618859074f2e43d4396", + "blockNumber": 13381360, + "txIdx": 9 + }, + { + "hash": "0xc446b67810d20e39f2652a60c8aa0981b8f71893ca2e44be46c6d982a3d0cc76", + "blockNumber": 13381360, + "txIdx": 16 + }, + { + "hash": "0xb0b7de79528f0264fe6f304aebb8f3d7abbc2767de0f3b0d5432b8abb2c6953d", + "blockNumber": 13381360, + "txIdx": 17 + }, + { + "hash": "0x525796d661052c42c3143d805a8705b12050e180638548639a21a9a5a8bc2109", + "blockNumber": 13381360, + "txIdx": 18 + }, + { + "hash": "0x168dff898f0680bf3318ae8485bd29c57894de51bdeb2813fc6804fe38771412", + "blockNumber": 13381360, + "txIdx": 19 + }, + { + "hash": "0x7fa5affb3268d3e95d05d2d909283c15d211ff869b44a055b5496bad86c1057a", + "blockNumber": 13381360, + "txIdx": 21 + }, + { + "hash": "0x32258aecddcf72c7dfa7b679a15f37a15ec7c9883301589e9056dff1b5badbd6", + "blockNumber": 13381360, + "txIdx": 22 + }, + { + "hash": "0x84fa00505a9b22268ba5dadb7b50cb2aa0479769c1212fce18064482666cfd49", + "blockNumber": 13381360, + "txIdx": 23 + }, + { + "hash": "0xccad8ddc1c9fe0eff42227f8b19d2c4831b5f1e6606855ba9a62a754c4ca78dd", + "blockNumber": 13381360, + "txIdx": 24 + }, + { + "hash": "0x4a53c4d70e637b2386a6c6e9bd91a556f7a0ac60a7b60517908c6a47c0baa57d", + "blockNumber": 13381360, + "txIdx": 25 + }, + { + "hash": "0x09db2f4115e6d7c65fad48df7237b02e87d6278a99f0f1e466dccabfed3e06cb", + "blockNumber": 13381360, + "txIdx": 26 + }, + { + "hash": "0x60260c7780b983e938abe533594b8267ff6fd5e596d994270730d3a36c94462b", + "blockNumber": 13381360, + "txIdx": 27 + }, + { + "hash": "0xb9f7acb8656f1dd1697c60dfc10b644e154cf92abb74581831cda35de0aa70d1", + "blockNumber": 13381360, + "txIdx": 28 + }, + { + "hash": "0x2ec28c1186288e230848b5652af2c6763b1fd5d1c0bc7dcc6fcdbc7e23f262a1", + "blockNumber": 13381360, + "txIdx": 29 + }, + { + "hash": "0x311803859db37305a580b02c4a975595f5418128e2dbade900dd541f749182fb", + "blockNumber": 13381360, + "txIdx": 30 + }, + { + "hash": "0x40d0cff43fbd018f70f4a62ee09a0bef750a4a7a3878037b133eef2b5c6d9808", + "blockNumber": 13381360, + "txIdx": 31 + }, + { + "hash": "0x930b0b7c0ddde8db03ee23a37533f747c31d78225a372d0ab0a6197f23e6825d", + "blockNumber": 13381360, + "txIdx": 32 + }, + { + "hash": "0x9c642b9efc1e4748edb5a3a36a0412aa9fc86cd8f70272d77086d02698bc21d7", + "blockNumber": 13381360, + "txIdx": 33 + }, + { + "hash": "0x9393e2ead7a1a018d06361e4d39abef7676d0220b47c00c5af733e74de82855b", + "blockNumber": 13381360, + "txIdx": 34 + }, + { + "hash": "0x100401cbd9ae5c5c5161d78ce550bb348cdc89a6c655815bc4446c101549e5d6", + "blockNumber": 13381360, + "txIdx": 35 + }, + { + "hash": "0x6e13723631e2327353e3f1146c091fb036a82e6a17336f9c3559d83294d84903", + "blockNumber": 13381360, + "txIdx": 36 + }, + { + "hash": "0xa5c80c641cf9fec8aa2a59e546418da9a0a542eff63156dfc9ce8a75b27fc2d2", + "blockNumber": 13381360, + "txIdx": 37 + }, + { + "hash": "0x0be916e25015e93ff99d566c120e059f0d766ec19998742144bce68473e39c24", + "blockNumber": 13381360, + "txIdx": 38 + }, + { + "hash": "0x21ddac9ef704d51b93bf1388f446a955c59b3b6133469d15d765be2ab1fa302c", + "blockNumber": 13381360, + "txIdx": 39 + }, + { + "hash": "0xce8de3db37e55cf8ebe93e2b56e4002f7623733650f30df3ddabb751941e377c", + "blockNumber": 13381360, + "txIdx": 40 + }, + { + "hash": "0xafdc3401ef22c3c63053a3b3e610f290af478f83568a429d9fe6ebf35cbef922", + "blockNumber": 13381360, + "txIdx": 42 + }, + { + "hash": "0x2284508791e209f3e1d7de6bfb906c693b88e190d77b63b24926e5e11c56ee5f", + "blockNumber": 13381360, + "txIdx": 44 + }, + { + "hash": "0xb2e64a4d4eb55b75b2468b4d5df835cfab80d4ebd82649bef9c2ff7f2a14e181", + "blockNumber": 13381360, + "txIdx": 46 + }, + { + "hash": "0xdd0efdd955ded813c05f53469269a4484bb746d31f546b955858e46e38a73f33", + "blockNumber": 13381360, + "txIdx": 47 + } + ], + "3": [] + }, + "category": { + "default": [ + { + "hash": "0xe6c3994aeb103d365f75e44c2774cb0f4d721e1ba8c5db909912bab0f77835c5", + "blockNumber": 13006428, + "txIdx": 4 + }, + { + "hash": "0x1454f2c6684f662c8396fa38869ba4c20cb8d2f59a6ac442176f614b2995ba7f", + "blockNumber": 13006428, + "txIdx": 5 + }, + { + "hash": "0x1797176df6750301eb98f4054e5a8e32ccce763bba953df0ee63abb7e06f0e59", + "blockNumber": 13006428, + "txIdx": 6 + }, + { + "hash": "0xa4c95fb7a7042f94a0bc688def6a72bcb5f3b2be9ac0594850030b6843d01458", + "blockNumber": 13006428, + "txIdx": 7 + }, + { + "hash": "0xebfbf452195b228de771e45c9d55b6a2e71bf00a5a6b2071d742ea741c9d055c", + "blockNumber": 13006428, + "txIdx": 8 + }, + { + "hash": "0xafa32ec0e37cfb790fa8322671f3bb703712a6ca030685ae8b26af35a11ffa24", + "blockNumber": 13006428, + "txIdx": 9 + }, + { + "hash": "0xdb890c937e1debe856f400ed8210add3d720c3ba256a815d645e50520469f925", + "blockNumber": 13006428, + "txIdx": 10 + }, + { + "hash": "0xa0b90dd050ae78597707e819b1b52a571cc3b3ca3fa75f2bf0325df98fe987b4", + "blockNumber": 13006428, + "txIdx": 11 + }, + { + "hash": "0x244fc029bd010183c717ba7d6c493b08ca04216033f51afd1c0f1eb3fabfdffe", + "blockNumber": 13006428, + "txIdx": 12 + }, + { + "hash": "0xf5a40db42bf3ef501fe9090c0f10881e663d9505fbcc57b634ee1225326c10f9", + "blockNumber": 13006428, + "txIdx": 13 + }, + { + "hash": "0xde8e1d81a54a0a1162046f0802927d7103d6a0d926e7305ae2f1524861c320f9", + "blockNumber": 13006428, + "txIdx": 14 + }, + { + "hash": "0x1fd58a866d6d8dce0cb9ea71db56d24d2940e6b6bfd841fa88e46a1b29cfdbae", + "blockNumber": 13006428, + "txIdx": 15 + }, + { + "hash": "0xc7fa33de18cb00184e9e7e874fc3a37106d3266f80a265d7e0d1d0f54d977f4b", + "blockNumber": 13006428, + "txIdx": 16 + }, + { + "hash": "0x1d35e868651ef6ae13698e54b1053e950cf919fde79e3f6df0194aabf3f881af", + "blockNumber": 13006428, + "txIdx": 17 + }, + { + "hash": "0x0477c3a8a05ed04e5986d15943507a3a167657e3541ec004d31d7e027e4e6804", + "blockNumber": 13006428, + "txIdx": 18 + }, + { + "hash": "0xaf5073fae75c5daa6f7ab7b2679254737ac4c538eba02e4ac22d3b48458175c4", + "blockNumber": 13006428, + "txIdx": 19 + }, + { + "hash": "0x1709b486be108d13e16bd2f86bed37b77e4683bce8a5dcda77d691d22ad35aa4", + "blockNumber": 13006428, + "txIdx": 20 + }, + { + "hash": "0x671292af7fc605d87e3e8020252952c545fa95d85ac4a50218c94e6861e4212a", + "blockNumber": 13006428, + "txIdx": 21 + }, + { + "hash": "0x0682251d517b9f8fe1863c4c11caac3f51bbf40114c8501bdf9960cd558995bd", + "blockNumber": 13006428, + "txIdx": 22 + }, + { + "hash": "0x9bfcb9a2a17282518c4940f08a265d2efe8119a07381cbc14e70978bff58844c", + "blockNumber": 13006428, + "txIdx": 23 + }, + { + "hash": "0x3cddd7280cafb9d7acb4904e527424966f38c135587bb59337b430bd1210b9f8", + "blockNumber": 13006428, + "txIdx": 24 + }, + { + "hash": "0xb8afcf53ea99a06f3e1646759d08408d107df438b80ba343335b64104039bebf", + "blockNumber": 13006428, + "txIdx": 25 + }, + { + "hash": "0x98d955332f5041566baa7b2b49fbf30c229e67bea52bee9ff9f10e65d5385be8", + "blockNumber": 13006428, + "txIdx": 26 + }, + { + "hash": "0x4354be9fdaa4fcfd76c17e4086b30f0432e5f089c9b9dd3ffda6aea8b3d65163", + "blockNumber": 13006428, + "txIdx": 27 + }, + { + "hash": "0x2dd3fc35ea56188a53947345e931d81602b0c1bdfbf00cbcc63e0e2522f63d01", + "blockNumber": 13006428, + "txIdx": 28 + }, + { + "hash": "0x0c3dd65b0db8b3ba8cc9d4b7ca50190a32ac5f7b56e273223add44e75b2b61c3", + "blockNumber": 13006428, + "txIdx": 29 + }, + { + "hash": "0x103492db3dee9372220a665857827ce20b0a559e5bd398d12f05d98cd5b24b46", + "blockNumber": 13006428, + "txIdx": 30 + }, + { + "hash": "0x11267c24560a2c6fb78aab5a486f09dc7e96aab107e2be2ed8ed6b7d5790808d", + "blockNumber": 13006428, + "txIdx": 31 + }, + { + "hash": "0x0c7288797fae5845742a56fe1a43617f0931f174409b9d57bd7c82f89ab4cc08", + "blockNumber": 13006428, + "txIdx": 32 + }, + { + "hash": "0xb02a8ab2272c3c6d42d893f9db7ac5abb4d9c24852ff8c707883c62e48487885", + "blockNumber": 13006428, + "txIdx": 33 + }, + { + "hash": "0x98e54272bfade3419534b0f8f658bd53355c7b04844f09eb88d7f608dd066720", + "blockNumber": 13006428, + "txIdx": 34 + }, + { + "hash": "0xdf882259e6c4f08746cbbecb81d5e345a9cb2aba12cfea833bb8cde695969c12", + "blockNumber": 13006428, + "txIdx": 35 + } + ], + "large": [ + { + "hash": "0xda944064eb5d668b4dcd170f5a875b43338412e9f1e6b104aa2c4a2665b7effa", + "blockNumber": 13004162, + "txIdx": 53 + }, + { + "hash": "0x6bd61460fb8f06a39a7889da6940d0ae10cf61ee3d69d084ba933bd5cd1d0ef8", + "blockNumber": 13003266, + "txIdx": 26 + }, + { + "hash": "0x9857d2d0f76dd5aebd339639e89874ce8b21914cf1cd736937b4df1a9c627b6e", + "blockNumber": 13002626, + "txIdx": 20 + }, + { + "hash": "0x58af597e7752cd844a4688dcdb74236f5e8c4c47bdb39dbc3cd5e84bba70be0d", + "blockNumber": 13002434, + "txIdx": 31 + }, + { + "hash": "0x5218ff3a5733260c7012ff50f4611cda45d82ffba8d981c8f6a96d298f976e78", + "blockNumber": 13002434, + "txIdx": 33 + }, + { + "hash": "0x3f05b37260bdce8dedfbb5dd4eaa763b03a543aa35a2b118cd7d0c0e43ff62c2", + "blockNumber": 13002434, + "txIdx": 48 + }, + { + "hash": "0x8b41c3baf2f9700ecfc8625c1b262487be8a30b1dfba21777f1a4e8fe1ab6577", + "blockNumber": 13002370, + "txIdx": 75 + }, + { + "hash": "0x1f53aa0175f104b65459f764f230aed38e420d81afb85a0b548af0175a9b4c59", + "blockNumber": 13002050, + "txIdx": 37 + }, + { + "hash": "0x4729cd50f2049ed03dbae7be3f3aba62e8e77502280f3b94e77a1c583449263f", + "blockNumber": 12999746, + "txIdx": 54 + }, + { + "hash": "0xf93e272b832e1a1b244e30668b4c556e8e9728c5ea15a4f3293f193053b51fe7", + "blockNumber": 12999298, + "txIdx": 20 + }, + { + "hash": "0x46f54f4498dceb41704454f1f21c0937337fb810e3c44e63edbd6418c93b8cda", + "blockNumber": 12998594, + "txIdx": 37 + } + ], + "max": [ + { + "hash": "0x65412cab5538c26798078ae8c6661a5e1be6f0d773fe0c8c8064144d9023fa2c", + "blockNumber": 13006428, + "txIdx": 2 + }, + { + "hash": "0x115c9780a26c66062c485ea9dc14e0ed0297785a6cd26003a467d51e84264acc", + "blockNumber": 13006428, + "txIdx": 3 + }, + { + "hash": "0xb1967c2792d3bd8cc6dfa23b26416e0910e3595072c1d01a2966f3702b5e2c07", + "blockNumber": 13003842, + "txIdx": 41 + }, + { + "hash": "0x780264196b32ab1c65fb45212bcd9f4b3bccb8a0c187cfc8d84fa9a27c63754f", + "blockNumber": 13002754, + "txIdx": 65 + }, + { + "hash": "0x685bdd82cfc15364507b7af7dcf59d4aeb22241dd26f86e91d664b2432249a41", + "blockNumber": 13001538, + "txIdx": 26 + } + ], + "oversize": [] + } + }, + "rc": { + "events": [ + { + "hash": "0x1cfe63f88e935e3d9853921730f89b5a84572ed8cdb285d29e0d4e9a03aa71df", + "blockNumber": 13381360, + "txIdx": 4, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x1cfe63f88e935e3d9853921730f89b5a84572ed8cdb285d29e0d4e9a03aa71df", + "blockNumber": 13381360, + "txIdx": 4, + "logIdx": 1, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x1cfe63f88e935e3d9853921730f89b5a84572ed8cdb285d29e0d4e9a03aa71df", + "blockNumber": 13381360, + "txIdx": 4, + "logIdx": 2, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x1cfe63f88e935e3d9853921730f89b5a84572ed8cdb285d29e0d4e9a03aa71df", + "blockNumber": 13381360, + "txIdx": 4, + "logIdx": 3, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x1cfe63f88e935e3d9853921730f89b5a84572ed8cdb285d29e0d4e9a03aa71df", + "blockNumber": 13381360, + "txIdx": 4, + "logIdx": 4, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x1cfe63f88e935e3d9853921730f89b5a84572ed8cdb285d29e0d4e9a03aa71df", + "blockNumber": 13381360, + "txIdx": 4, + "logIdx": 6, + "eventSchema": "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822" + }, + { + "hash": "0x1cfe63f88e935e3d9853921730f89b5a84572ed8cdb285d29e0d4e9a03aa71df", + "blockNumber": 13381360, + "txIdx": 4, + "logIdx": 7, + "eventSchema": "0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65" + }, + { + "hash": "0x1cfe63f88e935e3d9853921730f89b5a84572ed8cdb285d29e0d4e9a03aa71df", + "blockNumber": 13381360, + "txIdx": 4, + "logIdx": 9, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x1cfe63f88e935e3d9853921730f89b5a84572ed8cdb285d29e0d4e9a03aa71df", + "blockNumber": 13381360, + "txIdx": 4, + "logIdx": 10, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x1cfe63f88e935e3d9853921730f89b5a84572ed8cdb285d29e0d4e9a03aa71df", + "blockNumber": 13381360, + "txIdx": 4, + "logIdx": 12, + "eventSchema": "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822" + }, + { + "hash": "0x1cfe63f88e935e3d9853921730f89b5a84572ed8cdb285d29e0d4e9a03aa71df", + "blockNumber": 13381360, + "txIdx": 4, + "logIdx": 13, + "eventSchema": "0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65" + }, + { + "hash": "0xcb81fc268c492e8b97913700723fe8475e324af22d4022cdcacb2cec5d1f7390", + "blockNumber": 13381296, + "txIdx": 1, + "logIdx": 0, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x510effa798492118340b87d24b5f2b8041d2e6ea87f52856267a1e4532d83d5e", + "blockNumber": 13381232, + "txIdx": 1, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x510effa798492118340b87d24b5f2b8041d2e6ea87f52856267a1e4532d83d5e", + "blockNumber": 13381232, + "txIdx": 1, + "logIdx": 1, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x510effa798492118340b87d24b5f2b8041d2e6ea87f52856267a1e4532d83d5e", + "blockNumber": 13381232, + "txIdx": 1, + "logIdx": 2, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x510effa798492118340b87d24b5f2b8041d2e6ea87f52856267a1e4532d83d5e", + "blockNumber": 13381232, + "txIdx": 1, + "logIdx": 3, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x510effa798492118340b87d24b5f2b8041d2e6ea87f52856267a1e4532d83d5e", + "blockNumber": 13381232, + "txIdx": 1, + "logIdx": 4, + "eventSchema": "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67" + }, + { + "hash": "0x510effa798492118340b87d24b5f2b8041d2e6ea87f52856267a1e4532d83d5e", + "blockNumber": 13381232, + "txIdx": 1, + "logIdx": 5, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x510effa798492118340b87d24b5f2b8041d2e6ea87f52856267a1e4532d83d5e", + "blockNumber": 13381232, + "txIdx": 1, + "logIdx": 6, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x510effa798492118340b87d24b5f2b8041d2e6ea87f52856267a1e4532d83d5e", + "blockNumber": 13381232, + "txIdx": 1, + "logIdx": 7, + "eventSchema": "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67" + }, + { + "hash": "0x510effa798492118340b87d24b5f2b8041d2e6ea87f52856267a1e4532d83d5e", + "blockNumber": 13381232, + "txIdx": 1, + "logIdx": 8, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x510effa798492118340b87d24b5f2b8041d2e6ea87f52856267a1e4532d83d5e", + "blockNumber": 13381232, + "txIdx": 1, + "logIdx": 9, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x510effa798492118340b87d24b5f2b8041d2e6ea87f52856267a1e4532d83d5e", + "blockNumber": 13381232, + "txIdx": 1, + "logIdx": 10, + "eventSchema": "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67" + }, + { + "hash": "0x510effa798492118340b87d24b5f2b8041d2e6ea87f52856267a1e4532d83d5e", + "blockNumber": 13381232, + "txIdx": 1, + "logIdx": 11, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x510effa798492118340b87d24b5f2b8041d2e6ea87f52856267a1e4532d83d5e", + "blockNumber": 13381232, + "txIdx": 1, + "logIdx": 12, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x510effa798492118340b87d24b5f2b8041d2e6ea87f52856267a1e4532d83d5e", + "blockNumber": 13381232, + "txIdx": 1, + "logIdx": 13, + "eventSchema": "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67" + }, + { + "hash": "0x510effa798492118340b87d24b5f2b8041d2e6ea87f52856267a1e4532d83d5e", + "blockNumber": 13381232, + "txIdx": 1, + "logIdx": 14, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x510effa798492118340b87d24b5f2b8041d2e6ea87f52856267a1e4532d83d5e", + "blockNumber": 13381232, + "txIdx": 1, + "logIdx": 15, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x510effa798492118340b87d24b5f2b8041d2e6ea87f52856267a1e4532d83d5e", + "blockNumber": 13381232, + "txIdx": 1, + "logIdx": 16, + "eventSchema": "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67" + }, + { + "hash": "0x510effa798492118340b87d24b5f2b8041d2e6ea87f52856267a1e4532d83d5e", + "blockNumber": 13381232, + "txIdx": 1, + "logIdx": 17, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x510effa798492118340b87d24b5f2b8041d2e6ea87f52856267a1e4532d83d5e", + "blockNumber": 13381232, + "txIdx": 1, + "logIdx": 18, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x510effa798492118340b87d24b5f2b8041d2e6ea87f52856267a1e4532d83d5e", + "blockNumber": 13381232, + "txIdx": 1, + "logIdx": 19, + "eventSchema": "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67" + } + ], + "category": { + "default": [ + { + "hash": "0x65412cab5538c26798078ae8c6661a5e1be6f0d773fe0c8c8064144d9023fa2c", + "blockNumber": 13006428, + "txIdx": 2 + }, + { + "hash": "0x115c9780a26c66062c485ea9dc14e0ed0297785a6cd26003a467d51e84264acc", + "blockNumber": 13006428, + "txIdx": 3 + }, + { + "hash": "0x1797176df6750301eb98f4054e5a8e32ccce763bba953df0ee63abb7e06f0e59", + "blockNumber": 13006428, + "txIdx": 6 + }, + { + "hash": "0xa4c95fb7a7042f94a0bc688def6a72bcb5f3b2be9ac0594850030b6843d01458", + "blockNumber": 13006428, + "txIdx": 7 + }, + { + "hash": "0xafa32ec0e37cfb790fa8322671f3bb703712a6ca030685ae8b26af35a11ffa24", + "blockNumber": 13006428, + "txIdx": 9 + }, + { + "hash": "0xdb890c937e1debe856f400ed8210add3d720c3ba256a815d645e50520469f925", + "blockNumber": 13006428, + "txIdx": 10 + }, + { + "hash": "0xa0b90dd050ae78597707e819b1b52a571cc3b3ca3fa75f2bf0325df98fe987b4", + "blockNumber": 13006428, + "txIdx": 11 + }, + { + "hash": "0x244fc029bd010183c717ba7d6c493b08ca04216033f51afd1c0f1eb3fabfdffe", + "blockNumber": 13006428, + "txIdx": 12 + }, + { + "hash": "0xde8e1d81a54a0a1162046f0802927d7103d6a0d926e7305ae2f1524861c320f9", + "blockNumber": 13006428, + "txIdx": 14 + }, + { + "hash": "0x1fd58a866d6d8dce0cb9ea71db56d24d2940e6b6bfd841fa88e46a1b29cfdbae", + "blockNumber": 13006428, + "txIdx": 15 + }, + { + "hash": "0xc7fa33de18cb00184e9e7e874fc3a37106d3266f80a265d7e0d1d0f54d977f4b", + "blockNumber": 13006428, + "txIdx": 16 + }, + { + "hash": "0x1d35e868651ef6ae13698e54b1053e950cf919fde79e3f6df0194aabf3f881af", + "blockNumber": 13006428, + "txIdx": 17 + }, + { + "hash": "0x0477c3a8a05ed04e5986d15943507a3a167657e3541ec004d31d7e027e4e6804", + "blockNumber": 13006428, + "txIdx": 18 + }, + { + "hash": "0xaf5073fae75c5daa6f7ab7b2679254737ac4c538eba02e4ac22d3b48458175c4", + "blockNumber": 13006428, + "txIdx": 19 + }, + { + "hash": "0x1709b486be108d13e16bd2f86bed37b77e4683bce8a5dcda77d691d22ad35aa4", + "blockNumber": 13006428, + "txIdx": 20 + }, + { + "hash": "0x671292af7fc605d87e3e8020252952c545fa95d85ac4a50218c94e6861e4212a", + "blockNumber": 13006428, + "txIdx": 21 + }, + { + "hash": "0x0682251d517b9f8fe1863c4c11caac3f51bbf40114c8501bdf9960cd558995bd", + "blockNumber": 13006428, + "txIdx": 22 + }, + { + "hash": "0x9bfcb9a2a17282518c4940f08a265d2efe8119a07381cbc14e70978bff58844c", + "blockNumber": 13006428, + "txIdx": 23 + }, + { + "hash": "0x98d955332f5041566baa7b2b49fbf30c229e67bea52bee9ff9f10e65d5385be8", + "blockNumber": 13006428, + "txIdx": 26 + }, + { + "hash": "0x4354be9fdaa4fcfd76c17e4086b30f0432e5f089c9b9dd3ffda6aea8b3d65163", + "blockNumber": 13006428, + "txIdx": 27 + }, + { + "hash": "0x2dd3fc35ea56188a53947345e931d81602b0c1bdfbf00cbcc63e0e2522f63d01", + "blockNumber": 13006428, + "txIdx": 28 + }, + { + "hash": "0x0c3dd65b0db8b3ba8cc9d4b7ca50190a32ac5f7b56e273223add44e75b2b61c3", + "blockNumber": 13006428, + "txIdx": 29 + }, + { + "hash": "0x103492db3dee9372220a665857827ce20b0a559e5bd398d12f05d98cd5b24b46", + "blockNumber": 13006428, + "txIdx": 30 + }, + { + "hash": "0x11267c24560a2c6fb78aab5a486f09dc7e96aab107e2be2ed8ed6b7d5790808d", + "blockNumber": 13006428, + "txIdx": 31 + }, + { + "hash": "0x0c7288797fae5845742a56fe1a43617f0931f174409b9d57bd7c82f89ab4cc08", + "blockNumber": 13006428, + "txIdx": 32 + }, + { + "hash": "0xb02a8ab2272c3c6d42d893f9db7ac5abb4d9c24852ff8c707883c62e48487885", + "blockNumber": 13006428, + "txIdx": 33 + }, + { + "hash": "0x98e54272bfade3419534b0f8f658bd53355c7b04844f09eb88d7f608dd066720", + "blockNumber": 13006428, + "txIdx": 34 + }, + { + "hash": "0xdf882259e6c4f08746cbbecb81d5e345a9cb2aba12cfea833bb8cde695969c12", + "blockNumber": 13006428, + "txIdx": 35 + }, + { + "hash": "0x4e2ef84fa80847160f97525e890697338fd3b9abcdda9f155151ffbeb9bf9ccb", + "blockNumber": 13006428, + "txIdx": 36 + }, + { + "hash": "0xef073d812bc2e061704751be7f2e71a7d570b5ace7c9211512e946384ef34eae", + "blockNumber": 13006428, + "txIdx": 37 + }, + { + "hash": "0xd2963c2fdbec4da681ea41ea36e77cd33418e402d30e9588951d2656fa20f59e", + "blockNumber": 13006428, + "txIdx": 38 + }, + { + "hash": "0x2532f5c1f0cf061823b9a817355fccc906fa354dbc52a116de4d5a2bcacf5486", + "blockNumber": 13006428, + "txIdx": 39 + } + ], + "medium": [ + { + "hash": "0x5d7babbb4dbd7c4991f16af99c914d19dd35b2f2c2f3d194390e345bc822f94c", + "blockNumber": 13006466, + "txIdx": 25 + }, + { + "hash": "0x4422fda5932ca17c96cf829443a603640a88d3443a9a983d75c4d4d2d5cd1f76", + "blockNumber": 13006274, + "txIdx": 12 + }, + { + "hash": "0x439be47fff1da4b04c8557888b873b4ccdd9ef2f7adb7773364cbebc9854f65d", + "blockNumber": 13006210, + "txIdx": 49 + }, + { + "hash": "0xbfc85fb9de31e71d7086200b848cebaec96fd80a99170658ab054b5c820b515e", + "blockNumber": 13006082, + "txIdx": 19 + }, + { + "hash": "0xe98ccc190f33ac798e3e7c82deba30acbd72b65bd5a23134e98a15c7061e25c6", + "blockNumber": 13005954, + "txIdx": 39 + }, + { + "hash": "0x70d782cbd5fc2cf6fa84d745eefdd64a4abaf64ea9607f22cdc23c8c9897a2f5", + "blockNumber": 13005954, + "txIdx": 57 + }, + { + "hash": "0x9a3fb5cc7c76a57f42cc5cc97e418cb3476890d15c68f36d1ed7d0c53d3ae7b2", + "blockNumber": 13005826, + "txIdx": 48 + }, + { + "hash": "0x6d10809f8f68ff06133bdc1eb9735c4a68b62f0560473163f3c6dd92874e3243", + "blockNumber": 13005762, + "txIdx": 11 + }, + { + "hash": "0x3e00321380b4b6135dcd2b1b5f1429a3b788b098ef5b883991abd21b3407a43e", + "blockNumber": 13005762, + "txIdx": 40 + }, + { + "hash": "0x88c84f0478bac3af98123b5dbdc726521f7ae0d70325f409f3963da3580ab1eb", + "blockNumber": 13005698, + "txIdx": 17 + }, + { + "hash": "0xbd02142e7cdbb2d0364163d482d7f52ef69b0d904e8a66c54d8863ba57768ad8", + "blockNumber": 13005698, + "txIdx": 20 + }, + { + "hash": "0x8afdc65e0b7f89073a654a497356c2f83ae4751977f7eec531eac65837f8ce17", + "blockNumber": 13005570, + "txIdx": 21 + }, + { + "hash": "0x08a03154d0a428093ffd92c062ef94d247f64d985d8d0e7fc9e4dcf2e556698d", + "blockNumber": 13005442, + "txIdx": 28 + }, + { + "hash": "0x3cc78aaab3a69a346ccec1c898403f07edf17d7d2170c03c953047adf35b3add", + "blockNumber": 13005314, + "txIdx": 22 + }, + { + "hash": "0x339e9f01c10582efcff22aedc2e70e5b4967dd3e989ae43f41aa048ea1ae2864", + "blockNumber": 13005186, + "txIdx": 19 + }, + { + "hash": "0x9ca28601fe815a73de80eef67001404a7e5dfacb204a39725cf992ee3ce69e01", + "blockNumber": 13005058, + "txIdx": 138 + }, + { + "hash": "0x4c225a42cb0fb2ff3d2b51039ae6966073b5c235b35b59cf926c5fee8f12892b", + "blockNumber": 13004738, + "txIdx": 47 + }, + { + "hash": "0x414e875dcc93c8a78807b8bc3a5cb541659eb3dfd1180180330f5035deb579eb", + "blockNumber": 13004674, + "txIdx": 25 + }, + { + "hash": "0x6d90589af72046081f712507e41a0c844e0c340cf0ac649b8e3f229412589d5b", + "blockNumber": 13004610, + "txIdx": 18 + }, + { + "hash": "0x3311e2d1986f8a91e0f7db89763602905cb3ad16fb6f0177702a97d595c86192", + "blockNumber": 13004546, + "txIdx": 33 + }, + { + "hash": "0x3334aa25a91401c760182340c6bad893b2f76644300291cfb2f99064a6ac6890", + "blockNumber": 13004482, + "txIdx": 1 + }, + { + "hash": "0xc866a02e189ba75db3f170af3b0d8440dc7b3fa64ee27e364a4ddd7fb6e0a190", + "blockNumber": 13004418, + "txIdx": 26 + }, + { + "hash": "0x09a551ab9f5d9ba6fc18253fa35c3db88caa0b0a51c87204fbc267bb9e596216", + "blockNumber": 13004354, + "txIdx": 46 + }, + { + "hash": "0x3c48da72e936356ac350ddc290185cb1d18718caf63121c8d3b27753d87fdba3", + "blockNumber": 13004226, + "txIdx": 38 + }, + { + "hash": "0x98f28183efb9943e7c6f18c45c1fb83c77c04bf50890129e4c9938c8c2ca03f0", + "blockNumber": 13003842, + "txIdx": 36 + }, + { + "hash": "0xb1967c2792d3bd8cc6dfa23b26416e0910e3595072c1d01a2966f3702b5e2c07", + "blockNumber": 13003842, + "txIdx": 41 + }, + { + "hash": "0xa5c8992c6f690e211b0bfca80266f16180736c8ff71ee959a9d06d66e371ac48", + "blockNumber": 13003778, + "txIdx": 25 + }, + { + "hash": "0x99ca7eed932e5f341bb1b3b0d6ae483acbf4504d8a0eceba38631042f66d3c70", + "blockNumber": 13003650, + "txIdx": 37 + }, + { + "hash": "0xd103c5d8f8f4f6e8ab0a8e94fe3af9959acf3757c37f509c99a160f7192c9490", + "blockNumber": 13003650, + "txIdx": 38 + }, + { + "hash": "0xc6b755ed182ff5beb75aa741a5bcc247cca154c6ebd56482c5a613d179e43156", + "blockNumber": 13003522, + "txIdx": 30 + }, + { + "hash": "0x07fdf25e4a8a7efab05691861711239dac9a87fc7c48b7441dddfd74320eede1", + "blockNumber": 13003458, + "txIdx": 17 + }, + { + "hash": "0x07dac4cc57c15e88ec53e3a314042ee313cd19a7bd0a00f21959e6935ced2c32", + "blockNumber": 13003458, + "txIdx": 36 + } + ], + "large": [ + { + "hash": "0xe6c3994aeb103d365f75e44c2774cb0f4d721e1ba8c5db909912bab0f77835c5", + "blockNumber": 13006428, + "txIdx": 4 + }, + { + "hash": "0x5901fc4ff0870dc58b029c1ac16156ed55b3f8fecc3e5a428cbecc07979add1c", + "blockNumber": 13006722, + "txIdx": 10 + }, + { + "hash": "0x8879965a2ef4a82d14e84dea67ef2061b62ab1a84438591cb82f1bc4357c4593", + "blockNumber": 13006594, + "txIdx": 11 + }, + { + "hash": "0xab6f3a2eec0901c534880581702a8d0cc24ba79f65b0b0279bb9268854117e31", + "blockNumber": 13006338, + "txIdx": 27 + }, + { + "hash": "0x2bb8cbfc36944a4ffea18a381b4519e6a7c2b807609ccdeab565fc66481ffe53", + "blockNumber": 13006274, + "txIdx": 28 + }, + { + "hash": "0x58e3f31ecb7d421fafa4e6748801cd948cead20ac8721473f357a15a5236cf46", + "blockNumber": 13006146, + "txIdx": 14 + }, + { + "hash": "0xcbd5e8f47c2f18c6dfc903b663c54adcb16bea5a997533eaa1df1e08aaa80ee6", + "blockNumber": 13005762, + "txIdx": 15 + }, + { + "hash": "0x467c379b011001b9aec2e660af94e7830d8e868b7b838ae44afa01a97fd181ab", + "blockNumber": 13005442, + "txIdx": 14 + }, + { + "hash": "0x2a1af22199c6716a3f02f027e6ff2ff767d9ba7cd54a70407d616937b19080b4", + "blockNumber": 13005378, + "txIdx": 7 + }, + { + "hash": "0xacb3420c88e929d94abadac22a9f9af55a2f5e76c37aef94e1a7ddb044a3c127", + "blockNumber": 13005186, + "txIdx": 9 + }, + { + "hash": "0xb47939373c35c3fc4dab2ed0ad35a374c8505db409db6ab693d1276fc7110b88", + "blockNumber": 13005122, + "txIdx": 14 + }, + { + "hash": "0x23b3289367990aaf6cdb04ea03fa51a2b75099a8341e79f647b38dbafb36e7d0", + "blockNumber": 13005058, + "txIdx": 7 + }, + { + "hash": "0xfd891beb7ef0bf4b0b9e4d12378ba38ac418ebef86f60fb7cdd6bf977396268f", + "blockNumber": 13005058, + "txIdx": 51 + }, + { + "hash": "0x416fcda8425b3e656187e49421b24784da608798c3514ae9ca0667731f709ff4", + "blockNumber": 13004994, + "txIdx": 51 + }, + { + "hash": "0xddc54204854ee407304b1625206e7b419a025dca9b009b46bcfa1c9564a34298", + "blockNumber": 13004930, + "txIdx": 5 + }, + { + "hash": "0xd332cd47f2a5e03a99b09827478df94f7c37c3a3a83944da6516fe1ea8bbf2b2", + "blockNumber": 13004930, + "txIdx": 30 + }, + { + "hash": "0xc16d70c09cca5dc41cba2eb0ad562436cdb8e631479d673aa288d2dc6aaa3269", + "blockNumber": 13004866, + "txIdx": 23 + }, + { + "hash": "0x6ab53229d7fce1f3602ba86ab2f605bff748e55c0900ecc8244e140f05672cdf", + "blockNumber": 13004802, + "txIdx": 6 + }, + { + "hash": "0x237adb2703987294541e51e416df765fa929360c915b88470370bd7238fc4b5b", + "blockNumber": 13004738, + "txIdx": 35 + }, + { + "hash": "0x5db294dd818d0228934ac37db96ae90f35e4befc79928eef2e04addff313526f", + "blockNumber": 13004674, + "txIdx": 3 + }, + { + "hash": "0x7bb820cf754be2a6a77cea8ed72be259dd60ad6500077299d6a6d4bd8130ecd7", + "blockNumber": 13004354, + "txIdx": 23 + }, + { + "hash": "0x1a06c5654fae0425a4678b8b550a9d7239be9e389909e3be4a15e610894e195b", + "blockNumber": 13004290, + "txIdx": 23 + }, + { + "hash": "0xaa0e8bae3a38b96dbd70946d72d433f84a8415359d5376a7343c693f68527e19", + "blockNumber": 13004162, + "txIdx": 25 + }, + { + "hash": "0xecd33dbadc8c3fb5d14c22c1c33a91965919c31d711b834a81312f82ea8bb960", + "blockNumber": 13004098, + "txIdx": 28 + }, + { + "hash": "0x267913cb9b2f97565330654c20df05ab23a6e3f54b1c2593ab5896df8de04943", + "blockNumber": 13003970, + "txIdx": 22 + }, + { + "hash": "0x865485b37abb0fb719aa8f8bf680b1b32ffb8b9699df7460a6ae1ba2dfe3a812", + "blockNumber": 13003778, + "txIdx": 11 + }, + { + "hash": "0x9a3b21f036132c0c7c41c943ac9aae9acd1a68df4faa184982d1fb0680337a67", + "blockNumber": 13003330, + "txIdx": 16 + }, + { + "hash": "0xf52772b506e1f62bb358e0faca7b372ec9cbc49f201949cb90a2a05697c67029", + "blockNumber": 13003202, + "txIdx": 13 + }, + { + "hash": "0xe818044c5eed0a2d3569602492c31392198ed06f8f31e75651cc7f991dd3b9a6", + "blockNumber": 13002882, + "txIdx": 8 + }, + { + "hash": "0xda5a48889aa41a56bea368b530a75bb9f6962e20aab1750ecbcf482964c55516", + "blockNumber": 13002818, + "txIdx": 7 + }, + { + "hash": "0xefb66309ad7446604e0c8073f5f1cce9eabd687486e2b9a983fbc086b683b2ec", + "blockNumber": 13002690, + "txIdx": 18 + }, + { + "hash": "0x4f555d6552d612a73d84f246162bf70318a28cb4292eab49a70e7ac75e00e0bb", + "blockNumber": 13002434, + "txIdx": 24 + } + ], + "max": [ + { + "hash": "0x1454f2c6684f662c8396fa38869ba4c20cb8d2f59a6ac442176f614b2995ba7f", + "blockNumber": 13006428, + "txIdx": 5 + }, + { + "hash": "0x4474d7818ec14e0f0c78c5ed271e3544338d1c7242753dada189523b31a88a2d", + "blockNumber": 13005634, + "txIdx": 44 + }, + { + "hash": "0x0436874fb318c9851a9675660bb723f0e7e16b1ad65ba070544c90b1d73674a1", + "blockNumber": 13004546, + "txIdx": 41 + }, + { + "hash": "0x90d649b705c2c2205c64c7b6b56650b2f0114fcb13c4ed2bc6e64ab196e95194", + "blockNumber": 13003330, + "txIdx": 20 + }, + { + "hash": "0xd11fc15882205397ce42020770a5281b818c2fb625a207425904d3e3d01e9f81", + "blockNumber": 13002562, + "txIdx": 26 + }, + { + "hash": "0xc795f60b02b19beec6a925ca539115964739e534934af149680e2a8644279ef2", + "blockNumber": 13001474, + "txIdx": 26 + }, + { + "hash": "0xda174d3c29370acfaa1bef00f83e22b04434a184b3929e498bf6ed51a5fc3dec", + "blockNumber": 12999938, + "txIdx": 30 + }, + { + "hash": "0x299112d1b10bfe608b93d1fee3962500877f7e32b71f782cec2ce7f1084d72cc", + "blockNumber": 12999810, + "txIdx": 52 + }, + { + "hash": "0x062a300a34828043a786ea865ab77578c557b4801c9d78677afb7c9a107f2c4c", + "blockNumber": 12999618, + "txIdx": 39 + } + ], + "oversize": [ + { + "hash": "0xcfa53530c9f7e7fd276b68f7e588322d72e8df2741e99a9d7abdc37ee3b18beb", + "blockNumber": 13006338, + "txIdx": 79 + }, + { + "hash": "0x80310132384198bea49366fb99fc6f841a13b2f0c327940d37fc6f6b193b2c6f", + "blockNumber": 13005122, + "txIdx": 23 + }, + { + "hash": "0x1f7ec6ac92fb3d1f440b690f0c5a0f42c855c20c2ba21cf9d4e87013599734fc", + "blockNumber": 13004290, + "txIdx": 17 + }, + { + "hash": "0xaf662d6551f01f0531d7d76e349bbffc8aa5b89cd59c584b044b95193f140a6d", + "blockNumber": 13002882, + "txIdx": 13 + }, + { + "hash": "0xaa96fd4fda2933e681b3c0f41bcb1a43652b8b36dc6840d0c7cae4d33493a1aa", + "blockNumber": 13002882, + "txIdx": 32 + }, + { + "hash": "0x685bdd82cfc15364507b7af7dcf59d4aeb22241dd26f86e91d664b2432249a41", + "blockNumber": 13001538, + "txIdx": 26 + }, + { + "hash": "0xf647fe79f3d7aca30e571cef5e6e13f0c2e9c9a18cdb95f6779f9c37f2ccf7d6", + "blockNumber": 13000898, + "txIdx": 4 + }, + { + "hash": "0xd7e670da148ec0f5ff5d4e9e5b14ab93612322bae14a9d1bce5d20682172805d", + "blockNumber": 13000386, + "txIdx": 40 + }, + { + "hash": "0xf8ca5d353a1ed55d41667ac0b2fa45e8a6b9c593e77f48443f3589808fb7c7fc", + "blockNumber": 13000066, + "txIdx": 26 + }, + { + "hash": "0xbe9d3fe6494d73754684a51820af08bf66a436b7008b7600cd64fa15bf084233", + "blockNumber": 12998978, + "txIdx": 41 + } + ] + } + } +} \ No newline at end of file diff --git a/harness/test/chainData/84532.json b/harness/test/chainData/84532.json new file mode 100644 index 00000000..a247df36 --- /dev/null +++ b/harness/test/chainData/84532.json @@ -0,0 +1,1688 @@ +{ + "chainId": "84532", + "blockRange": { + "start": 8285121, + "end": 8411460 + }, + "blockSamples": 128, + "blockInterval": 64, + "account": { + "eoa": [ + { + "blockNumber": 8285121, + "address": "0xe76a90e3069c9d86e666dcc687e76fcecf4429cf" + }, + { + "blockNumber": 8411460, + "address": "0xba974928b5fa5aabcf2c6a9ad19ab05e5ce21c50" + }, + { + "blockNumber": 8411460, + "address": "0x96da0b6fc6c00e39f2a85d9ab0f36050c0c0b9fa" + }, + { + "blockNumber": 8411396, + "address": "0xe3f28530e5e977daf278735a34fdc76582b7c70a" + }, + { + "blockNumber": 8411396, + "address": "0xb582ddd13f2c58e692b06efa44fd7a36bb45257e" + }, + { + "blockNumber": 8411332, + "address": "0x73fc34ac01d9995247746f18466a4435459956cf" + }, + { + "blockNumber": 8411268, + "address": "0xdd20ca6c15e10e129b5edb89c181d356b493e318" + }, + { + "blockNumber": 8411204, + "address": "0x1eea3b7c68240596bbde880a82344b45f87a860c" + }, + { + "blockNumber": 8411076, + "address": "0xdc2323660d2c2b03769c0d3831a4399fc67e6d6f" + }, + { + "blockNumber": 8411076, + "address": "0x0ed9fdf230a4030b86bca600e2eeabee7057aa4b" + }, + { + "blockNumber": 8411012, + "address": "0xc5892b5639e7e04d094acebe6f756088ad53b657" + }, + { + "blockNumber": 8410884, + "address": "0x30403792e3f8ea0aef6753aef86c54e5dd83849c" + }, + { + "blockNumber": 8410820, + "address": "0x11fcee5a5bf2cb797998eca74453a70f45afb25c" + }, + { + "blockNumber": 8410820, + "address": "0x3b9b1fcdf8f3fe6720b05292a439369e2d195316" + }, + { + "blockNumber": 8410756, + "address": "0xd53eb5203e367bbdd4f72338938224881fc501ab" + }, + { + "blockNumber": 8410692, + "address": "0x78b5ec48629b2e24ac486e469172f704634647d0" + }, + { + "blockNumber": 8410628, + "address": "0x987a45873add2eced1199520bf0a0e7990d90832" + }, + { + "blockNumber": 8410628, + "address": "0x766fe03fadd1c839e1e90140f373ce34448fc405" + }, + { + "blockNumber": 8410564, + "address": "0x1666b63c44b734053889c8ff941c25b9933e65a3" + }, + { + "blockNumber": 8410500, + "address": "0xd53eb5203e367bbdd4f72338938224881fc501ab" + }, + { + "blockNumber": 8410436, + "address": "0xc5892b5639e7e04d094acebe6f756088ad53b657" + }, + { + "blockNumber": 8410308, + "address": "0xd53eb5203e367bbdd4f72338938224881fc501ab" + }, + { + "blockNumber": 8410244, + "address": "0x79a0fef0c227792a6c0702505ec017da2cc052ce" + }, + { + "blockNumber": 8410116, + "address": "0xd53eb5203e367bbdd4f72338938224881fc501ab" + }, + { + "blockNumber": 8409988, + "address": "0x791c7499ebdb775b0780eaa87f3e022adb20b594" + }, + { + "blockNumber": 8409860, + "address": "0x9a8ebfba816641fa47241e38c6038fb13a804dbc" + }, + { + "blockNumber": 8409668, + "address": "0xb07add166dc6f4f1858e161d33d6fea994bc0686" + }, + { + "blockNumber": 8409668, + "address": "0x1cec0875a45571034515613e525bd5c1e8c4975f" + }, + { + "blockNumber": 8409604, + "address": "0x3ccf39f73f7cdd121ddcb34ff36b1d673ca8da25" + }, + { + "blockNumber": 8409540, + "address": "0x73691d38dd985ab59a5041e0870fa5fd10549a37" + }, + { + "blockNumber": 8409412, + "address": "0x106657538ee4890c7be3622f3c627a86da1a1972" + }, + { + "blockNumber": 8409348, + "address": "0x771d78ecd8ade3a7a672331de9af6f28aefbe236" + } + ], + "contract": [ + { + "blockNumber": 8411204, + "address": "0x67dd9c63eb18e4a7dfacd5af67802b1cd11d4f0e" + }, + { + "blockNumber": 8410884, + "address": "0x94cc0aac535ccdb3c01d6787d6413c739ae12bc4" + }, + { + "blockNumber": 8410756, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8410692, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967" + }, + { + "blockNumber": 8410564, + "address": "0x94cc0aac535ccdb3c01d6787d6413c739ae12bc4" + }, + { + "blockNumber": 8410500, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8410308, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8410244, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967" + }, + { + "blockNumber": 8410116, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8409988, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967" + }, + { + "blockNumber": 8409540, + "address": "0x5911cdc73325d3fb3208b8d93ff44e0cfc3dc438" + }, + { + "blockNumber": 8409412, + "address": "0x916a6314e9d8e51beb18b355ad52b4506262620f" + }, + { + "blockNumber": 8409348, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967" + }, + { + "blockNumber": 8409284, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8409220, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8409156, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8409092, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8408900, + "address": "0x5911cdc73325d3fb3208b8d93ff44e0cfc3dc438" + }, + { + "blockNumber": 8408708, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8408644, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8408580, + "address": "0x23565f3acf64455d5611c37d0f5463de6fe55328" + }, + { + "blockNumber": 8408452, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8408324, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8408132, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8408004, + "address": "0xed8de012e6328bb2cd18c7a539be08da1319b711" + }, + { + "blockNumber": 8407940, + "address": "0x94cc0aac535ccdb3c01d6787d6413c739ae12bc4" + }, + { + "blockNumber": 8407812, + "address": "0xad91214effee446500940c764df77af18427294f" + }, + { + "blockNumber": 8407556, + "address": "0x5911cdc73325d3fb3208b8d93ff44e0cfc3dc438" + }, + { + "blockNumber": 8407428, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" + }, + { + "blockNumber": 8407300, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967" + }, + { + "blockNumber": 8407236, + "address": "0xfee7c8e229f538a98437b9a7d0dd8fcd8a1ab569" + }, + { + "blockNumber": 8407108, + "address": "0x2bdcdaca8838ee2400a2a49ded36340a9fbe408d" + } + ] + }, + "storage": { + "nonzero": [ + { + "blockNumber": 8285121, + "address": "0xde8d0f47a71ea3fdfbd3162271652f2847939097", + "slot": 3 + }, + { + "blockNumber": 8411460, + "address": "0x4c07eac4b12259845faf2a274d5eaef8fb9a2578", + "slot": 0 + }, + { + "blockNumber": 8411268, + "address": "0xb031f5f56639147c8f45dd546c58ea5db23901ac", + "slot": 10 + }, + { + "blockNumber": 8411204, + "address": "0x17c56e645329a4481aa9b32c3fc7bc28515c4d3e", + "slot": 0 + }, + { + "blockNumber": 8410948, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789", + "slot": 2 + }, + { + "blockNumber": 8410884, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967", + "slot": 10 + }, + { + "blockNumber": 8410500, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967", + "slot": 3 + }, + { + "blockNumber": 8410244, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967", + "slot": 10 + }, + { + "blockNumber": 8410116, + "address": "0xfb7a1fcc9a4447ec738bde137f28080caa4d7440", + "slot": 0 + }, + { + "blockNumber": 8409732, + "address": "0x5dccee0b347c9e4a316f78a59d40ed79bd965789", + "slot": 0 + }, + { + "blockNumber": 8409604, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789", + "slot": 2 + }, + { + "blockNumber": 8409540, + "address": "0x5911cdc73325d3fb3208b8d93ff44e0cfc3dc438", + "slot": 1 + }, + { + "blockNumber": 8409476, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789", + "slot": 2 + }, + { + "blockNumber": 8409412, + "address": "0x916a6314e9d8e51beb18b355ad52b4506262620f", + "slot": 0 + }, + { + "blockNumber": 8409156, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789", + "slot": 2 + }, + { + "blockNumber": 8409028, + "address": "0x5911cdc73325d3fb3208b8d93ff44e0cfc3dc438", + "slot": 1 + }, + { + "blockNumber": 8408196, + "address": "0xfee7c8e229f538a98437b9a7d0dd8fcd8a1ab569", + "slot": 4 + }, + { + "blockNumber": 8408132, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967", + "slot": 10 + }, + { + "blockNumber": 8408068, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789", + "slot": 2 + }, + { + "blockNumber": 8407300, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967", + "slot": 3 + }, + { + "blockNumber": 8407236, + "address": "0xfee7c8e229f538a98437b9a7d0dd8fcd8a1ab569", + "slot": 8 + }, + { + "blockNumber": 8407172, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967", + "slot": 10 + }, + { + "blockNumber": 8407044, + "address": "0xead908e40cc5f14ed2e1e9beb913a9c5846f4464", + "slot": 3 + }, + { + "blockNumber": 8406788, + "address": "0xb77eb4b4862dca31212555e25f8b5729b346e78a", + "slot": 2 + }, + { + "blockNumber": 8406724, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967", + "slot": 10 + }, + { + "blockNumber": 8406660, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967", + "slot": 3 + }, + { + "blockNumber": 8406596, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967", + "slot": 10 + }, + { + "blockNumber": 8406404, + "address": "0x5911cdc73325d3fb3208b8d93ff44e0cfc3dc438", + "slot": 1 + }, + { + "blockNumber": 8406276, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967", + "slot": 4 + }, + { + "blockNumber": 8406148, + "address": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789", + "slot": 2 + }, + { + "blockNumber": 8406084, + "address": "0xf01c4cdb85f5b3c18f9cfeddb1eeb75950439d63", + "slot": 2 + }, + { + "blockNumber": 8405892, + "address": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967", + "slot": 2 + } + ] + }, + "tx": { + "type": { + "0": [ + { + "hash": "0xc80b02f1ea20373a2e6d12f62f29fe4a00c96b4b689291376f527b17dd9ca714", + "blockNumber": 8410884, + "txIdx": 5 + }, + { + "hash": "0x13b728215ba8f1e709cb6313848ba60c976b9f2aeaad433316c8e1b6ade6791e", + "blockNumber": 8410628, + "txIdx": 2 + }, + { + "hash": "0xfbb24949b9cd50928240515e70a7b07f026cc7bcbb2d87a2cbf5db4a6a16c3c8", + "blockNumber": 8410052, + "txIdx": 2 + }, + { + "hash": "0xf159a94561db90e0b0438bd473ad3514906b9d522d555f054c7e4ddcd341f4bb", + "blockNumber": 8409412, + "txIdx": 6 + }, + { + "hash": "0xb3155b9a0cefc112f99e74391ff8c36aa9ab731ba36a01a0562455616a315cae", + "blockNumber": 8409412, + "txIdx": 8 + }, + { + "hash": "0xfdff53ee1ffa01d489c35ba38a7023ae180cc9a68bffde1d17341d653ddef291", + "blockNumber": 8409156, + "txIdx": 1 + }, + { + "hash": "0xf9b4632ca83b155fa07afc4ed85c31e1ecd6c5732b2c844c56b1208d37997f88", + "blockNumber": 8408772, + "txIdx": 2 + }, + { + "hash": "0x934194f70872b06051da1523ecbad3f1d23e2659b533ccfa334bf639be48f8f7", + "blockNumber": 8408068, + "txIdx": 17 + }, + { + "hash": "0xe8d21fc30d59b11a761391fb1fe50cc8d3f4cb7459395ebb7e1bc63413b9906f", + "blockNumber": 8407684, + "txIdx": 1 + }, + { + "hash": "0xb39c4eb437415c38d05c364afe80ea832c0db34d744a3326c1cff2d2dfcb57a8", + "blockNumber": 8407620, + "txIdx": 1 + }, + { + "hash": "0xeea485fbac3342408c9f4c592a14f536a79fae124e218a1e975eab0a74559c43", + "blockNumber": 8407620, + "txIdx": 2 + }, + { + "hash": "0x25c1091a2a976f68cfdda31957e66d8e39fa1274ace2b271ac8b123356ee3452", + "blockNumber": 8407172, + "txIdx": 7 + }, + { + "hash": "0x4fb1e82e9c8b1f6b730d6331d70476a1ba083e96cd3a49ae321c5e37105914e9", + "blockNumber": 8406788, + "txIdx": 7 + }, + { + "hash": "0x72b6b9e9c915eeeab4dfb2aee47a5aa3104f7200ee2e7a26433ad174ec9b0f2f", + "blockNumber": 8406532, + "txIdx": 4 + }, + { + "hash": "0x353ac206d808ccddd3264674e0c271334df0ea5ecc58f527043eb4561893a29b", + "blockNumber": 8406468, + "txIdx": 2 + }, + { + "hash": "0x922bad5bcb87eaa487325652647a46d6193ee847fb6413182ea17098294686c9", + "blockNumber": 8404676, + "txIdx": 3 + }, + { + "hash": "0x4888c7b7aed7d0bec69c43e841a35db2ef939257d63ad88012ae71d62f548653", + "blockNumber": 8404612, + "txIdx": 2 + }, + { + "hash": "0xf458ddebbd3a70f03fe30abc09f79bbe545c90af2af17b996f3d32e8a6cb1373", + "blockNumber": 8404356, + "txIdx": 3 + }, + { + "hash": "0x0b02fb591b378c3dc4f6b81be4d0122bb4d1cb9c736181b7564102973ffadc4a", + "blockNumber": 8403588, + "txIdx": 5 + } + ], + "1": [], + "2": [ + { + "hash": "0x7968dd03dac8d40f553194e3f8108654b7951a202afd4d9a8a5d73b9f79294b7", + "blockNumber": 8285121, + "txIdx": 1 + }, + { + "hash": "0x60e9f7675c3211e087ce719df5c6cd8d3a2c6f674093340fed3011f23321eea7", + "blockNumber": 8285121, + "txIdx": 2 + }, + { + "hash": "0x12209669f865c52d9566e3e261ad551eb5b81f1ddedffedfee7851cf3ca1f6af", + "blockNumber": 8285121, + "txIdx": 3 + }, + { + "hash": "0x02b960acc295fe8eaafce8987a35ffd9eba2b1df998892616d4f6b2f7c484bc5", + "blockNumber": 8285121, + "txIdx": 4 + }, + { + "hash": "0x590e0cbfd569dd700eff450f23b0cc982749f04878c3c90e8ef13af883216ada", + "blockNumber": 8285121, + "txIdx": 5 + }, + { + "hash": "0x78cf2fce981580be349dd9ecb0c18a59a190007a54e920cb475b63bb74081d64", + "blockNumber": 8285121, + "txIdx": 6 + }, + { + "hash": "0xf31896dafeeb0e42928994c25cb8902fd3eb2fd91884e2291fc1861fb0706f5b", + "blockNumber": 8285121, + "txIdx": 7 + }, + { + "hash": "0x7a3e38153c76ad881d0da708648969da14a44a1122397e415a7a334893d4001a", + "blockNumber": 8285121, + "txIdx": 8 + }, + { + "hash": "0xdc00cefcca51c91078099db6b9bda4aa7f8028705dd025f647607bb8ce8107bd", + "blockNumber": 8285121, + "txIdx": 9 + }, + { + "hash": "0xa07d2369ff0df1efc0df56be64d4f5f06040c85d9a794e0cdf8c1dea4c644e84", + "blockNumber": 8285121, + "txIdx": 10 + }, + { + "hash": "0x050953c898902a4af5d69e46b4881d7adbc70b0e2a5e1f5515ede60021e7c5f7", + "blockNumber": 8285121, + "txIdx": 11 + }, + { + "hash": "0x65149631d19fd546b872f089b63f84b37fe0d1ee4a37a35a807a08164b53b0e8", + "blockNumber": 8285121, + "txIdx": 12 + }, + { + "hash": "0x6994bdf13e7ecd0508c2179f12e8e1e72a2be92884c96bda3a49eb8aff5f1ee9", + "blockNumber": 8285121, + "txIdx": 13 + }, + { + "hash": "0xaa325ee442e3c7f82f89b4551b4537d08f042194c432850728f71d203a4a60fe", + "blockNumber": 8411460, + "txIdx": 1 + }, + { + "hash": "0x779a430bd4c7c98286bfb7bd9c7d88e0c701478805184eed100590d0e312edec", + "blockNumber": 8411460, + "txIdx": 2 + }, + { + "hash": "0xe0d49aa43a2e3fc3eb23d80516a765ae729befd118cc239f033d55ea5743e666", + "blockNumber": 8411460, + "txIdx": 3 + }, + { + "hash": "0xc4d2cf105d53547d604c28330303de52f2e0af2ba302b95a706da6defa203100", + "blockNumber": 8411460, + "txIdx": 4 + }, + { + "hash": "0x372910da9fedd710f1463b248c6b464ff929e5e7f8adfcac826e3ae5a5238cad", + "blockNumber": 8411460, + "txIdx": 5 + }, + { + "hash": "0x7af88fbb69cd0f8ce21c098bb47703ca754a6319d96584fbd17847647e1aea34", + "blockNumber": 8411460, + "txIdx": 6 + }, + { + "hash": "0xcbf64325aec722fd712cb9999230e01d93b06d7d918b59e27dc75d5768ce3233", + "blockNumber": 8411460, + "txIdx": 7 + }, + { + "hash": "0x271eb60e5035caefb8e3467c8254810e51b5f046075b9a011841c1363d85b57e", + "blockNumber": 8411460, + "txIdx": 8 + }, + { + "hash": "0x542ad4342f048b37efb23468faf6e990ea852ea4d5bd393b0f85ffcf464a5f9c", + "blockNumber": 8411460, + "txIdx": 9 + }, + { + "hash": "0xee02a2bef054900155e12515caa1b7ac9da2bb7c822225778546991bac2e0f42", + "blockNumber": 8411460, + "txIdx": 10 + }, + { + "hash": "0x8e883b8b03ccd5725506d3cfa1062f1dff7b367a701101581798d60a32a5f975", + "blockNumber": 8411460, + "txIdx": 11 + }, + { + "hash": "0x40263bf297637647f871fe6d9f40b9b02557971c68ff74f43cf2041e5df7d8a8", + "blockNumber": 8411460, + "txIdx": 12 + }, + { + "hash": "0x4675165ef6bc0d63547d5460229cf57a2be4fdc55ac58f61a8c414f41a46ff1c", + "blockNumber": 8411460, + "txIdx": 13 + }, + { + "hash": "0x5f51ff8b88691db75d983025f4b73f8adb77ab8aaef83d377fd00cd6a1e98b48", + "blockNumber": 8411460, + "txIdx": 14 + }, + { + "hash": "0x31c27f5b692607274010195b982ac561323f85d991fbda99ebf2171815bce092", + "blockNumber": 8411460, + "txIdx": 15 + }, + { + "hash": "0xb93ca94afa7cffaeb21e3f799c8a58d9f9ab7cf0cd738dcab50086211458d5db", + "blockNumber": 8411396, + "txIdx": 1 + }, + { + "hash": "0x905da2905ec4a55955522beffc054b489d9d42a56ef93123a5a5c94fd48b52dd", + "blockNumber": 8411396, + "txIdx": 2 + }, + { + "hash": "0xf10e116f5168d9365f1761bca31df65f2bcec597452aa666b736ca633ed9ff61", + "blockNumber": 8411396, + "txIdx": 3 + }, + { + "hash": "0x7533d40da23a43504af7c94800ddc54705668fd4f7046009923f898491e640f6", + "blockNumber": 8411396, + "txIdx": 4 + } + ], + "3": [] + }, + "category": { + "default": [ + { + "hash": "0x7968dd03dac8d40f553194e3f8108654b7951a202afd4d9a8a5d73b9f79294b7", + "blockNumber": 8285121, + "txIdx": 1 + }, + { + "hash": "0x02b960acc295fe8eaafce8987a35ffd9eba2b1df998892616d4f6b2f7c484bc5", + "blockNumber": 8285121, + "txIdx": 4 + }, + { + "hash": "0x590e0cbfd569dd700eff450f23b0cc982749f04878c3c90e8ef13af883216ada", + "blockNumber": 8285121, + "txIdx": 5 + }, + { + "hash": "0xf31896dafeeb0e42928994c25cb8902fd3eb2fd91884e2291fc1861fb0706f5b", + "blockNumber": 8285121, + "txIdx": 7 + }, + { + "hash": "0x7a3e38153c76ad881d0da708648969da14a44a1122397e415a7a334893d4001a", + "blockNumber": 8285121, + "txIdx": 8 + }, + { + "hash": "0xdc00cefcca51c91078099db6b9bda4aa7f8028705dd025f647607bb8ce8107bd", + "blockNumber": 8285121, + "txIdx": 9 + }, + { + "hash": "0xa07d2369ff0df1efc0df56be64d4f5f06040c85d9a794e0cdf8c1dea4c644e84", + "blockNumber": 8285121, + "txIdx": 10 + }, + { + "hash": "0x050953c898902a4af5d69e46b4881d7adbc70b0e2a5e1f5515ede60021e7c5f7", + "blockNumber": 8285121, + "txIdx": 11 + }, + { + "hash": "0x65149631d19fd546b872f089b63f84b37fe0d1ee4a37a35a807a08164b53b0e8", + "blockNumber": 8285121, + "txIdx": 12 + }, + { + "hash": "0x6994bdf13e7ecd0508c2179f12e8e1e72a2be92884c96bda3a49eb8aff5f1ee9", + "blockNumber": 8285121, + "txIdx": 13 + }, + { + "hash": "0xaa325ee442e3c7f82f89b4551b4537d08f042194c432850728f71d203a4a60fe", + "blockNumber": 8411460, + "txIdx": 1 + }, + { + "hash": "0x779a430bd4c7c98286bfb7bd9c7d88e0c701478805184eed100590d0e312edec", + "blockNumber": 8411460, + "txIdx": 2 + }, + { + "hash": "0xe0d49aa43a2e3fc3eb23d80516a765ae729befd118cc239f033d55ea5743e666", + "blockNumber": 8411460, + "txIdx": 3 + }, + { + "hash": "0xc4d2cf105d53547d604c28330303de52f2e0af2ba302b95a706da6defa203100", + "blockNumber": 8411460, + "txIdx": 4 + }, + { + "hash": "0x372910da9fedd710f1463b248c6b464ff929e5e7f8adfcac826e3ae5a5238cad", + "blockNumber": 8411460, + "txIdx": 5 + }, + { + "hash": "0x7af88fbb69cd0f8ce21c098bb47703ca754a6319d96584fbd17847647e1aea34", + "blockNumber": 8411460, + "txIdx": 6 + }, + { + "hash": "0xcbf64325aec722fd712cb9999230e01d93b06d7d918b59e27dc75d5768ce3233", + "blockNumber": 8411460, + "txIdx": 7 + }, + { + "hash": "0x271eb60e5035caefb8e3467c8254810e51b5f046075b9a011841c1363d85b57e", + "blockNumber": 8411460, + "txIdx": 8 + }, + { + "hash": "0x542ad4342f048b37efb23468faf6e990ea852ea4d5bd393b0f85ffcf464a5f9c", + "blockNumber": 8411460, + "txIdx": 9 + }, + { + "hash": "0xee02a2bef054900155e12515caa1b7ac9da2bb7c822225778546991bac2e0f42", + "blockNumber": 8411460, + "txIdx": 10 + }, + { + "hash": "0x8e883b8b03ccd5725506d3cfa1062f1dff7b367a701101581798d60a32a5f975", + "blockNumber": 8411460, + "txIdx": 11 + }, + { + "hash": "0x40263bf297637647f871fe6d9f40b9b02557971c68ff74f43cf2041e5df7d8a8", + "blockNumber": 8411460, + "txIdx": 12 + }, + { + "hash": "0x4675165ef6bc0d63547d5460229cf57a2be4fdc55ac58f61a8c414f41a46ff1c", + "blockNumber": 8411460, + "txIdx": 13 + }, + { + "hash": "0x5f51ff8b88691db75d983025f4b73f8adb77ab8aaef83d377fd00cd6a1e98b48", + "blockNumber": 8411460, + "txIdx": 14 + }, + { + "hash": "0x31c27f5b692607274010195b982ac561323f85d991fbda99ebf2171815bce092", + "blockNumber": 8411460, + "txIdx": 15 + }, + { + "hash": "0xb93ca94afa7cffaeb21e3f799c8a58d9f9ab7cf0cd738dcab50086211458d5db", + "blockNumber": 8411396, + "txIdx": 1 + }, + { + "hash": "0x905da2905ec4a55955522beffc054b489d9d42a56ef93123a5a5c94fd48b52dd", + "blockNumber": 8411396, + "txIdx": 2 + }, + { + "hash": "0xf10e116f5168d9365f1761bca31df65f2bcec597452aa666b736ca633ed9ff61", + "blockNumber": 8411396, + "txIdx": 3 + }, + { + "hash": "0x7533d40da23a43504af7c94800ddc54705668fd4f7046009923f898491e640f6", + "blockNumber": 8411396, + "txIdx": 4 + }, + { + "hash": "0x0b35d1e97a426a68520be4f5f0169347b9ae4cb754cf659e0935eb0ba9492f01", + "blockNumber": 8411396, + "txIdx": 5 + }, + { + "hash": "0x71d5588c5f474db0d3ef761cb8a1b5a32632d00d5ebd7a6ec96c3b5dd041a8ab", + "blockNumber": 8411396, + "txIdx": 6 + }, + { + "hash": "0x08c0c7970dba7ea90f910f0bbd33a6fe5bd387463c3da8665bdd126675fc1792", + "blockNumber": 8411332, + "txIdx": 1 + } + ], + "large": [ + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2 + }, + { + "hash": "0x5fb3c50a81953581658b79e2856b73f58648da666adaa84eff4afba7a949cb68", + "blockNumber": 8411268, + "txIdx": 4 + }, + { + "hash": "0x53ef2000baf21e5d40eb2bbe4a0cdefab0d087794052fc5ee79e37a71633d2b4", + "blockNumber": 8411140, + "txIdx": 4 + }, + { + "hash": "0x4ed454b9ba18f8bc4e74b70d31357753a082a5092de736f2efe73e43ef2ea6c3", + "blockNumber": 8410884, + "txIdx": 8 + }, + { + "hash": "0x7c3b1eece29e1a581a115571b3679b63d37308801990f4fb6b9f15111d47ae1c", + "blockNumber": 8410372, + "txIdx": 2 + }, + { + "hash": "0x274d5ecfc9e474cc7dc62971eddff6e66690fe4f866ba1dab85045b4c4331ec2", + "blockNumber": 8409988, + "txIdx": 7 + }, + { + "hash": "0xf0bb2877d9ddfa0fdb7e404a09b76a081ad1ec1797077fb4b05062509ddb59f3", + "blockNumber": 8409924, + "txIdx": 3 + }, + { + "hash": "0x058cda17022e8d27fe9cdc63748566f8b75a1261c04ecc73f83928d45931bfc1", + "blockNumber": 8409732, + "txIdx": 5 + }, + { + "hash": "0x292c2e380b83c3185982d010da100b32f4cb184b2e8ae82ad6e6becfdfbbd202", + "blockNumber": 8409668, + "txIdx": 5 + }, + { + "hash": "0xb4ccbe851bb76af1a5d4a9db4269e2f50b144d3c580794f9278f85e86825f9c2", + "blockNumber": 8409412, + "txIdx": 9 + }, + { + "hash": "0xcc2fedff27e726d4af40f31db1d63b638c715fef4457ba9299e15cd165038035", + "blockNumber": 8409348, + "txIdx": 3 + }, + { + "hash": "0x1dcdc7fb35fc8798f172e676e8f18b95022587a2984fcc7a9803d08fd78212c7", + "blockNumber": 8409220, + "txIdx": 3 + }, + { + "hash": "0xe3b639e75fa11e6d088ccf14383096841ffbbc206578b1bc9d0d89ef749cd7dc", + "blockNumber": 8408900, + "txIdx": 4 + }, + { + "hash": "0x749df4d3c9f558b81d564becbdefba7670ba8fd180758d5f41dd4963ff3e2471", + "blockNumber": 8408836, + "txIdx": 10 + }, + { + "hash": "0x381a1370ffb1403372462e105abcce7528be08e4769d5024c3a3044b358121bb", + "blockNumber": 8408580, + "txIdx": 5 + }, + { + "hash": "0xa32c4f636480748d97bbe57523e94d08ae72a0f895c15ac2123e4de6152d3fb0", + "blockNumber": 8408516, + "txIdx": 3 + }, + { + "hash": "0xdb04c9f9e93c3ad4616a1a93d769276fe9c8a000a0afe77bc37dc052a6faf0cd", + "blockNumber": 8408388, + "txIdx": 3 + }, + { + "hash": "0x52224ab58dff929b8cdd3f8738278c42c672abdb49e66e865258f0ccb381063f", + "blockNumber": 8408324, + "txIdx": 3 + }, + { + "hash": "0x93537756d98226f95abf593370793dfc971ac1c4a3531ea3908bfea051ead00f", + "blockNumber": 8408132, + "txIdx": 6 + }, + { + "hash": "0x7b77a283a50b28ee31a89881c36afde70c571688b0d84cfceae0e41a5a18f589", + "blockNumber": 8408068, + "txIdx": 18 + }, + { + "hash": "0x40d00bbdb3ca243b137d2344bdd6281eb506ff24039b75713b284af4ab852033", + "blockNumber": 8407748, + "txIdx": 3 + }, + { + "hash": "0x25dd0809b91b4009b6d778857d79a6b351754f1f0421928f10acaecd0a621b89", + "blockNumber": 8407684, + "txIdx": 3 + }, + { + "hash": "0x0eefbd2a5b87d1b5d1f5e77a0276e326a32652ddc8d6504d419d930bf57af999", + "blockNumber": 8407556, + "txIdx": 4 + }, + { + "hash": "0x7f65dcd22b43892f7e4a02bd002b2ce5ee60c7826b9736031d6a88096ce20eaf", + "blockNumber": 8407492, + "txIdx": 5 + }, + { + "hash": "0x49a42297f49bb9a8fa0cd95df974ff899168a8cce95315e762d11847d6c965f7", + "blockNumber": 8407428, + "txIdx": 2 + }, + { + "hash": "0x2a093e20cc80b405dd2e2fa05e1ecc1cb9a4c23047ae76322e7b39a88603e24b", + "blockNumber": 8407236, + "txIdx": 3 + }, + { + "hash": "0xd6827fe4746a09be90e805e11f734a3ab1534416194e959a74926467285e8e44", + "blockNumber": 8406980, + "txIdx": 2 + }, + { + "hash": "0x766429aea09f82c69f6f40b8c839edd64d5030719ce78d01ab101a6b2519116e", + "blockNumber": 8406660, + "txIdx": 3 + }, + { + "hash": "0x1e481b5ee6915c79d4b5817a64b2b3ab8ca51104fdeb3b074912d217038a870c", + "blockNumber": 8406212, + "txIdx": 3 + }, + { + "hash": "0x89ba54fee308a984468ede310c68bfee46c3141e62fddee4540f3065aacbcd71", + "blockNumber": 8406084, + "txIdx": 5 + }, + { + "hash": "0xc2b0e8f370c5dee3478be3dce95e84ae8a0da8ea970ebcc141ac3a6f4e9d2b98", + "blockNumber": 8406020, + "txIdx": 1 + }, + { + "hash": "0x53c1d114329a2856046aa37aa2eed8c9fb49f6412b31d9a0aab7ea2376c34964", + "blockNumber": 8405380, + "txIdx": 3 + } + ], + "max": [ + { + "hash": "0x60e9f7675c3211e087ce719df5c6cd8d3a2c6f674093340fed3011f23321eea7", + "blockNumber": 8285121, + "txIdx": 2 + }, + { + "hash": "0x12209669f865c52d9566e3e261ad551eb5b81f1ddedffedfee7851cf3ca1f6af", + "blockNumber": 8285121, + "txIdx": 3 + }, + { + "hash": "0x78cf2fce981580be349dd9ecb0c18a59a190007a54e920cb475b63bb74081d64", + "blockNumber": 8285121, + "txIdx": 6 + }, + { + "hash": "0xfbb24949b9cd50928240515e70a7b07f026cc7bcbb2d87a2cbf5db4a6a16c3c8", + "blockNumber": 8410052, + "txIdx": 2 + }, + { + "hash": "0x934194f70872b06051da1523ecbad3f1d23e2659b533ccfa334bf639be48f8f7", + "blockNumber": 8408068, + "txIdx": 17 + }, + { + "hash": "0xeea485fbac3342408c9f4c592a14f536a79fae124e218a1e975eab0a74559c43", + "blockNumber": 8407620, + "txIdx": 2 + }, + { + "hash": "0x4fb1e82e9c8b1f6b730d6331d70476a1ba083e96cd3a49ae321c5e37105914e9", + "blockNumber": 8406788, + "txIdx": 7 + }, + { + "hash": "0x353ac206d808ccddd3264674e0c271334df0ea5ecc58f527043eb4561893a29b", + "blockNumber": 8406468, + "txIdx": 2 + } + ], + "oversize": [] + } + }, + "rc": { + "events": [ + { + "hash": "0x7a3e38153c76ad881d0da708648969da14a44a1122397e415a7a334893d4001a", + "blockNumber": 8285121, + "txIdx": 8, + "logIdx": 0, + "eventSchema": "0xa7aaf2512769da4e444e3de247be2564225c2e7a8f74cfe528e46e17d24868e2" + }, + { + "hash": "0x779a430bd4c7c98286bfb7bd9c7d88e0c701478805184eed100590d0e312edec", + "blockNumber": 8411460, + "txIdx": 2, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x779a430bd4c7c98286bfb7bd9c7d88e0c701478805184eed100590d0e312edec", + "blockNumber": 8411460, + "txIdx": 2, + "logIdx": 1, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x779a430bd4c7c98286bfb7bd9c7d88e0c701478805184eed100590d0e312edec", + "blockNumber": 8411460, + "txIdx": 2, + "logIdx": 2, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x779a430bd4c7c98286bfb7bd9c7d88e0c701478805184eed100590d0e312edec", + "blockNumber": 8411460, + "txIdx": 2, + "logIdx": 3, + "eventSchema": "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67" + }, + { + "hash": "0xb93ca94afa7cffaeb21e3f799c8a58d9f9ab7cf0cd738dcab50086211458d5db", + "blockNumber": 8411396, + "txIdx": 1, + "logIdx": 0, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 4, + "eventSchema": "0xd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 9, + "eventSchema": "0xd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 12, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 13, + "eventSchema": "0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 14, + "eventSchema": "0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 16, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 17, + "eventSchema": "0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 18, + "eventSchema": "0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 20, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 21, + "eventSchema": "0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 22, + "eventSchema": "0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 24, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 25, + "eventSchema": "0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 26, + "eventSchema": "0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 28, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 29, + "eventSchema": "0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 30, + "eventSchema": "0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 32, + "eventSchema": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 33, + "eventSchema": "0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 34, + "eventSchema": "0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 36, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 37, + "eventSchema": "0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e" + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2, + "logIdx": 38, + "eventSchema": "0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f" + }, + { + "hash": "0x5fb3c50a81953581658b79e2856b73f58648da666adaa84eff4afba7a949cb68", + "blockNumber": 8411268, + "txIdx": 4, + "logIdx": 4, + "eventSchema": "0xd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d" + }, + { + "hash": "0x5fb3c50a81953581658b79e2856b73f58648da666adaa84eff4afba7a949cb68", + "blockNumber": 8411268, + "txIdx": 4, + "logIdx": 7, + "eventSchema": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "hash": "0x5fb3c50a81953581658b79e2856b73f58648da666adaa84eff4afba7a949cb68", + "blockNumber": 8411268, + "txIdx": 4, + "logIdx": 8, + "eventSchema": "0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e" + } + ], + "category": { + "default": [ + { + "hash": "0x60e9f7675c3211e087ce719df5c6cd8d3a2c6f674093340fed3011f23321eea7", + "blockNumber": 8285121, + "txIdx": 2 + }, + { + "hash": "0x12209669f865c52d9566e3e261ad551eb5b81f1ddedffedfee7851cf3ca1f6af", + "blockNumber": 8285121, + "txIdx": 3 + }, + { + "hash": "0x7a3e38153c76ad881d0da708648969da14a44a1122397e415a7a334893d4001a", + "blockNumber": 8285121, + "txIdx": 8 + }, + { + "hash": "0xdc00cefcca51c91078099db6b9bda4aa7f8028705dd025f647607bb8ce8107bd", + "blockNumber": 8285121, + "txIdx": 9 + }, + { + "hash": "0x779a430bd4c7c98286bfb7bd9c7d88e0c701478805184eed100590d0e312edec", + "blockNumber": 8411460, + "txIdx": 2 + }, + { + "hash": "0xee02a2bef054900155e12515caa1b7ac9da2bb7c822225778546991bac2e0f42", + "blockNumber": 8411460, + "txIdx": 10 + }, + { + "hash": "0x5f51ff8b88691db75d983025f4b73f8adb77ab8aaef83d377fd00cd6a1e98b48", + "blockNumber": 8411460, + "txIdx": 14 + }, + { + "hash": "0x31c27f5b692607274010195b982ac561323f85d991fbda99ebf2171815bce092", + "blockNumber": 8411460, + "txIdx": 15 + }, + { + "hash": "0xb93ca94afa7cffaeb21e3f799c8a58d9f9ab7cf0cd738dcab50086211458d5db", + "blockNumber": 8411396, + "txIdx": 1 + }, + { + "hash": "0x7533d40da23a43504af7c94800ddc54705668fd4f7046009923f898491e640f6", + "blockNumber": 8411396, + "txIdx": 4 + }, + { + "hash": "0x71d5588c5f474db0d3ef761cb8a1b5a32632d00d5ebd7a6ec96c3b5dd041a8ab", + "blockNumber": 8411396, + "txIdx": 6 + }, + { + "hash": "0x25b73040612cb3cce1ed3be26203792188021a53b4c0472d40f6d230ebc7a8e8", + "blockNumber": 8411268, + "txIdx": 2 + }, + { + "hash": "0x2de96342d4c180f3537e31600b414325231f27037052c469a091f04d77db2254", + "blockNumber": 8411204, + "txIdx": 1 + }, + { + "hash": "0xfad7ecf74cca7ddc187426a4a4f77698e5ef6f003339baf8e9a4c0d368165dc6", + "blockNumber": 8411204, + "txIdx": 2 + }, + { + "hash": "0xd31422543dbf432e69e258d1b6fe23670ddaadcae1abc22b7f20e306041ffe1f", + "blockNumber": 8411140, + "txIdx": 1 + }, + { + "hash": "0x3d0253efe301921aafad4f9b60579dfc5f8eab268e6e00243921b4af4042569e", + "blockNumber": 8411140, + "txIdx": 3 + }, + { + "hash": "0xbd4db3ce06e711ca7be949f59155795828c7f3c0e97a91da527b8cdd5a190b2f", + "blockNumber": 8411076, + "txIdx": 10 + }, + { + "hash": "0x45817a23e18dcd4d03b2a6d8d5b2b21bc77c522cde0ca3572d3e13605ca8134f", + "blockNumber": 8410948, + "txIdx": 1 + }, + { + "hash": "0xd8970ca4db7746cb175617fb4d22820d73d191a5be8f53502be5be5b8dca479d", + "blockNumber": 8410948, + "txIdx": 2 + }, + { + "hash": "0x201328510d0fd2b5e62deea68c09e0a25f5c291d7a2aa0b8a374f4cc81c7b6ed", + "blockNumber": 8410948, + "txIdx": 3 + }, + { + "hash": "0x6722f0ec0d7543addf4a75c348fef7101ed179211358050570b2dc372011aa1e", + "blockNumber": 8410948, + "txIdx": 8 + }, + { + "hash": "0xff7c00034bd8f5e39033de90ebe070a5c3c0430e6864c4964983c9d37cfbb426", + "blockNumber": 8410884, + "txIdx": 1 + }, + { + "hash": "0xef938cf753b3e0f732be0e4c750fab3f557fe0c74224370619e6ad04a4b2338f", + "blockNumber": 8410884, + "txIdx": 2 + }, + { + "hash": "0xc99e0ae591d676d1ee0f07d2316f0ffb37e8165b3c02402bb257598732aad9de", + "blockNumber": 8410820, + "txIdx": 3 + }, + { + "hash": "0x20171b4d06ddcfb46268ae3a8450290fd185c9f9ac675c15889e3c55ec342785", + "blockNumber": 8410756, + "txIdx": 1 + }, + { + "hash": "0x1111de9c0dde56d1fc615789847bcc5a58dca786e788c399f8f84459069088fc", + "blockNumber": 8410756, + "txIdx": 4 + }, + { + "hash": "0xb8a77c6af1ac9177291a520c321c9bd994c2f0196c7b50fc6d844d5c037cabe0", + "blockNumber": 8410692, + "txIdx": 1 + }, + { + "hash": "0xa4b415c833a50b8bdc2dd55168c388816307f6b8a81fd0b03c09591f7a8d8801", + "blockNumber": 8410692, + "txIdx": 2 + }, + { + "hash": "0xa4393fa40bf34889161de9000b40389b0c53ec2400979a8a7e650a5e79280db3", + "blockNumber": 8410692, + "txIdx": 3 + }, + { + "hash": "0x8834f0a11d203c07ad7089f6284e36ce33efe51fab7dddf1d415fe332be342f5", + "blockNumber": 8410692, + "txIdx": 4 + }, + { + "hash": "0xfa8436f5a27b7ca46c4165e423879d06eba9724971158ebf447f53cbd09fab63", + "blockNumber": 8410628, + "txIdx": 3 + }, + { + "hash": "0x113ae7709aa24612220164f2898024831398a14737aa2d8f3a08248822c2ec09", + "blockNumber": 8410628, + "txIdx": 5 + } + ], + "medium": [ + { + "hash": "0x6994bdf13e7ecd0508c2179f12e8e1e72a2be92884c96bda3a49eb8aff5f1ee9", + "blockNumber": 8285121, + "txIdx": 13 + }, + { + "hash": "0x839738b025cc02a21c29dd50febfb77cfc9062f627ca435a6d4acd01d8c4af55", + "blockNumber": 8411332, + "txIdx": 2 + }, + { + "hash": "0x5fb3c50a81953581658b79e2856b73f58648da666adaa84eff4afba7a949cb68", + "blockNumber": 8411268, + "txIdx": 4 + }, + { + "hash": "0xf379fb4e13b0d01e89b00fb6bbf560d5b67ca980051ba8dc5b083645db435b08", + "blockNumber": 8411204, + "txIdx": 4 + }, + { + "hash": "0x53ef2000baf21e5d40eb2bbe4a0cdefab0d087794052fc5ee79e37a71633d2b4", + "blockNumber": 8411140, + "txIdx": 4 + }, + { + "hash": "0x9d5c8a26e62ef0fbe73dd164404dd8463e54e15811aca9201f7fd24d18ed8a2a", + "blockNumber": 8411012, + "txIdx": 3 + }, + { + "hash": "0x4ed454b9ba18f8bc4e74b70d31357753a082a5092de736f2efe73e43ef2ea6c3", + "blockNumber": 8410884, + "txIdx": 8 + }, + { + "hash": "0x7c3b1eece29e1a581a115571b3679b63d37308801990f4fb6b9f15111d47ae1c", + "blockNumber": 8410372, + "txIdx": 2 + }, + { + "hash": "0x1113bd661227886bda4fad983f0b41ebe88e12b6dc6d411080ea8a0a2fc0eee2", + "blockNumber": 8410308, + "txIdx": 1 + }, + { + "hash": "0x7faf9cf64b56acae4cea6b9522f297c4fe290eee068c8fcaceefb399a1f830af", + "blockNumber": 8410308, + "txIdx": 5 + }, + { + "hash": "0xab8b494951a67c9b1edf043b3765c26aea7da4802948e05bb6a2e791f8d3a5de", + "blockNumber": 8410180, + "txIdx": 4 + }, + { + "hash": "0x274d5ecfc9e474cc7dc62971eddff6e66690fe4f866ba1dab85045b4c4331ec2", + "blockNumber": 8409988, + "txIdx": 7 + }, + { + "hash": "0xf0bb2877d9ddfa0fdb7e404a09b76a081ad1ec1797077fb4b05062509ddb59f3", + "blockNumber": 8409924, + "txIdx": 3 + }, + { + "hash": "0x058cda17022e8d27fe9cdc63748566f8b75a1261c04ecc73f83928d45931bfc1", + "blockNumber": 8409732, + "txIdx": 5 + }, + { + "hash": "0x292c2e380b83c3185982d010da100b32f4cb184b2e8ae82ad6e6becfdfbbd202", + "blockNumber": 8409668, + "txIdx": 5 + }, + { + "hash": "0x2f3688c36e7d7493e415361c25650f46f09b054ae9d5300bbbfc8ec2312bb255", + "blockNumber": 8409476, + "txIdx": 2 + }, + { + "hash": "0xb4ccbe851bb76af1a5d4a9db4269e2f50b144d3c580794f9278f85e86825f9c2", + "blockNumber": 8409412, + "txIdx": 9 + }, + { + "hash": "0xcc2fedff27e726d4af40f31db1d63b638c715fef4457ba9299e15cd165038035", + "blockNumber": 8409348, + "txIdx": 3 + }, + { + "hash": "0x1dcdc7fb35fc8798f172e676e8f18b95022587a2984fcc7a9803d08fd78212c7", + "blockNumber": 8409220, + "txIdx": 3 + }, + { + "hash": "0xe4afc42f865b7f9d813e7552269da0fbc96370a83ef117c289c245c06fbe1a43", + "blockNumber": 8409156, + "txIdx": 2 + }, + { + "hash": "0x257fcba3e02d6a65bc16349b99e3b4cf06be2683e798bc259f73463d91671a83", + "blockNumber": 8409028, + "txIdx": 5 + }, + { + "hash": "0xe3b639e75fa11e6d088ccf14383096841ffbbc206578b1bc9d0d89ef749cd7dc", + "blockNumber": 8408900, + "txIdx": 4 + }, + { + "hash": "0x749df4d3c9f558b81d564becbdefba7670ba8fd180758d5f41dd4963ff3e2471", + "blockNumber": 8408836, + "txIdx": 10 + }, + { + "hash": "0xec8da83e3a629fbf755c0d67e64ef3a41e402ed8c2309969d45debe4ce7b6c12", + "blockNumber": 8408772, + "txIdx": 4 + }, + { + "hash": "0xeaa4c12aedefaaa5f13ca376f146c5ea59f2b6709ecfd08b333d549250a24f68", + "blockNumber": 8408644, + "txIdx": 4 + }, + { + "hash": "0x381a1370ffb1403372462e105abcce7528be08e4769d5024c3a3044b358121bb", + "blockNumber": 8408580, + "txIdx": 5 + }, + { + "hash": "0xa32c4f636480748d97bbe57523e94d08ae72a0f895c15ac2123e4de6152d3fb0", + "blockNumber": 8408516, + "txIdx": 3 + }, + { + "hash": "0xdb04c9f9e93c3ad4616a1a93d769276fe9c8a000a0afe77bc37dc052a6faf0cd", + "blockNumber": 8408388, + "txIdx": 3 + }, + { + "hash": "0x52224ab58dff929b8cdd3f8738278c42c672abdb49e66e865258f0ccb381063f", + "blockNumber": 8408324, + "txIdx": 3 + }, + { + "hash": "0xcc1c8aa6c14cd45d67d015465bc7c383bfbff6837d24edbf3bc3508392d57b34", + "blockNumber": 8408196, + "txIdx": 10 + }, + { + "hash": "0x93537756d98226f95abf593370793dfc971ac1c4a3531ea3908bfea051ead00f", + "blockNumber": 8408132, + "txIdx": 6 + }, + { + "hash": "0x7b77a283a50b28ee31a89881c36afde70c571688b0d84cfceae0e41a5a18f589", + "blockNumber": 8408068, + "txIdx": 18 + } + ], + "large": [ + { + "hash": "0x02b960acc295fe8eaafce8987a35ffd9eba2b1df998892616d4f6b2f7c484bc5", + "blockNumber": 8285121, + "txIdx": 4 + }, + { + "hash": "0x2e94b905987a9f78620657a8a32bd3073bed5b835d549ce90fbf12dd43a4aa99", + "blockNumber": 8410244, + "txIdx": 4 + }, + { + "hash": "0x5e4edd0f6596acec67a3a9979f1c20c0fd67c68e669782ed97553ae27f58495b", + "blockNumber": 8408004, + "txIdx": 3 + }, + { + "hash": "0x79f8a5f7075e02f9672321a8f602f041683accaa07462136317e38257c204f1b", + "blockNumber": 8404548, + "txIdx": 6 + }, + { + "hash": "0x6d5ccd4809c68cb6c4bb0cc7e9f2936990aa53a598c99e58a137a98ddb117409", + "blockNumber": 8403716, + "txIdx": 7 + } + ], + "max": [ + { + "hash": "0x590e0cbfd569dd700eff450f23b0cc982749f04878c3c90e8ef13af883216ada", + "blockNumber": 8285121, + "txIdx": 5 + }, + { + "hash": "0xfbb24949b9cd50928240515e70a7b07f026cc7bcbb2d87a2cbf5db4a6a16c3c8", + "blockNumber": 8410052, + "txIdx": 2 + }, + { + "hash": "0x934194f70872b06051da1523ecbad3f1d23e2659b533ccfa334bf639be48f8f7", + "blockNumber": 8408068, + "txIdx": 17 + }, + { + "hash": "0xeea485fbac3342408c9f4c592a14f536a79fae124e218a1e975eab0a74559c43", + "blockNumber": 8407620, + "txIdx": 2 + }, + { + "hash": "0x4fb1e82e9c8b1f6b730d6331d70476a1ba083e96cd3a49ae321c5e37105914e9", + "blockNumber": 8406788, + "txIdx": 7 + }, + { + "hash": "0x353ac206d808ccddd3264674e0c271334df0ea5ecc58f527043eb4561893a29b", + "blockNumber": 8406468, + "txIdx": 2 + }, + { + "hash": "0x7d31b9520c2e067a0b6972579731315beb7956055ce862048a180b55620721a5", + "blockNumber": 8405060, + "txIdx": 7 + } + ], + "oversize": [] + } + } +} \ No newline at end of file diff --git a/harness/test/chainData/84532/max30-1.defaultInputs.json b/harness/test/chainData/84532/max30-1.defaultInputs.json new file mode 100644 index 00000000..3a5c2713 --- /dev/null +++ b/harness/test/chainData/84532/max30-1.defaultInputs.json @@ -0,0 +1,11 @@ +{ + "blockNumber": 8411396, + "contract0": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789", + "storBlockNumber": 8410884, + "storAddress": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967", + "storSlot": 10, + "txBlockNumber": 8285121, + "txTxIdx": 5, + "rcBlockNumber": 8411460, + "rcTxIdx": 2 +} \ No newline at end of file diff --git a/harness/test/chainData/84532/max30-1.inputs.json b/harness/test/chainData/84532/max30-1.inputs.json new file mode 100644 index 00000000..a0795111 --- /dev/null +++ b/harness/test/chainData/84532/max30-1.inputs.json @@ -0,0 +1,11 @@ +{ + "blockNumber": 8411396, + "contract0": "0x17c56e645329a4481aa9b32c3fc7bc28515c4d3e", + "storBlockNumber": 8410948, + "storAddress": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789", + "storSlot": 2, + "txBlockNumber": 8285121, + "txTxIdx": 4, + "rcBlockNumber": 8411460, + "rcTxIdx": 2 +} \ No newline at end of file diff --git a/harness/test/chainData/84532/max30-2.defaultInputs.json b/harness/test/chainData/84532/max30-2.defaultInputs.json new file mode 100644 index 00000000..a05df01f --- /dev/null +++ b/harness/test/chainData/84532/max30-2.defaultInputs.json @@ -0,0 +1,9 @@ +{ + "blockNumber": 8411332, + "contractBlock": 8410884, + "contract": "0x87c51cd469a0e1e2af0e0e597fd88d9ae4baa967", + "txBlockNumber": 8410884, + "txTxIdx": 8, + "rcBlockNumber": 8411460, + "rcTxIdx": 2 +} \ No newline at end of file diff --git a/harness/test/chainData/84532/max30-2.inputs.json b/harness/test/chainData/84532/max30-2.inputs.json new file mode 100644 index 00000000..32133832 --- /dev/null +++ b/harness/test/chainData/84532/max30-2.inputs.json @@ -0,0 +1,9 @@ +{ + "blockNumber": 8411396, + "contractBlock": 8410948, + "contract": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789", + "txBlockNumber": 8411140, + "txTxIdx": 4, + "rcBlockNumber": 8411460, + "rcTxIdx": 2 +} \ No newline at end of file diff --git a/harness/test/chainData/84532/simple.defaultInputs.json b/harness/test/chainData/84532/simple.defaultInputs.json new file mode 100644 index 00000000..33a91b84 --- /dev/null +++ b/harness/test/chainData/84532/simple.defaultInputs.json @@ -0,0 +1,8 @@ +{ + "blockNumber": 8410884, + "addr": "0x916a6314e9d8e51beb18b355ad52b4506262620f", + "txBlockNumber": 8285121, + "txTxIdx": 8, + "rcBlockNumber": 8411332, + "rcTxIdx": 2 +} \ No newline at end of file diff --git a/harness/test/chainData/84532/simple.inputs.json b/harness/test/chainData/84532/simple.inputs.json new file mode 100644 index 00000000..90c1b46f --- /dev/null +++ b/harness/test/chainData/84532/simple.inputs.json @@ -0,0 +1,8 @@ +{ + "blockNumber": 8411012, + "addr": "0x5911cdc73325d3fb3208b8d93ff44e0cfc3dc438", + "txBlockNumber": 8285121, + "txTxIdx": 7, + "rcBlockNumber": 8411332, + "rcTxIdx": 2 +} \ No newline at end of file diff --git a/harness/test/chainData/84532/simpleWithCapacity.defaultInputs.json b/harness/test/chainData/84532/simpleWithCapacity.defaultInputs.json new file mode 100644 index 00000000..33a91b84 --- /dev/null +++ b/harness/test/chainData/84532/simpleWithCapacity.defaultInputs.json @@ -0,0 +1,8 @@ +{ + "blockNumber": 8410884, + "addr": "0x916a6314e9d8e51beb18b355ad52b4506262620f", + "txBlockNumber": 8285121, + "txTxIdx": 8, + "rcBlockNumber": 8411332, + "rcTxIdx": 2 +} \ No newline at end of file diff --git a/harness/test/chainData/84532/simpleWithCapacity.inputs.json b/harness/test/chainData/84532/simpleWithCapacity.inputs.json new file mode 100644 index 00000000..90c1b46f --- /dev/null +++ b/harness/test/chainData/84532/simpleWithCapacity.inputs.json @@ -0,0 +1,8 @@ +{ + "blockNumber": 8411012, + "addr": "0x5911cdc73325d3fb3208b8d93ff44e0cfc3dc438", + "txBlockNumber": 8285121, + "txTxIdx": 7, + "rcBlockNumber": 8411332, + "rcTxIdx": 2 +} \ No newline at end of file diff --git a/harness/test/chainData/84532/size129Header.defaultInputs.json b/harness/test/chainData/84532/size129Header.defaultInputs.json new file mode 100644 index 00000000..806ab180 --- /dev/null +++ b/harness/test/chainData/84532/size129Header.defaultInputs.json @@ -0,0 +1,3 @@ +{ + "blockNumber": 8411460 +} \ No newline at end of file diff --git a/harness/test/chainData/84532/size129Header.inputs.json b/harness/test/chainData/84532/size129Header.inputs.json new file mode 100644 index 00000000..806ab180 --- /dev/null +++ b/harness/test/chainData/84532/size129Header.inputs.json @@ -0,0 +1,3 @@ +{ + "blockNumber": 8411460 +} \ No newline at end of file diff --git a/harness/test/circuits/goerli/input/account/7_balance.js b/harness/test/circuits/goerli/input/account/7_balance.js deleted file mode 100644 index 463eedad..00000000 --- a/harness/test/circuits/goerli/input/account/7_balance.js +++ /dev/null @@ -1,10 +0,0 @@ -for (let i = 0; i < 7; i++) { - const acct = getAccount(add(claimedBlockNumber, i), address); - const balance = await acct.balance(); - addToCallback(balance); -} - -const input = { - address: "0x897dDbe14c9C7736EbfDC58461355697FbF70048", - claimedBlockNumber: 9173677, -}; diff --git a/harness/test/circuits/goerli/input/account/7_different_account_balance.js b/harness/test/circuits/goerli/input/account/7_different_account_balance.js deleted file mode 100644 index 100a2867..00000000 --- a/harness/test/circuits/goerli/input/account/7_different_account_balance.js +++ /dev/null @@ -1,5 +0,0 @@ -const blockNumber = constant(1000000); -for (let i = 0; i < 7; i++) { - const acct = getAccount(blockNumber, "0x" + i.toString(16)); - addToCallback(await acct.balance()); -} diff --git a/harness/test/circuits/goerli/input/combo/default.js b/harness/test/circuits/goerli/input/combo/default.js deleted file mode 100644 index 7ddbda8b..00000000 --- a/harness/test/circuits/goerli/input/combo/default.js +++ /dev/null @@ -1,97 +0,0 @@ -// -// _ _____ ______ _____ _ -// /\ (_) | __ \| ____| __ \| | -// / \ __ ___ ___ _ __ ___ | |__) | |__ | |__) | | -// / /\ \ \ \/ / |/ _ \| '_ ` _ \| _ /| __| | ___/| | -// / ____ \ > <| | (_) | | | | | | | \ \| |____| | | |____ -// /_/ \_\/_/\_\_|\___/|_| |_| |_|_| \_\______|_| |______| -// -// - -// example Axiom REPL circuit to prove the first block an account transacted -// get the previous block number -const prevBlock = sub(claimedBlockNumber, constant(1)); - -//get the account at the previous block -const accountPrevBlock = getAccount(prevBlock, address); - -// get the account nonce at the previous block and assert that it is 0 -const prevNonce = (await accountPrevBlock.nonce()).toCircuitValue(); -checkEqual(prevNonce, constant(0)) - -// get the account nonce at the claimed block number -const account = getAccount(claimedBlockNumber, address); -const currNonce = (await account.nonce()).toCircuitValue(); - -//checks that currNonce > 0 at the claimed block -checkLessThan(constant(0), currNonce) - -// add the address and blockNumber to the callback, for it to be passed -// as a result to the callback client contract -addToCallback(address) -addToCallback(claimedBlockNumber); - -// Here is a list of all functions you can use to fetch on-chain data in the REPL. -// For more detailed docs and a list of all data and compute functions, see our -// preview docs at: -// -// https://docs.axiom.xyz/sdk-and-repl-reference/axiomrepl-reference -// - -// fetch block header data -let header = getHeader(block); -// access the timestamp field -let timestamp = await header.timestamp(); -// access the gasLimit field -let gasLimit = await header.gasLimit(); - -// fetch account data -let acct = getAccount(block, addr); -// access the account balance at `block` -let balance = await acct.balance(); -// access the nonce of the account at `block` -let nonce = await acct.nonce(); - -// fetch storage data -let storage = getStorage(block, addr); -// access the value at storage slot `slot` -let slotVal = await storage.slot(slot); - -// fetch Solidity mapping data -let mapping = getSolidityMapping(block, addr, mappingSlot); -// access the value in the mapping at `mappingSlot` with key `3` -let mappingVal = await mapping.key(3); - -// fetch transaction data, example is for the transaction below: -// https://goerli.etherscan.io/tx/0xa4f781ad033d6dab5b13e3ab7c7cbdbd0ea4c0a2be3d9ffa7ed1e53d2d5bcc46 -let tx = getTx(txBlockNumber, txIdx); -// get the 4-byte function selector that was called -let functionSelector = await tx.functionSelector(); -// access bytes [32, 64) of calldata -let calldata = await tx.calldata(1); - -// fetch receipt data, example is for the first event log in the transaction below -// Deposit (index_topic_1 address payor, uint256 amt) -// https://goerli.etherscan.io/tx/0xa4f781ad033d6dab5b13e3ab7c7cbdbd0ea4c0a2be3d9ffa7ed1e53d2d5bcc46 -// eventSchema = keccak(Deposit(address,uint256)) -const eventSchema = "0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"; -let receipt = getReceipt(txBlockNumber, txIdx); -// access the address that emitted the log event at index 0 -let logAddr = await receipt.log(0).address(); -// access the topic at index 1 of the log event at index 0 and check it has schema eventSchema -// because `address` is indexed in the event, this corresponds to `address` -let topic = await receipt.log(0).topic(1, eventSchema); -// access the first 32 bytes of data in the log event at index 0 -// because `amt` is not indexed, this corresponds to `amt` -let data = await receipt.log(0).data(0); - -const input = { - address: "0x897dDbe14c9C7736EbfDC58461355697FbF70048", - claimedBlockNumber: 9173677, - block: 9730000, - addr: "0x8dde5d4a8384f403f888e1419672d94c570440c9", - txBlockNumber: 9728956, - txIdx: 10, - slot: 2, - mappingSlot: 1 -} \ No newline at end of file diff --git a/harness/test/circuits/goerli/input/combo/max(128).js b/harness/test/circuits/goerli/input/combo/max(128).js deleted file mode 100644 index e796b7f1..00000000 --- a/harness/test/circuits/goerli/input/combo/max(128).js +++ /dev/null @@ -1,34 +0,0 @@ -for (let i = 0; i < 32; i++) { - let tx = getReceipt(9000050 + i, 0); - addToCallback(await tx.status()); -} - -for (let i = 0; i < 16; i++) { - let tx = getTx(9000000 + i, 10 + i); - addToCallback(await tx.r()); -} -for (let i = 0; i < 16; i++) { - let tx = getTx(10000000, i); - addToCallback((await tx.type()).toCircuitValue()); -} - -for (let i = 0; i < 16; i++) { - let mapping = getSolidityMapping(9730000 + i, "0x8dde5d4a8384f403f888e1419672d94c570440c9", 1); - addToCallback(await mapping.key(2)); -} - -const blockNumber = constant(5000000); -for (let i = 0; i < 8; i++) { - const acct = getStorage(add(blockNumber, i), "0xc76531Bb08e8E266E4eB8a988D314AA6650292af"); - addToCallback(await acct.slot(i)); -} - -for (let i = 0; i < 8; i++) { - const acct = getAccount(6000000 + i, "0xeD64bC9802B1e86b94f5E78Cc100827431AcD732"); - addToCallback((await acct.nonce()).toCircuitValue()); -} - -for (let i = 0; i < 32; i++) { - const header = getHeader(add(9173677, i)); - addToCallback(await header.stateRoot()); -} diff --git a/harness/test/circuits/goerli/input/combo/max(30)#2.js b/harness/test/circuits/goerli/input/combo/max(30)#2.js deleted file mode 100644 index 35e276cc..00000000 --- a/harness/test/circuits/goerli/input/combo/max(30)#2.js +++ /dev/null @@ -1,25 +0,0 @@ -for (let i = 0; i < 8; i++) { - let tx = getReceipt(9000050 + i, i); - addToCallback(await tx.cumulativeGas()); -} - -for (let i = 0; i < 8; i++) { - let tx = getTx(9000000 + i, 10 + i); - addToCallback(await tx.r()); -} - -for (let i = 0; i < 3; i++) { - let mapping = getSolidityMapping(9730000 + i, "0x8dde5d4a8384f403f888e1419672d94c570440c9", 1); - addToCallback(await mapping.key(2)); -} - -const blockNumber = constant(5000000); -for (let i = 0; i < 3; i++) { - const acct = getStorage(add(blockNumber, i), "0xc76531Bb08e8E266E4eB8a988D314AA6650292af"); - addToCallback(await acct.slot(i)); -} - -for (let i = 0; i < 8; i++) { - const header = getHeader(add(9173677, i)); - addToCallback(await header.stateRoot()); -} diff --git a/harness/test/circuits/goerli/input/combo/max(30)#3.js b/harness/test/circuits/goerli/input/combo/max(30)#3.js deleted file mode 100644 index eb4c983b..00000000 --- a/harness/test/circuits/goerli/input/combo/max(30)#3.js +++ /dev/null @@ -1,19 +0,0 @@ -for (let i = 0; i < 8; i++) { - let tx = getReceipt(9000050 + i, i); - addToCallback(await tx.cumulativeGas()); -} - -for (let i = 0; i < 8; i++) { - let tx = getTx(9000000 + i, 10 + i); - addToCallback(await tx.r()); -} - -for (let i = 0; i < 7; i++) { - let mapping = getSolidityMapping(9730000 + i, "0x8dde5d4a8384f403f888e1419672d94c570440c9", 1); - addToCallback(await mapping.key(2)); -} - -for (let i = 0; i < 7; i++) { - const header = getHeader(add(9173677, i)); - addToCallback(await header.stateRoot()); -} diff --git a/harness/test/circuits/goerli/input/combo/max(30).js b/harness/test/circuits/goerli/input/combo/max(30).js deleted file mode 100644 index 91dfad9c..00000000 --- a/harness/test/circuits/goerli/input/combo/max(30).js +++ /dev/null @@ -1,25 +0,0 @@ -for (let i = 0; i < 8; i++) { - let tx = getReceipt(9000050 + i, i); - addToCallback(await tx.cumulativeGas()); -} - -for (let i = 0; i < 8; i++) { - let tx = getTx(9000000 + i, 10 + i); - addToCallback(await tx.r()); -} - -for (let i = 0; i < 4; i++) { - let mapping = getSolidityMapping(9730000 + i, "0x8dde5d4a8384f403f888e1419672d94c570440c9", 1); - addToCallback(await mapping.key(2)); -} - -const blockNumber = constant(5000000); -for (let i = 0; i < 3; i++) { - const acct = getStorage(add(blockNumber, i), "0xc76531Bb08e8E266E4eB8a988D314AA6650292af"); - addToCallback(await acct.slot(i)); -} - -for (let i = 0; i < 7; i++) { - const header = getHeader(add(9173677, i)); - addToCallback(await header.stateRoot()); -} diff --git a/harness/test/circuits/goerli/input/combo/receipt+tx+mapping+storage.js b/harness/test/circuits/goerli/input/combo/receipt+tx+mapping+storage.js deleted file mode 100644 index fe1008e1..00000000 --- a/harness/test/circuits/goerli/input/combo/receipt+tx+mapping+storage.js +++ /dev/null @@ -1,20 +0,0 @@ -for (let i = 0; i < 8; i++) { - let tx = getReceipt(9000050 + i, i); - addToCallback(await tx.cumulativeGas()); -} - -for (let i = 0; i < 8; i++) { - let tx = getTx(9000000 + i, 10 + i); - addToCallback(await tx.r()); -} - -for (let i = 0; i < 4; i++) { - let mapping = getSolidityMapping(9730000 + i, "0x8dde5d4a8384f403f888e1419672d94c570440c9", 1); - addToCallback(await mapping.key(2)); -} - -const blockNumber = constant(5000000); -for (let i = 0; i < 3; i++) { - const acct = getStorage(add(blockNumber, i), "0xc76531Bb08e8E266E4eB8a988D314AA6650292af"); - addToCallback(await acct.slot(i)); -} diff --git a/harness/test/circuits/goerli/input/combo/receipt+tx+mapping.js b/harness/test/circuits/goerli/input/combo/receipt+tx+mapping.js deleted file mode 100644 index 940af1e5..00000000 --- a/harness/test/circuits/goerli/input/combo/receipt+tx+mapping.js +++ /dev/null @@ -1,14 +0,0 @@ -for (let i = 0; i < 8; i++) { - let tx = getReceipt(9000050 + i, i); - addToCallback(await tx.cumulativeGas()); -} - -for (let i = 0; i < 8; i++) { - let tx = getTx(9000000 + i, 10 + i); - addToCallback(await tx.r()); -} - -for (let i = 0; i < 7; i++) { - let mapping = getSolidityMapping(9730000 + i, "0x8dde5d4a8384f403f888e1419672d94c570440c9", 1); - addToCallback(await mapping.key(2)); -} diff --git a/harness/test/circuits/goerli/input/combo/receipt+tx.js b/harness/test/circuits/goerli/input/combo/receipt+tx.js deleted file mode 100644 index cedbaeb7..00000000 --- a/harness/test/circuits/goerli/input/combo/receipt+tx.js +++ /dev/null @@ -1,9 +0,0 @@ -for (let i = 0; i < 8; i++) { - let tx = getReceipt(9000050 + i, i); - addToCallback(await tx.cumulativeGas()); -} - -for (let i = 0; i < 8; i++) { - let tx = getTx(9000000 + i, 10 + i); - addToCallback(await tx.r()); -} diff --git a/harness/test/circuits/goerli/input/header/8_mixed.js b/harness/test/circuits/goerli/input/header/8_mixed.js deleted file mode 100644 index 1a9213d3..00000000 --- a/harness/test/circuits/goerli/input/header/8_mixed.js +++ /dev/null @@ -1,13 +0,0 @@ -const header = getHeader(claimedBlockNumber); -addToCallback(await header.baseFeePerGas()); -addToCallback(await header.difficulty()); -addToCallback(await header.extraData()); -addToCallback(await header.timestamp()); -addToCallback(await header.miner()); -addToCallback(await header.mixHash()); -addToCallback(await header.nonce()); -addToCallback(await header.mixHash()); - -const input = { - claimedBlockNumber: 9173677, -}; diff --git a/harness/test/circuits/goerli/input/header/8_state_root.js b/harness/test/circuits/goerli/input/header/8_state_root.js deleted file mode 100644 index 1b084c25..00000000 --- a/harness/test/circuits/goerli/input/header/8_state_root.js +++ /dev/null @@ -1,8 +0,0 @@ -for(let i=0; i<8; i++){ - const header = getHeader(add(9173677, i)); - addToCallback(await header.stateRoot()) -} - -const input = { - claimedBlockNumber: 9173677, -} \ No newline at end of file diff --git a/harness/test/circuits/goerli/input/mapping/different_blocks.js b/harness/test/circuits/goerli/input/mapping/different_blocks.js deleted file mode 100644 index 0cedc7b2..00000000 --- a/harness/test/circuits/goerli/input/mapping/different_blocks.js +++ /dev/null @@ -1,4 +0,0 @@ -for (let i = 0; i < 7; i++) { - let mapping = getSolidityMapping(9730000 + i, "0x8dde5d4a8384f403f888e1419672d94c570440c9", 1); - addToCallback(await mapping.key(2)); -} diff --git a/harness/test/circuits/goerli/input/mapping/different_keys.js b/harness/test/circuits/goerli/input/mapping/different_keys.js deleted file mode 100644 index 8486efd7..00000000 --- a/harness/test/circuits/goerli/input/mapping/different_keys.js +++ /dev/null @@ -1,4 +0,0 @@ -let mapping = getSolidityMapping(9730000, "0x8dde5d4a8384f403f888e1419672d94c570440c9", 1); -for (let i = 0; i < 7; i++) { - addToCallback(await mapping.key(i)); -} diff --git a/harness/test/circuits/goerli/input/receipt/diff_block.js b/harness/test/circuits/goerli/input/receipt/diff_block.js deleted file mode 100644 index e353c650..00000000 --- a/harness/test/circuits/goerli/input/receipt/diff_block.js +++ /dev/null @@ -1,4 +0,0 @@ -for (let i = 0; i < 8; i++) { - let tx = getReceipt(9000050 + i, i); - addToCallback(await tx.cumulativeGas()); -} diff --git a/harness/test/circuits/goerli/input/receipt/same_receipt_diff_fields.js b/harness/test/circuits/goerli/input/receipt/same_receipt_diff_fields.js deleted file mode 100644 index caac889b..00000000 --- a/harness/test/circuits/goerli/input/receipt/same_receipt_diff_fields.js +++ /dev/null @@ -1,7 +0,0 @@ -for (let i = 0; i < 2; i++) { - let tx = getReceipt(9000050 + i, i); - await tx.blockNumber(); - await tx.cumulativeGas(); - await tx.txIdx(); - await tx.status(); -} diff --git a/harness/test/circuits/goerli/input/storage/7_empty_slot.js b/harness/test/circuits/goerli/input/storage/7_empty_slot.js deleted file mode 100644 index 48d8c6b5..00000000 --- a/harness/test/circuits/goerli/input/storage/7_empty_slot.js +++ /dev/null @@ -1,5 +0,0 @@ -const blockNumber = 1000000; -for (let i = 0; i < 7; i++) { - const acct = getStorage(add(blockNumber, i), "0x" + i.toString(16)); - addToCallback(await acct.slot(i)); -} diff --git a/harness/test/circuits/goerli/input/storage/7_slots.js b/harness/test/circuits/goerli/input/storage/7_slots.js deleted file mode 100644 index 92a30c83..00000000 --- a/harness/test/circuits/goerli/input/storage/7_slots.js +++ /dev/null @@ -1,5 +0,0 @@ -const blockNumber = 5000000; -for (let i = 0; i < 7; i++) { - const acct = getStorage(add(blockNumber, i), "0xc76531Bb08e8E266E4eB8a988D314AA6650292af"); - addToCallback(await acct.slot(i)); -} diff --git a/harness/test/circuits/goerli/input/tx/diff_block_diff_tx.js b/harness/test/circuits/goerli/input/tx/diff_block_diff_tx.js deleted file mode 100644 index 116dec77..00000000 --- a/harness/test/circuits/goerli/input/tx/diff_block_diff_tx.js +++ /dev/null @@ -1,4 +0,0 @@ -for (let i = 0; i < 8; i++) { - let tx = getTx(9000000 + i, 10 + i); - addToCallback(await tx.r()); -} diff --git a/harness/test/circuits/goerli/input/tx/diff_block_diff_tx_legacy.js b/harness/test/circuits/goerli/input/tx/diff_block_diff_tx_legacy.js deleted file mode 100644 index 4cf419d4..00000000 --- a/harness/test/circuits/goerli/input/tx/diff_block_diff_tx_legacy.js +++ /dev/null @@ -1,4 +0,0 @@ -for (let i = 0; i < 8; i++) { - let tx = getTx(8000000 + i, i); // 8000001 is legacy tx - addToCallback(await tx.r()); -} diff --git a/harness/test/circuits/goerli/input/tx/same_block_diff_tx.js b/harness/test/circuits/goerli/input/tx/same_block_diff_tx.js deleted file mode 100644 index a8858df5..00000000 --- a/harness/test/circuits/goerli/input/tx/same_block_diff_tx.js +++ /dev/null @@ -1,4 +0,0 @@ -for (let i = 0; i < 8; i++) { - let tx = getTx(9000000, i); - addToCallback(await tx.r()); -} diff --git a/harness/test/circuits/sepolia/input/account/7_balance.js b/harness/test/circuits/sepolia/input/account/7_balance.js deleted file mode 100644 index c788acb7..00000000 --- a/harness/test/circuits/sepolia/input/account/7_balance.js +++ /dev/null @@ -1,10 +0,0 @@ -for (let i = 0; i < 7; i++) { - const acct = getAccount(add(claimedBlockNumber, i), address); - const balance = await acct.balance(); - addToCallback(balance); -} - -const input = { - address: "0xB392448932F6ef430555631f765Df0dfaE34efF3", - claimedBlockNumber: 4917000, -}; diff --git a/harness/test/circuits/sepolia/input/account/7_different_account_balance.js b/harness/test/circuits/sepolia/input/account/7_different_account_balance.js deleted file mode 100644 index c73a3499..00000000 --- a/harness/test/circuits/sepolia/input/account/7_different_account_balance.js +++ /dev/null @@ -1,18 +0,0 @@ -for (let i = 0; i < 7; i++) { - const acct = getAccount(blockNumber, accounts[i]); - addToCallback(await acct.balance()); -} - -const input = { - blockNumber: 5000000, - accounts: [ - "0x45A318273749d6eb00f5F6cA3bC7cD3De26D642A", - "0xcEbf6C32533291322bf57FEced73a755FDb87494", - "0xd20BDECF96871ad354A6Cc7741C3AD65eaD738CB", - "0x03f2901Db5723639978deBed3aBA66d4EA03aF73", - "0x9D8876F9b7B97b287561e6263FC8ddCD616F9E2F", - "0x5f4A0588d91De64a046dE7F6892739D5D98258C2", - "0x45f1A95D617B5f90c601E52cB244aCBB750Ec450", - "0x5293Bb897db0B64FFd11E0194984E8c5F1f06178", - ], -} \ No newline at end of file diff --git a/harness/test/circuits/sepolia/input/header/8_mixed.js b/harness/test/circuits/sepolia/input/header/8_mixed.js deleted file mode 100644 index e4fa2711..00000000 --- a/harness/test/circuits/sepolia/input/header/8_mixed.js +++ /dev/null @@ -1,13 +0,0 @@ -const header = getHeader(claimedBlockNumber); -addToCallback(await header.baseFeePerGas()); -addToCallback(await header.difficulty()); -addToCallback(await header.extraData()); -addToCallback(await header.timestamp()); -addToCallback(await header.miner()); -addToCallback(await header.mixHash()); -addToCallback(await header.nonce()); -addToCallback(await header.mixHash()); - -const input = { - claimedBlockNumber: 3900000, -}; diff --git a/harness/test/circuits/sepolia/input/header/8_state_root.js b/harness/test/circuits/sepolia/input/header/8_state_root.js deleted file mode 100644 index eecacdbd..00000000 --- a/harness/test/circuits/sepolia/input/header/8_state_root.js +++ /dev/null @@ -1,8 +0,0 @@ -for(let i=0; i<8; i++){ - const header = getHeader(add(3000000, i)); - addToCallback(await header.stateRoot()) -} - -const input = { - claimedBlockNumber: 3000000, -} \ No newline at end of file diff --git a/harness/test/circuits/sepolia/input/mapping/different_blocks.js b/harness/test/circuits/sepolia/input/mapping/different_blocks.js deleted file mode 100644 index 8e48ecf6..00000000 --- a/harness/test/circuits/sepolia/input/mapping/different_blocks.js +++ /dev/null @@ -1,4 +0,0 @@ -for (let i = 0; i < 7; i++) { - let mapping = getSolidityMapping(4900000 + i, "0x1F98431c8aD98523631AE4a59f267346ea31F984", 4); - addToCallback(await mapping.key(100)); -} diff --git a/harness/test/circuits/sepolia/input/mapping/different_keys.js b/harness/test/circuits/sepolia/input/mapping/different_keys.js deleted file mode 100644 index 235296a3..00000000 --- a/harness/test/circuits/sepolia/input/mapping/different_keys.js +++ /dev/null @@ -1,4 +0,0 @@ -let mapping = getSolidityMapping(4800000, "0x1F98431c8aD98523631AE4a59f267346ea31F984", 1); -for (let i = 0; i < 7; i++) { - addToCallback(await mapping.key(100 * i)); -} diff --git a/harness/test/circuits/sepolia/input/receipt/diff_block.js b/harness/test/circuits/sepolia/input/receipt/diff_block.js deleted file mode 100644 index 9b53935d..00000000 --- a/harness/test/circuits/sepolia/input/receipt/diff_block.js +++ /dev/null @@ -1,4 +0,0 @@ -for (let i = 0; i < 8; i++) { - let tx = getReceipt(4800009 + i, i); - addToCallback(await tx.cumulativeGas()); -} diff --git a/harness/test/circuits/sepolia/input/receipt/same_receipt_diff_fields.js b/harness/test/circuits/sepolia/input/receipt/same_receipt_diff_fields.js deleted file mode 100644 index a9613f8f..00000000 --- a/harness/test/circuits/sepolia/input/receipt/same_receipt_diff_fields.js +++ /dev/null @@ -1,7 +0,0 @@ -for (let i = 0; i < 2; i++) { - let tx = getReceipt(4000050 + i, i); - await tx.blockNumber(); - await tx.cumulativeGas(); - await tx.txIdx(); - await tx.status(); -} diff --git a/harness/test/circuits/sepolia/input/storage/7_slots.js b/harness/test/circuits/sepolia/input/storage/7_slots.js deleted file mode 100644 index be204520..00000000 --- a/harness/test/circuits/sepolia/input/storage/7_slots.js +++ /dev/null @@ -1,5 +0,0 @@ -const blockNumber = 4500000; -for (let i = 0; i < 7; i++) { - const acct = getStorage(add(blockNumber, i), "0x1F98431c8aD98523631AE4a59f267346ea31F984"); - addToCallback(await acct.slot(i)); -} diff --git a/harness/test/circuits/sepolia/input/tx/diff_block_diff_tx_legacy.js b/harness/test/circuits/sepolia/input/tx/diff_block_diff_tx_legacy.js deleted file mode 100644 index 321688cf..00000000 --- a/harness/test/circuits/sepolia/input/tx/diff_block_diff_tx_legacy.js +++ /dev/null @@ -1,4 +0,0 @@ -for (let i = 0; i < 8; i++) { - let tx = getTx(4000000 + i, i); // 8000001 is legacy tx - addToCallback(await tx.r()); -} diff --git a/harness/test/circuits/sepolia/input/tx/same_block_diff_tx.js b/harness/test/circuits/sepolia/input/tx/same_block_diff_tx.js deleted file mode 100644 index df945226..00000000 --- a/harness/test/circuits/sepolia/input/tx/same_block_diff_tx.js +++ /dev/null @@ -1,4 +0,0 @@ -for (let i = 0; i < 8; i++) { - let tx = getTx(4800009, i); - addToCallback(await tx.r()); -} diff --git a/harness/test/integration/circuits/capacityDataQuery/oneOfEach.circuit.ts b/harness/test/integration/circuits/capacityDataQuery/oneOfEach.circuit.ts new file mode 100644 index 00000000..edc30be0 --- /dev/null +++ b/harness/test/integration/circuits/capacityDataQuery/oneOfEach.circuit.ts @@ -0,0 +1,42 @@ +import { + CircuitValue, + getAccount, + getHeader, + getReceipt, + getSolidityMapping, + getStorage, + getTx, +} from "@axiom-crypto/client"; + +export interface CircuitInputs { + blockNumber: CircuitValue; + address: CircuitValue; + storBlockNumber: CircuitValue; + storAddress: CircuitValue; + storSlot: CircuitValue; + txBlockNumber: CircuitValue; + txTxIdx: CircuitValue; + rcBlockNumber: CircuitValue; + rcTxIdx: CircuitValue; +} + +export const defaultInputs = { + blockNumber: 5000000, //$ account.eoa[0].blockNumber + address: "0x83c8c0b395850ba55c830451cfaca4f2a667a983", //$ account.eoa[0].address + storBlockNumber: 5000000, //$ storage.nonzero[0].blockNumber + storAddress: "0x83c8c0b395850ba55c830451cfaca4f2a667a983", //$ storage.nonzero[0].address + storSlot: 0, //$ storage.nonzero[0].slot + txBlockNumber: 4000000, //$ tx.type["0"][0].blockNumber + txTxIdx: 0, //$ tx.type["0"][0].txIdx + rcBlockNumber: 4000000, //$ rc.events[0].blockNumber + rcTxIdx: 0, //$ rc.events[0].txIdx +}; + +export const circuit = async (inputs: CircuitInputs) => { + const header = await getHeader(inputs.blockNumber).receiptsRoot(); + const account = await getAccount(inputs.blockNumber, inputs.address).balance(); + const storage = await getStorage(inputs.blockNumber, inputs.address).slot(0); + const tx = await getTx(inputs.txBlockNumber, inputs.txTxIdx).to(); + const rc = await getReceipt(inputs.rcBlockNumber, inputs.rcTxIdx).status(); + const mapping = await getSolidityMapping(inputs.blockNumber, inputs.address, 0).key(0); +} \ No newline at end of file diff --git a/harness/test/integration/circuits/capacityDataQuery/size128Header.circuit.ts b/harness/test/integration/circuits/capacityDataQuery/size128Header.circuit.ts new file mode 100644 index 00000000..0e4ed622 --- /dev/null +++ b/harness/test/integration/circuits/capacityDataQuery/size128Header.circuit.ts @@ -0,0 +1,29 @@ +import { + add, + addToCallback, + CircuitValue, + constant, + getAccount, + getHeader, + getReceipt, + getSolidityMapping, + getStorage, + getTx, + mul, +} from "@axiom-crypto/client"; + +export interface CircuitInputs { + blockNumber: CircuitValue; +} + +export const defaultInputs = { + blockNumber: 5000000, //$ account.eoa[1].blockNumber +} + +export const circuit = async (inputs: CircuitInputs) => { + for (let i = 0; i < 128; i++) { + add(1,1); + const header = await getHeader(add(inputs.blockNumber, i)).receiptsRoot(); + addToCallback(header); + } +} \ No newline at end of file diff --git a/harness/test/integration/circuits/capacityDataQuery/size129Header.circuit.ts b/harness/test/integration/circuits/capacityDataQuery/size129Header.circuit.ts new file mode 100644 index 00000000..96524c93 --- /dev/null +++ b/harness/test/integration/circuits/capacityDataQuery/size129Header.circuit.ts @@ -0,0 +1,16 @@ +import { add, addToCallback, CircuitValue, constant, getAccount, getHeader, getReceipt, getSolidityMapping, getStorage, getTx, mul } from "@axiom-crypto/client"; + +export interface CircuitInputs { + blockNumber: CircuitValue; +} + +export const defaultInputs = { + blockNumber: 5000000, //$ account.eoa[1].blockNumber +} + +export const circuit = async (inputs: CircuitInputs) => { + for (let i = 0; i < 129; i++) { + const header = await getHeader(add(inputs.blockNumber, i)).receiptsRoot(); + addToCallback(header); + } +} \ No newline at end of file diff --git a/harness/test/integration/circuits/combo/max128.circuit.ts b/harness/test/integration/circuits/combo/max128.circuit.ts new file mode 100644 index 00000000..dee09816 --- /dev/null +++ b/harness/test/integration/circuits/combo/max128.circuit.ts @@ -0,0 +1,79 @@ +import { + add, + addToCallback, + CircuitValue, + constant, + getAccount, + getHeader, + getReceipt, + getSolidityMapping, + getStorage, + getTx, + mul, +} from "@axiom-crypto/client"; + +export interface CircuitInputs { + blockNumber: CircuitValue; + eoa: CircuitValue; + contractBlock0: CircuitValue; + contractBlock1: CircuitValue; + contract0: CircuitValue; + contract1: CircuitValue; + slot0: CircuitValue; + slot1: CircuitValue; + txBlockNumber: CircuitValue; + txTxIdx: CircuitValue; + rcBlockNumber: CircuitValue; + rcTxIdx: CircuitValue; +} + +export const defaultInputs = { + blockNumber: 4000000, //$ account.eoa[5].blockNumber + eoa: "0xEaa455e4291742eC362Bc21a8C46E5F2b5ed4701", //$ account.eoa[5].address + contractBlock0: 4000000, //$ storage.nonzero[5].blockNumber + contractBlock1: 4000000, //$ storage.nonzero[6].blockNumber + contract0: "0xEaa455e4291742eC362Bc21a8C46E5F2b5ed4701", //$ storage.nonzero[5].address + contract1: "0xEaa455e4291742eC362Bc21a8C46E5F2b5ed4701", //$ storage.nonzero[6].address + slot0: 0, //$ storage.nonzero[5].slot + slot1: 0, //$ storage.nonzero[6].slot + txBlockNumber: 4000000, //$ tx.type["2"][0].blockNumber + txTxIdx: 0, //$ tx.type["2"][0].txIdx + rcBlockNumber: 4000000, //$ rc.events[0].blockNumber + rcTxIdx: 0, //$ rc.events[0].txIdx +}; + +export const circuit = async (inputs: CircuitInputs) => { + for (let i = 0; i < 32; i++) { + let rc = getReceipt(inputs.rcBlockNumber, inputs.rcTxIdx); + addToCallback(await rc.status()); + } + + for (let i = 0; i < 16; i++) { + let tx = getTx(inputs.txBlockNumber, inputs.txTxIdx); + addToCallback(await tx.r()); + } + for (let i = 0; i < 16; i++) { + let tx = getTx(inputs.txBlockNumber, inputs.txTxIdx); + addToCallback((await tx.type()).toCircuitValue()); + } + + for (let i = 0; i < 16; i++) { + let mapping = getSolidityMapping(add(inputs.blockNumber, i), inputs.contract0, 0); + addToCallback(await mapping.key(2)); + } + + for (let i = 0; i < 8; i++) { + const acct = getStorage(add(inputs.contractBlock1, i), inputs.contract1); + addToCallback(await acct.slot(add(inputs.slot1, i))); + } + + for (let i = 0; i < 8; i++) { + const acct = getAccount(add(inputs.blockNumber, i), inputs.eoa); + addToCallback((await acct.nonce()).toCircuitValue()); + } + + for (let i = 0; i < 32; i++) { + const header = getHeader(add(inputs.blockNumber, i)); + addToCallback(await header.stateRoot()); + } +} \ No newline at end of file diff --git a/harness/test/integration/circuits/combo/max30-1.circuit.ts b/harness/test/integration/circuits/combo/max30-1.circuit.ts new file mode 100644 index 00000000..595d1ac5 --- /dev/null +++ b/harness/test/integration/circuits/combo/max30-1.circuit.ts @@ -0,0 +1,61 @@ +import { + add, + addToCallback, + CircuitValue, + getHeader, + getReceipt, + getSolidityMapping, + getStorage, + getTx, +} from "@axiom-crypto/client"; + +export interface CircuitInputs { + blockNumber: CircuitValue; + contract0: CircuitValue; + storBlockNumber: CircuitValue; + storAddress: CircuitValue; + storSlot: CircuitValue; + txBlockNumber: CircuitValue; + txTxIdx: CircuitValue; + rcBlockNumber: CircuitValue; + rcTxIdx: CircuitValue; +} + +export const defaultInputs = { + blockNumber: 4000000, //$ account.eoa[3].blockNumber + contract0: "0xEaa455e4291742eC362Bc21a8C46E5F2b5ed4701", //$ storage.nonzero[3].address + storBlockNumber: 5000000, //$ storage.nonzero[4].blockNumber + storAddress: "0x83c8c0b395850ba55c830451cfaca4f2a667a983", //$ storage.nonzero[4].address + storSlot: 0, //$ storage.nonzero[4].slot + txBlockNumber: 4000000, //$ tx.category.default[1].blockNumber + txTxIdx: 0, //$ tx.category.default[1].txIdx + rcBlockNumber: 4000000, //$ rc.events[1].blockNumber + rcTxIdx: 0, //$ rc.events[1].txIdx +}; + +export const circuit = async (inputs: CircuitInputs) => { + for (let i = 0; i < 8; i++) { + let rc = getReceipt(inputs.rcBlockNumber, inputs.rcTxIdx); + addToCallback(await rc.cumulativeGas()); + } + + for (let i = 0; i < 8; i++) { + let tx = getTx(inputs.txBlockNumber, inputs.txTxIdx); + addToCallback(await tx.r()); + } + + for (let i = 0; i < 4; i++) { + let mapping = getSolidityMapping(add(inputs.blockNumber, i), inputs.contract0, 1); + addToCallback(await mapping.key(2)); + } + + for (let i = 0; i < 3; i++) { + const acct = getStorage(add(inputs.storBlockNumber, i), inputs.storAddress); + addToCallback(await acct.slot(inputs.storSlot)); + } + + for (let i = 0; i < 7; i++) { + const header = getHeader(add(inputs.blockNumber, i)); + addToCallback(await header.stateRoot()); + } +} \ No newline at end of file diff --git a/harness/test/integration/circuits/combo/max30-2.circuit.ts b/harness/test/integration/circuits/combo/max30-2.circuit.ts new file mode 100644 index 00000000..c0fff14f --- /dev/null +++ b/harness/test/integration/circuits/combo/max30-2.circuit.ts @@ -0,0 +1,55 @@ +import { + add, + addToCallback, + CircuitValue, + constant, + getHeader, + getReceipt, + getSolidityMapping, + getStorage, + getTx, + mul, + sub, +} from "@axiom-crypto/client"; + +export interface CircuitInputs { + blockNumber: CircuitValue; + contractBlock: CircuitValue; + contract: CircuitValue; + txBlockNumber: CircuitValue; + txTxIdx: CircuitValue; + rcBlockNumber: CircuitValue; + rcTxIdx: CircuitValue; +} + +export const defaultInputs = { + blockNumber: 4000000, //$ account.eoa[4].blockNumber + contractBlock: 4000000, //$ storage.nonzero[4].blockNumber + contract: "0xEaa455e4291742eC362Bc21a8C46E5F2b5ed4701", //$ storage.nonzero[4].address + txBlockNumber: 4000000, //$ tx.category.large[2].blockNumber + txTxIdx: 0, //$ tx.category.large[2].txIdx + rcBlockNumber: 4000000, //$ rc.events[2].blockNumber + rcTxIdx: 0, //$ rc.events[2].txIdx +}; + +export const circuit = async (inputs: CircuitInputs) => { + for (let i = 0; i < 8; i++) { + let rc = getReceipt(inputs.rcBlockNumber, inputs.rcTxIdx); + addToCallback(await rc.cumulativeGas()); + } + + for (let i = 0; i < 8; i++) { + let tx = getTx(inputs.txBlockNumber, inputs.txTxIdx); + addToCallback(await tx.r()); + } + + for (let i = 0; i < 7; i++) { + let mapping = getSolidityMapping(add(inputs.contractBlock, i), inputs.contract, 1); + addToCallback(await mapping.key(2)); + } + + for (let i = 0; i < 7; i++) { + const header = getHeader(add(sub(inputs.blockNumber, 173677), i)); + addToCallback(await header.stateRoot()); + } +} \ No newline at end of file diff --git a/harness/test/integration/circuits/combo/receipt+tx+mapping+storage.circuit.ts b/harness/test/integration/circuits/combo/receipt+tx+mapping+storage.circuit.ts new file mode 100644 index 00000000..ba9a2bc9 --- /dev/null +++ b/harness/test/integration/circuits/combo/receipt+tx+mapping+storage.circuit.ts @@ -0,0 +1,55 @@ +import { + add, + addToCallback, + CircuitValue, + constant, + getHeader, + getReceipt, + getSolidityMapping, + getStorage, + getTx, + mul, +} from "@axiom-crypto/client"; + +export interface CircuitInputs { + blockNumber: CircuitValue; + contract0: CircuitValue; + contract1: CircuitValue; + txBlockNumber: CircuitValue; + txTxIdx: CircuitValue; + rcBlockNumber: CircuitValue; + rcTxIdx: CircuitValue; +} + +export const defaultInputs = { + blockNumber: 4000000, //$ account.eoa[8].blockNumber + contract0: "0xEaa455e4291742eC362Bc21a8C46E5F2b5ed4701", //$ storage.nonzero[8].address + contract1: "0xEaa455e4291742eC362Bc21a8C46E5F2b5ed4701", //$ storage.nonzero[9].address + txBlockNumber: 4000000, //$ tx.category.default[5].blockNumber + txTxIdx: 0, //$ tx.category.default[5].txIdx + rcBlockNumber: 4000000, //$ rc.events[5].blockNumber + rcTxIdx: 0, //$ rc.events[5].txIdx + +}; + +export const circuit = async (inputs: CircuitInputs) => { + for (let i = 0; i < 8; i++) { + let rc = getReceipt(inputs.rcBlockNumber, inputs.rcTxIdx); + addToCallback(await rc.cumulativeGas()); + } + + for (let i = 0; i < 8; i++) { + let tx = getTx(inputs.txBlockNumber, inputs.txTxIdx); + addToCallback(await tx.r()); + } + + for (let i = 0; i < 4; i++) { + let mapping = getSolidityMapping(add(inputs.blockNumber, i), inputs.contract0, 1); + addToCallback(await mapping.key(2)); + } + + for (let i = 0; i < 3; i++) { + const acct = getStorage(add(inputs.blockNumber, i), inputs.contract1); + addToCallback(await acct.slot(i)); + } +} \ No newline at end of file diff --git a/harness/test/integration/circuits/combo/receipt+tx+mapping.circuit.ts b/harness/test/integration/circuits/combo/receipt+tx+mapping.circuit.ts new file mode 100644 index 00000000..aa82fe27 --- /dev/null +++ b/harness/test/integration/circuits/combo/receipt+tx+mapping.circuit.ts @@ -0,0 +1,47 @@ +import { + add, + addToCallback, + CircuitValue, + constant, + getHeader, + getReceipt, + getSolidityMapping, + getStorage, + getTx, + mul, +} from "@axiom-crypto/client"; + +export interface CircuitInputs { + blockNumber: CircuitValue; + contract: CircuitValue; + txBlockNumber: CircuitValue; + txTxIdx: CircuitValue; + rcBlockNumber: CircuitValue; + rcTxIdx: CircuitValue; +} + +export const defaultInputs = { + blockNumber: 4000000, //$ account.eoa[7].blockNumber + contract: "0xEaa455e4291742eC362Bc21a8C46E5F2b5ed4701", //$ storage.nonzero[7].address + txBlockNumber: 4000000, //$ tx.category.default[4].blockNumber + txTxIdx: 0, //$ tx.category.default[4].txIdx + rcBlockNumber: 4000000, //$ rc.events[4].blockNumber + rcTxIdx: 0, //$ rc.events[4].txIdx +}; + +export const circuit = async (inputs: CircuitInputs) => { + for (let i = 0; i < 8; i++) { + let rc = getReceipt(inputs.rcBlockNumber, inputs.rcTxIdx); + addToCallback(await rc.cumulativeGas()); + } + + for (let i = 0; i < 8; i++) { + let tx = getTx(inputs.txBlockNumber, inputs.txTxIdx); + addToCallback(await tx.r()); + } + + for (let i = 0; i < 7; i++) { + let mapping = getSolidityMapping(add(inputs.blockNumber, i), inputs.contract, 1); + addToCallback(await mapping.key(2)); + } +} \ No newline at end of file diff --git a/harness/test/integration/circuits/combo/receipt+tx.circuit.ts b/harness/test/integration/circuits/combo/receipt+tx.circuit.ts new file mode 100644 index 00000000..9755b22e --- /dev/null +++ b/harness/test/integration/circuits/combo/receipt+tx.circuit.ts @@ -0,0 +1,38 @@ +import { + add, + addToCallback, + CircuitValue, + constant, + getHeader, + getReceipt, + getSolidityMapping, + getStorage, + getTx, + mul, +} from "@axiom-crypto/client"; + +export interface CircuitInputs { + txBlockNumber: CircuitValue; + txTxIdx: CircuitValue; + rcBlockNumber: CircuitValue; + rcTxIdx: CircuitValue; +} + +export const defaultInputs = { + txBlockNumber: 4000000, //$ tx.type["2"][3].blockNumber + txTxIdx: 0, //$ tx.type["2"][3].txIdx + rcBlockNumber: 4000000, //$ rc.events[3].blockNumber + rcTxIdx: 0, //$ rc.events[3].txIdx +}; + +export const circuit = async (inputs: CircuitInputs) => { + for (let i = 0; i < 8; i++) { + let rc = getReceipt(inputs.rcBlockNumber, inputs.rcTxIdx); + addToCallback(await rc.cumulativeGas()); + } + + for (let i = 0; i < 8; i++) { + let tx = getTx(inputs.txBlockNumber, inputs.txTxIdx); + addToCallback(await tx.r()); + } +} \ No newline at end of file diff --git a/client/test/integration/circuits/computeQuery/simple.circuit.ts b/harness/test/integration/circuits/computeQuery/simple.circuit.ts similarity index 51% rename from client/test/integration/circuits/computeQuery/simple.circuit.ts rename to harness/test/integration/circuits/computeQuery/simple.circuit.ts index aa808443..0f852519 100644 --- a/client/test/integration/circuits/computeQuery/simple.circuit.ts +++ b/harness/test/integration/circuits/computeQuery/simple.circuit.ts @@ -10,27 +10,36 @@ import { add, mul, constant, -} from "@axiom-crypto/circuit"; +} from "@axiom-crypto/client"; export interface CircuitInputs { blockNumber: CircuitValue; + addr: CircuitValue; + txBlockNumber: CircuitValue; + txTxIdx: CircuitValue; + rcBlockNumber: CircuitValue; + rcTxIdx: CircuitValue; } export const defaultInputs = { - blockNumber: 5100050, + blockNumber: 5100050, //$ account.eoa[10].blockNumber + addr: "0x83c8c0b395850ba55c830451cfaca4f2a667a983", //$ account.contract[10].address + txBlockNumber: 4000000, //$ tx.type["2"][6].blockNumber + txTxIdx: 0, //$ tx.type["2"][6].txIdx + rcBlockNumber: 4000000, //$ rc.events[6].blockNumber + rcTxIdx: 0, //$ rc.events[6].txIdx }; export const circuit = async (inputs: CircuitInputs) => { - const addr = "0x83c8c0b395850ba55c830451cfaca4f2a667a983"; for (let i = 0; i < 4; i++) { const header = await getHeader(add(inputs.blockNumber, constant(i))).timestamp(); - const account = await getAccount(add(inputs.blockNumber, constant(i)), addr).balance(); - const storage = await getStorage(add(inputs.blockNumber, constant(i)), addr).slot(0); - const tx = await getTx(add(inputs.blockNumber, constant(i)), 0).to(); - const rc = await getReceipt(add(inputs.blockNumber, constant(i)), 0).status(); - const mapping = await getSolidityMapping(add(inputs.blockNumber, constant(i)), addr, 0).key(0); + const account = await getAccount(add(inputs.blockNumber, constant(i)), inputs.addr).balance(); + const storage = await getStorage(add(inputs.blockNumber, constant(i)), inputs.addr).slot(0); + const tx = await getTx(inputs.txBlockNumber, inputs.txTxIdx).to(); + const rc = await getReceipt(inputs.rcBlockNumber, inputs.rcTxIdx).status(); + const mapping = await getSolidityMapping(add(inputs.blockNumber, constant(i)), inputs.addr, 0).key(0); const r0 = add(header.toCircuitValue(), account.toCircuitValue()); - const r1 = add(r0, storage.toCircuitValue()); + const r1 = add(r0, storage.lo()); const r2 = mul(tx.toCircuitValue(), mapping.toCircuitValue()); const s = mul(rc.toCircuitValue(), r1); addToCallback(r2); diff --git a/client/test/integration/circuits/computeQuery/simpleWithCapacity.circuit.ts b/harness/test/integration/circuits/computeQuery/simpleWithCapacity.circuit.ts similarity index 54% rename from client/test/integration/circuits/computeQuery/simpleWithCapacity.circuit.ts rename to harness/test/integration/circuits/computeQuery/simpleWithCapacity.circuit.ts index 83a2e542..1f11367e 100644 --- a/client/test/integration/circuits/computeQuery/simpleWithCapacity.circuit.ts +++ b/harness/test/integration/circuits/computeQuery/simpleWithCapacity.circuit.ts @@ -10,14 +10,24 @@ import { add, mul, constant, -} from "@axiom-crypto/circuit"; +} from "@axiom-crypto/client"; export interface CircuitInputs { blockNumber: CircuitValue; + addr: CircuitValue; + txBlockNumber: CircuitValue; + txTxIdx: CircuitValue; + rcBlockNumber: CircuitValue; + rcTxIdx: CircuitValue; } export const defaultInputs = { - blockNumber: 5100050, + blockNumber: 5100050, //$ account.eoa[10].blockNumber + addr: "0x83c8c0b395850ba55c830451cfaca4f2a667a983", //$ account.contract[10].address + txBlockNumber: 4000000, //$ tx.type["2"][6].blockNumber + txTxIdx: 0, //$ tx.type["2"][6].txIdx + rcBlockNumber: 4000000, //$ rc.events[6].blockNumber + rcTxIdx: 0, //$ rc.events[6].txIdx }; export const config = { @@ -28,19 +38,18 @@ export const config = { } export const circuit = async (inputs: CircuitInputs) => { - const addr = "0x83c8c0b395850ba55c830451cfaca4f2a667a983"; for (let i = 0; i < 4; i++) { const header = await getHeader(add(inputs.blockNumber, constant(i))).timestamp(); - const account = await getAccount(add(inputs.blockNumber, constant(i)), addr).balance(); - const storage = await getStorage(add(inputs.blockNumber, constant(i)), addr).slot(0); - const tx = await getTx(add(inputs.blockNumber, constant(i)), 0).to(); - const rc = await getReceipt(add(inputs.blockNumber, constant(i)), 0).status(); - const mapping = await getSolidityMapping(add(inputs.blockNumber, constant(i)), addr, 0).key(0); + const account = await getAccount(add(inputs.blockNumber, constant(i)), inputs.addr).balance(); + const storage = await getStorage(add(inputs.blockNumber, constant(i)), inputs.addr).slot(0); + const tx = await getTx(inputs.txBlockNumber, inputs.txTxIdx).to(); + const rc = await getReceipt(inputs.rcBlockNumber, inputs.rcTxIdx).status(); + const mapping = await getSolidityMapping(add(inputs.blockNumber, constant(i)), inputs.addr, 0).key(0); const r0 = add(header.toCircuitValue(), account.toCircuitValue()); - const r1 = add(r0, storage.toCircuitValue()); + const r1 = add(r0, storage.lo()); const r2 = mul(tx.toCircuitValue(), mapping.toCircuitValue()); const s = mul(rc.toCircuitValue(), r1); addToCallback(r2); addToCallback(s); } -} \ No newline at end of file +} diff --git a/client/test/integration/circuits/computeQueryStandalone/computeQueryNoData.circuit.ts b/harness/test/integration/circuits/computeQueryStandalone/computeQueryNoData.circuit.ts similarity index 97% rename from client/test/integration/circuits/computeQueryStandalone/computeQueryNoData.circuit.ts rename to harness/test/integration/circuits/computeQueryStandalone/computeQueryNoData.circuit.ts index 8071125b..78a506d0 100644 --- a/client/test/integration/circuits/computeQueryStandalone/computeQueryNoData.circuit.ts +++ b/harness/test/integration/circuits/computeQueryStandalone/computeQueryNoData.circuit.ts @@ -1,4 +1,4 @@ -import { add, addToCallback, constant, mul } from "@axiom-crypto/circuit"; +import { add, addToCallback, constant, mul } from "@axiom-crypto/client"; export interface CircuitInputs {} diff --git a/client/test/integration/circuits/computeQueryStandalone/computeQueryNoDataLarge.circuit.ts b/harness/test/integration/circuits/computeQueryStandalone/computeQueryNoDataLarge.circuit.ts similarity index 78% rename from client/test/integration/circuits/computeQueryStandalone/computeQueryNoDataLarge.circuit.ts rename to harness/test/integration/circuits/computeQueryStandalone/computeQueryNoDataLarge.circuit.ts index 39e36a3e..017f85ba 100644 --- a/client/test/integration/circuits/computeQueryStandalone/computeQueryNoDataLarge.circuit.ts +++ b/harness/test/integration/circuits/computeQueryStandalone/computeQueryNoDataLarge.circuit.ts @@ -1,31 +1,29 @@ -import { CircuitValue, add, addToCallback, constant, mul } from "@axiom-crypto/circuit"; +import { CircuitValue, add, addToCallback, constant, mul } from "@axiom-crypto/client"; export interface CircuitInputs { - x: CircuitValue[]; - y: CircuitValue[]; } export const defaultInputs = { - x: [10,5,20,15,8,9,2,8,1,5,1,2,5,1,95,3,2,60,9,11], - y: [8,2,5,6,2,18,2,20,5,2,29,5,5,2,8,22,3,5,2,40] }; export const circuit = async (inputs: CircuitInputs) => { - let xRes: CircuitValue[] = []; - for (let i = 0; i < inputs.x.length; i++) { + const x = [10,5,20,15,8,9,2,8,1,5,1,2,5,1,95,3,2,60,9,11]; + const y = [8,2,5,6,2,18,2,20,5,2,29,5,5,2,8,22,3,5,2,40]; + let xRes: CircuitValue[] = []; + for (let i = 0; i < x.length; i++) { // x^2 + y - const x_2 = mul(inputs.x[i], inputs.x[i]); - const val = add(x_2, inputs.y[i]); + const x_2 = mul(x[i], x[i]); + const val = add(x_2, y[i]); if (i < 4) { xRes.push(val); } } let yRes: CircuitValue[] = []; - for (let i = 0; i < inputs.y.length; i++) { + for (let i = 0; i < y.length; i++) { // x^2 + y - const y_2 = mul(inputs.y[i], inputs.y[i]); - const val = add(y_2, inputs.x[i]); + const y_2 = mul(y[i], y[i]); + const val = add(y_2, x[i]); if (i < 4) { yRes.push(val); } diff --git a/harness/test/integration/circuits/default/default.circuit.ts b/harness/test/integration/circuits/default/default.circuit.ts new file mode 100644 index 00000000..40377830 --- /dev/null +++ b/harness/test/integration/circuits/default/default.circuit.ts @@ -0,0 +1,125 @@ +import { + add, + sub, + mul, + div, + checkLessThan, + CircuitValue, + CircuitValue256, + constant, + witness, + addToCallback, + getAccount, + checkEqual, + getHeader, + getStorage, + getSolidityMapping, + getTx, + getReceipt, +} from "@axiom-crypto/client"; + +// For type safety, define the input types to your circuit here. +// These should be the _variable_ inputs to your circuit. Constants can be hard-coded into the circuit itself. +export interface CircuitInputs { + address: CircuitValue; + claimedBlockNumber: CircuitValue; + block: CircuitValue; + addr: CircuitValue; + txBlockNumber: CircuitValue; + txIdx: CircuitValue; + logIdx: CircuitValue; + eventSchema: CircuitValue256; + slot: CircuitValue256; + mappingSlot: CircuitValue256; +} + +export const defaultInputs = { + address: "0xd45955f4de64f1840e5686e64278da901e263031", //$ account.eoa[0].address + claimedBlockNumber: 8279568, //$ account.eoa[0].blockNumber + block: 8279568, //$ account.eoa[2].blockNumber + addr: "0x256d75f227d6360e1456faed6694231f15a37871", //$ account.eoa[1].address + txBlockNumber: 8279504, //$ rc.events[0].blockNumber + txIdx: 14, //$ rc.events[0].txIdx + logIdx: 6, //$ rc.events[0].logIdx + eventSchema: "0x7c1fc233fcf8cadbae2477cb12888718dbcbca4a2c72cea0903b5aa7cf4a7e23", //$ rc.events[0].eventSchema + slot: 0, //$ storage.nonzero[0].slot + mappingSlot: 1, //$ tx.type["2"][0].txIdx +} + +export const circuit = async (inputs: CircuitInputs) => { + // example Axiom REPL circuit to prove the first block an account transacted + // get the previous block number + const prevBlock = sub(inputs.claimedBlockNumber, constant(1)); + + //get the account at the previous block + const accountPrevBlock = getAccount(prevBlock, inputs.address); + + // get the account nonce at the previous block and assert that it is 0 + const prevNonce = (await accountPrevBlock.nonce()).toCircuitValue(); + // checkEqual(prevNonce, constant(0)) + + // get the account nonce at the claimed block number + const account = getAccount(inputs.claimedBlockNumber, inputs.address); + const currNonce = (await account.nonce()).toCircuitValue(); + + //checks that currNonce > 0 at the claimed block + // checkLessThan(constant(0), currNonce) + + // add the address and blockNumber to the callback, for it to be passed + // as a result to the callback client contract + addToCallback(inputs.address) + addToCallback(inputs.claimedBlockNumber); + + // Here is a list of all functions you can use to fetch on-chain data in the REPL. + // For more detailed docs and a list of all data and compute functions, see our + // preview docs at: + // + // https://docs.axiom.xyz/sdk-and-repl-reference/axiomrepl-reference + // + + // fetch block header data + let header = getHeader(inputs.block); + // access the timestamp field + let timestamp = await header.timestamp(); + // access the gasLimit field + let gasLimit = await header.gasLimit(); + + // fetch account data + let acct = getAccount(inputs.block, inputs.addr); + // access the account balance at `block` + let balance = await acct.balance(); + // access the nonce of the account at `block` + let nonce = await acct.nonce(); + + // fetch storage data + let storage = getStorage(inputs.block, inputs.addr); + // access the value at storage slot `slot` + let slotVal = await storage.slot(inputs.slot); + + // fetch Solidity mapping data + let mapping = getSolidityMapping(inputs.block, inputs.addr, inputs.mappingSlot); + // access the value in the mapping at `mappingSlot` with key `3` + let mappingVal = await mapping.key(3); + + // fetch transaction data, example is for the transaction below: + // https://goerli.etherscan.io/tx/0xa4f781ad033d6dab5b13e3ab7c7cbdbd0ea4c0a2be3d9ffa7ed1e53d2d5bcc46 + let tx = getTx(inputs.txBlockNumber, inputs.txIdx); + // get the 4-byte function selector that was called + let functionSelector = await tx.functionSelector(); + // access bytes [32, 64) of calldata + // let calldata = await tx.calldata(1); + + let receipt = getReceipt(inputs.txBlockNumber, inputs.txIdx); + // access the address that emitted the log event at index 0 + let logAddr = await receipt.log(inputs.logIdx).address(); + // access the topic at index 1 of the log event at index 0 and check it has schema eventSchema + // because `address` is indexed in the event, this corresponds to `address` + let topic = await receipt.log(inputs.logIdx).topic(1, inputs.eventSchema); + // access the first 32 bytes of data in the log event at index 0 + // because `amt` is not indexed, this corresponds to `amt` + let data = await receipt.log(inputs.logIdx).data(0); + + addToCallback(logAddr); + addToCallback(topic); + addToCallback(data); +} \ No newline at end of file diff --git a/client/test/integration/circuits/eip4844/eip4844receipt.circuit.ts b/harness/test/integration/circuits/eip4844/eip4844receipt.circuit.ts similarity index 58% rename from client/test/integration/circuits/eip4844/eip4844receipt.circuit.ts rename to harness/test/integration/circuits/eip4844/eip4844receipt.circuit.ts index 9c161a89..d2c60c15 100644 --- a/client/test/integration/circuits/eip4844/eip4844receipt.circuit.ts +++ b/harness/test/integration/circuits/eip4844/eip4844receipt.circuit.ts @@ -1,3 +1,5 @@ +//$ chainId=1,11155111 + import { CircuitValue, addToCallback, @@ -10,7 +12,7 @@ import { add, mul, constant, -} from "@axiom-crypto/circuit"; +} from "@axiom-crypto/client"; export interface CircuitInputs { blockNumber: CircuitValue; @@ -18,12 +20,12 @@ export interface CircuitInputs { } export const defaultInputs = { - blockNumber: 5005300, - txIdx: 0, + blockNumber: 5005300, //$ tx.type["3"][0].blockNumber + txIdx: 0, //$ tx.type["3"][0].txIdx }; export const circuit =async (inputs: CircuitInputs) => { - const tx = getReceipt(inputs.blockNumber, inputs.txIdx); - const blockNum = await tx.blockNumber(); + const rc = getReceipt(inputs.blockNumber, inputs.txIdx); + const blockNum = (await rc.blockNumber()).lo(); addToCallback(blockNum); } diff --git a/harness/test/integration/circuits/queryId/basic.circuit.ts b/harness/test/integration/circuits/queryId/basic.circuit.ts new file mode 100644 index 00000000..e6deeaa0 --- /dev/null +++ b/harness/test/integration/circuits/queryId/basic.circuit.ts @@ -0,0 +1,19 @@ +import { + addToCallback, + CircuitValue, + getHeader, +} from "@axiom-crypto/client"; + + +export interface CircuitInputs { + blockNumber: CircuitValue; +} + +export const defaultInputs = { + blockNumber: 5000000, //$ account.eoa[11].blockNumber +} + +export const circuit = async (inputs: CircuitInputs) => { + const header = await getHeader(inputs.blockNumber).number(); + addToCallback(header); +} \ No newline at end of file diff --git a/client/test/integration/circuits/sendQuery/average.circuit.ts b/harness/test/integration/circuits/quickstart/average.circuit.ts similarity index 93% rename from client/test/integration/circuits/sendQuery/average.circuit.ts rename to harness/test/integration/circuits/quickstart/average.circuit.ts index b5f7795e..e122eace 100644 --- a/client/test/integration/circuits/sendQuery/average.circuit.ts +++ b/harness/test/integration/circuits/quickstart/average.circuit.ts @@ -4,13 +4,13 @@ import { mul, div, checkLessThan, + addToCallback, CircuitValue, CircuitValue256, constant, witness, - addToCallback, getAccount, -} from "@axiom-crypto/circuit"; +} from "@axiom-crypto/client"; // For type safety, define the input types to your circuit here. // These should be the _variable_ inputs to your circuit. Constants can be hard-coded into the circuit itself. @@ -22,8 +22,8 @@ export interface CircuitInputs { // Default inputs to use for compiling the circuit. These values should be different than the inputs fed into // the circuit at proving time. export const defaultInputs = { - "blockNumber": 4000000, - "address": "0xEaa455e4291742eC362Bc21a8C46E5F2b5ed4701" + blockNumber: 4000000, //$ account.eoa[12].blockNumber + address: "0xEaa455e4291742eC362Bc21a8C46E5F2b5ed4701" //$ account.eoa[12].address }; // The function name `circuit` is searched for by default by our Axiom CLI; if you decide to diff --git a/harness/test/integration/sepolia.test.ts b/harness/test/integration/sepolia.test.ts deleted file mode 100644 index cd11d713..00000000 --- a/harness/test/integration/sepolia.test.ts +++ /dev/null @@ -1,84 +0,0 @@ -import fs from 'fs'; -import path from 'path'; -import { ethers } from 'ethers'; -import { listDir, makeFileMap } from "../utils"; -import { harness } from "../../src/harness"; -import { queryParams } from '../../../client/src/cli/queryParams'; -import { AxiomCircuit } from "../../../client/src/js"; - -// TMP: until we expose abi (via Axiom) in AxiomCircuit -import axiomV2QueryJson from "./tmpAbi/AxiomV2Query.json"; -// TMP: until we expose query addr (via Axiom) in AxiomCircuit -const axiomV2QueryAddr = "0x8ec7b212a983b1ebbfacfd69794ef179da1db0e0"; - -// NOTE: Requires unit tests to be run first since the unit tests build the circuit parameter json files -describe("Send Sepolia queries on-chain", () => { - if (process.env.PROVIDER_URI_SEPOLIA === undefined) { - throw new Error("`PROVIDER_URI_SEPOLIA` environment variable must be defined"); - } - if (process.env.PRIVATE_KEY_SEPOLIA === undefined) { - throw new Error("`PRIVATE_KEY_SEPOLIA` environment variable must be defined"); - } - - const provider = new ethers.JsonRpcProvider( - process.env.PROVIDER_URI_SEPOLIA as string, - ); - const signer = new ethers.Wallet( - process.env.PRIVATE_KEY_SEPOLIA as string, - provider, - ); - const senderAddress = signer.address; - - const inputBasePath = "./test/circuits/sepolia/input"; - const outputBasePath = "./test/integration/sepolia/output"; - const files = listDir(inputBasePath); - const fileMap = makeFileMap(files); - const exampleClientAddr = "0x752056074aceabac231801cbfa68900744eebc98"; - - for (let [folder, files] of Object.entries(fileMap)) { - for (let file of files) { - const inputFile = `${inputBasePath}/${folder}/${file}`; - const fileName = file.split(".js")[0]; - const outputBasePathType = `${outputBasePath}/${folder}`; - const outputFileBase = `${outputBasePathType}/${fileName}`; - - test(`Test ${folder}: ${inputFile}`, async () => { - const unitTestFilePath = path.resolve("test/unit/sepolia/output", folder, fileName); - const sendQueryJsonPath = path.resolve(outputBasePathType, `${fileName}.sendQuery.json`); - - await queryParams( - exampleClientAddr, - { - refundAddress: senderAddress, - sourceChainId: "11155111", - callbackExtraData: ethers.ZeroHash, - calldata: false, - caller: senderAddress, - proven: `${unitTestFilePath}.output.json`, - outputs: sendQueryJsonPath, - provider: process.env.PROVIDER_URI_SEPOLIA as string, - maxFeePerGas: "50000000000", // need to set this on Sepolia since the network is busy - } - ); - - const sendQueryJson = require(sendQueryJsonPath); - - const axiomV2QueryMock = new ethers.Contract( - axiomV2QueryAddr, - axiomV2QueryJson.abi, - signer, - ); - - - console.log( - "Sending a Query to AxiomV2QueryMock with payment amount (wei):", - sendQueryJson.value, - ); - - const tx = await axiomV2QueryMock.sendQuery(...sendQueryJson.args, { value: sendQueryJson.value }); - const receipt: ethers.ContractTransactionReceipt = await tx.wait(); - console.log("Transaction receipt:", receipt); - }, 180000); - } - } -}); \ No newline at end of file diff --git a/harness/test/integration/start.test.ts b/harness/test/integration/start.test.ts new file mode 100644 index 00000000..d46bb3ef --- /dev/null +++ b/harness/test/integration/start.test.ts @@ -0,0 +1,100 @@ +import path from 'path'; +import { findCircuitFiles, run } from "../../src/run"; +import { rmSync } from 'fs'; + +if (process.env.CHAIN_ID === undefined) { + throw new Error(`CHAIN_ID environment variable must be defined`); +} +const CHAIN_ID = process.env.CHAIN_ID; + +jest.setTimeout(240000); + +// Special tests need to be run with specific parameters +const SPECIAL_TESTS = [ + "size129Header.circuit.ts", + "simpleWithCapacity.circuit.ts", + "eip4844receipt.circuit.ts", +] + +// NOTE: A valid data file in the `test/chainData` directory must be provided +describe("Integration tests", () => { + if (process.env[`PROVIDER_URI_${CHAIN_ID}`] === undefined) { + throw new Error(`PROVIDER_URI_${CHAIN_ID} environment variable must be defined`); + } + if (process.env[`PRIVATE_KEY_${CHAIN_ID}`] === undefined) { + throw new Error(`PRIVATE_KEY_${CHAIN_ID} environment variable must be defined`); + } + + const circuitPaths = findCircuitFiles("./test/integration/circuits"); + let standardTests: string[] = []; + for (const circuitPath of circuitPaths) { + const filename = path.basename(circuitPath); + if (!SPECIAL_TESTS.includes(filename)) { + standardTests.push(circuitPath); + } + } + + const provider = process.env[`PROVIDER_URI_${CHAIN_ID}`] as string; + const data = `./test/chainData/${CHAIN_ID}.json`; + + beforeAll(async () => { + rmSync("./test/integration/circuits/output", { recursive: true, force: true }); + }) + + for (const circuitPath of standardTests) { + const folder = path.basename(path.dirname(circuitPath)); + const filename = path.basename(circuitPath); + test(`Test ${folder}/${filename}`, async () => { + const receipt = await run({ + circuit: circuitPath, + provider, + data, + send: true, + }) + expect(receipt.status).toEqual("success"); + }); + } + + test(`Size 129 header`, async () => { + const testFn = async () => { + await run({ + circuit: "./test/integration/circuits/capacityDataQuery/size129Header.circuit.ts", + provider, + data, + send: true, + }); + } + await expect(testFn()).rejects.toThrowError(); + }); + + test(`Custom capacity (256)`, async () => { + const receipt = await run({ + circuit: "./test/integration/circuits/computeQuery/simpleWithCapacity.circuit.ts", + provider, + data, + send: true, + options: { + capacity: { + maxOutputs: 256, + maxSubqueries: 256, + }, + }, + }); + expect(receipt.status).toEqual("success"); + }); + + test(`EIP4844`, async () => { + if (!(CHAIN_ID === "1" || CHAIN_ID === "11155111")) { + return; + } + const testFn = async () => { + await run({ + circuit: "./test/integration/circuits/eip4844/eip4844receipt.circuit.ts", + provider, + data, + send: true, + }); + } + await expect(testFn()).rejects.toThrowError(); + }); +}); \ No newline at end of file diff --git a/harness/test/integration/tmpAbi/AxiomV2Query.json b/harness/test/integration/tmpAbi/AxiomV2Query.json deleted file mode 100644 index 46c3fb94..00000000 --- a/harness/test/integration/tmpAbi/AxiomV2Query.json +++ /dev/null @@ -1 +0,0 @@ -{"abi":[{"type":"constructor","inputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"AXIOM_ROLE","inputs":[],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"function","name":"DEFAULT_ADMIN_ROLE","inputs":[],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"function","name":"GUARDIAN_ROLE","inputs":[],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"function","name":"PROVER_ROLE","inputs":[],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"function","name":"TIMELOCK_ROLE","inputs":[],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"function","name":"UNFREEZE_ROLE","inputs":[],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"function","name":"addAggregateVkeyHash","inputs":[{"name":"_aggregateVkeyHash","type":"bytes32","internalType":"bytes32"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"addPerQueryAggregateVkeyHash","inputs":[{"name":"querySchema","type":"bytes32","internalType":"bytes32"},{"name":"target","type":"address","internalType":"address"},{"name":"aggregateVkeyHash","type":"bytes32","internalType":"bytes32"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"addPerQueryProver","inputs":[{"name":"querySchema","type":"bytes32","internalType":"bytes32"},{"name":"target","type":"address","internalType":"address"},{"name":"prover","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"aggregateVkeyHashes","inputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"view"},{"type":"function","name":"axiomHeaderVerifierAddress","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"axiomQueryFee","inputs":[],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"balances","inputs":[{"name":"","type":"address","internalType":"address"}],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"deposit","inputs":[{"name":"payor","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"payable"},{"type":"function","name":"freezeAll","inputs":[],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"frozen","inputs":[],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"view"},{"type":"function","name":"fulfillOffchainQuery","inputs":[{"name":"mmrWitness","type":"tuple","internalType":"struct IAxiomV2HeaderVerifier.MmrWitness","components":[{"name":"snapshotPmmrSize","type":"uint32","internalType":"uint32"},{"name":"proofMmrPeaks","type":"bytes32[]","internalType":"bytes32[]"},{"name":"mmrComplementOrPeaks","type":"bytes32[]","internalType":"bytes32[]"}]},{"name":"computeResults","type":"bytes32[]","internalType":"bytes32[]"},{"name":"proof","type":"bytes","internalType":"bytes"},{"name":"callback","type":"tuple","internalType":"struct IAxiomV2Query.AxiomV2Callback","components":[{"name":"target","type":"address","internalType":"address"},{"name":"extraData","type":"bytes","internalType":"bytes"}]},{"name":"userSalt","type":"bytes32","internalType":"bytes32"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"fulfillQuery","inputs":[{"name":"mmrWitness","type":"tuple","internalType":"struct IAxiomV2HeaderVerifier.MmrWitness","components":[{"name":"snapshotPmmrSize","type":"uint32","internalType":"uint32"},{"name":"proofMmrPeaks","type":"bytes32[]","internalType":"bytes32[]"},{"name":"mmrComplementOrPeaks","type":"bytes32[]","internalType":"bytes32[]"}]},{"name":"computeResults","type":"bytes32[]","internalType":"bytes32[]"},{"name":"proof","type":"bytes","internalType":"bytes"},{"name":"callback","type":"tuple","internalType":"struct IAxiomV2Query.AxiomV2Callback","components":[{"name":"target","type":"address","internalType":"address"},{"name":"extraData","type":"bytes","internalType":"bytes"}]},{"name":"queryWitness","type":"tuple","internalType":"struct IAxiomV2Query.AxiomV2QueryWitness","components":[{"name":"caller","type":"address","internalType":"address"},{"name":"userSalt","type":"bytes32","internalType":"bytes32"},{"name":"queryHash","type":"bytes32","internalType":"bytes32"},{"name":"callbackHash","type":"bytes32","internalType":"bytes32"},{"name":"refundee","type":"address","internalType":"address"}]}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"getRoleAdmin","inputs":[{"name":"role","type":"bytes32","internalType":"bytes32"}],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"function","name":"grantRole","inputs":[{"name":"role","type":"bytes32","internalType":"bytes32"},{"name":"account","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"hasRole","inputs":[{"name":"role","type":"bytes32","internalType":"bytes32"},{"name":"account","type":"address","internalType":"address"}],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"view"},{"type":"function","name":"increaseQueryGas","inputs":[{"name":"queryId","type":"uint256","internalType":"uint256"},{"name":"newMaxFeePerGas","type":"uint64","internalType":"uint64"},{"name":"newCallbackGasLimit","type":"uint32","internalType":"uint32"},{"name":"overrideAxiomQueryFee","type":"uint256","internalType":"uint256"}],"outputs":[],"stateMutability":"payable"},{"type":"function","name":"initialize","inputs":[{"name":"init","type":"tuple","internalType":"struct IAxiomV2Query.AxiomV2QueryInit","components":[{"name":"axiomHeaderVerifierAddress","type":"address","internalType":"address"},{"name":"verifierAddress","type":"address","internalType":"address"},{"name":"proverAddresses","type":"address[]","internalType":"address[]"},{"name":"aggregateVkeyHashes","type":"bytes32[]","internalType":"bytes32[]"},{"name":"queryDeadlineInterval","type":"uint32","internalType":"uint32"},{"name":"proofVerificationGas","type":"uint32","internalType":"uint32"},{"name":"axiomQueryFee","type":"uint256","internalType":"uint256"},{"name":"minMaxFeePerGas","type":"uint64","internalType":"uint64"},{"name":"maxQueryDeadlineInterval","type":"uint32","internalType":"uint32"},{"name":"timelock","type":"address","internalType":"address"},{"name":"guardian","type":"address","internalType":"address"},{"name":"unfreeze","type":"address","internalType":"address"}]}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"maxQueryDeadlineInterval","inputs":[],"outputs":[{"name":"","type":"uint32","internalType":"uint32"}],"stateMutability":"view"},{"type":"function","name":"minMaxFeePerGas","inputs":[],"outputs":[{"name":"","type":"uint64","internalType":"uint64"}],"stateMutability":"view"},{"type":"function","name":"perQueryAggregateVkeyHashes","inputs":[{"name":"","type":"bytes32","internalType":"bytes32"},{"name":"","type":"address","internalType":"address"},{"name":"","type":"bytes32","internalType":"bytes32"}],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"view"},{"type":"function","name":"perQueryProvers","inputs":[{"name":"","type":"bytes32","internalType":"bytes32"},{"name":"","type":"address","internalType":"address"},{"name":"","type":"address","internalType":"address"}],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"view"},{"type":"function","name":"proofVerificationGas","inputs":[],"outputs":[{"name":"","type":"uint32","internalType":"uint32"}],"stateMutability":"view"},{"type":"function","name":"proxiableUUID","inputs":[],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"function","name":"queries","inputs":[{"name":"","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"state","type":"uint8","internalType":"uint8"},{"name":"deadlineBlockNumber","type":"uint32","internalType":"uint32"},{"name":"callbackGasLimit","type":"uint32","internalType":"uint32"},{"name":"payee","type":"address","internalType":"address"},{"name":"payment","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"queryDeadlineInterval","inputs":[],"outputs":[{"name":"","type":"uint32","internalType":"uint32"}],"stateMutability":"view"},{"type":"function","name":"refundQuery","inputs":[{"name":"queryWitness","type":"tuple","internalType":"struct IAxiomV2Query.AxiomV2QueryWitness","components":[{"name":"caller","type":"address","internalType":"address"},{"name":"userSalt","type":"bytes32","internalType":"bytes32"},{"name":"queryHash","type":"bytes32","internalType":"bytes32"},{"name":"callbackHash","type":"bytes32","internalType":"bytes32"},{"name":"refundee","type":"address","internalType":"address"}]}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"removeAggregateVkeyHash","inputs":[{"name":"_aggregateVkeyHash","type":"bytes32","internalType":"bytes32"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"removePerQueryAggregateVkeyHash","inputs":[{"name":"querySchema","type":"bytes32","internalType":"bytes32"},{"name":"target","type":"address","internalType":"address"},{"name":"aggregateVkeyHash","type":"bytes32","internalType":"bytes32"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"removePerQueryProver","inputs":[{"name":"querySchema","type":"bytes32","internalType":"bytes32"},{"name":"target","type":"address","internalType":"address"},{"name":"prover","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"renounceRole","inputs":[{"name":"role","type":"bytes32","internalType":"bytes32"},{"name":"account","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"revokeRole","inputs":[{"name":"role","type":"bytes32","internalType":"bytes32"},{"name":"account","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"sendQuery","inputs":[{"name":"sourceChainId","type":"uint64","internalType":"uint64"},{"name":"dataQueryHash","type":"bytes32","internalType":"bytes32"},{"name":"computeQuery","type":"tuple","internalType":"struct IAxiomV2Query.AxiomV2ComputeQuery","components":[{"name":"k","type":"uint8","internalType":"uint8"},{"name":"resultLen","type":"uint16","internalType":"uint16"},{"name":"vkey","type":"bytes32[]","internalType":"bytes32[]"},{"name":"computeProof","type":"bytes","internalType":"bytes"}]},{"name":"callback","type":"tuple","internalType":"struct IAxiomV2Query.AxiomV2Callback","components":[{"name":"target","type":"address","internalType":"address"},{"name":"extraData","type":"bytes","internalType":"bytes"}]},{"name":"feeData","type":"tuple","internalType":"struct IAxiomV2Query.AxiomV2FeeData","components":[{"name":"maxFeePerGas","type":"uint64","internalType":"uint64"},{"name":"callbackGasLimit","type":"uint32","internalType":"uint32"},{"name":"overrideAxiomQueryFee","type":"uint256","internalType":"uint256"}]},{"name":"userSalt","type":"bytes32","internalType":"bytes32"},{"name":"refundee","type":"address","internalType":"address"},{"name":"dataQuery","type":"bytes","internalType":"bytes"}],"outputs":[{"name":"queryId","type":"uint256","internalType":"uint256"}],"stateMutability":"payable"},{"type":"function","name":"sendQueryWithIpfsData","inputs":[{"name":"queryHash","type":"bytes32","internalType":"bytes32"},{"name":"ipfsHash","type":"bytes32","internalType":"bytes32"},{"name":"callback","type":"tuple","internalType":"struct IAxiomV2Query.AxiomV2Callback","components":[{"name":"target","type":"address","internalType":"address"},{"name":"extraData","type":"bytes","internalType":"bytes"}]},{"name":"feeData","type":"tuple","internalType":"struct IAxiomV2Query.AxiomV2FeeData","components":[{"name":"maxFeePerGas","type":"uint64","internalType":"uint64"},{"name":"callbackGasLimit","type":"uint32","internalType":"uint32"},{"name":"overrideAxiomQueryFee","type":"uint256","internalType":"uint256"}]},{"name":"userSalt","type":"bytes32","internalType":"bytes32"},{"name":"refundee","type":"address","internalType":"address"}],"outputs":[{"name":"queryId","type":"uint256","internalType":"uint256"}],"stateMutability":"payable"},{"type":"function","name":"supportsInterface","inputs":[{"name":"interfaceId","type":"bytes4","internalType":"bytes4"}],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"view"},{"type":"function","name":"unescrow","inputs":[{"name":"queryWitness","type":"tuple","internalType":"struct IAxiomV2Query.AxiomV2QueryWitness","components":[{"name":"caller","type":"address","internalType":"address"},{"name":"userSalt","type":"bytes32","internalType":"bytes32"},{"name":"queryHash","type":"bytes32","internalType":"bytes32"},{"name":"callbackHash","type":"bytes32","internalType":"bytes32"},{"name":"refundee","type":"address","internalType":"address"}]},{"name":"amountUsed","type":"uint256","internalType":"uint256"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"unfreezeAll","inputs":[],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"updateAxiomHeaderVerifierAddress","inputs":[{"name":"_axiomHeaderVerifierAddress","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"updateAxiomQueryFee","inputs":[{"name":"_axiomQueryFee","type":"uint256","internalType":"uint256"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"updateMinMaxFeePerGas","inputs":[{"name":"_minMaxFeePerGas","type":"uint64","internalType":"uint64"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"updateProofVerificationGas","inputs":[{"name":"_proofVerificationGas","type":"uint32","internalType":"uint32"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"updateQueryDeadlineInterval","inputs":[{"name":"_queryDeadlineInterval","type":"uint32","internalType":"uint32"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"updateVerifierAddress","inputs":[{"name":"_verifierAddress","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"upgradeTo","inputs":[{"name":"newImplementation","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"upgradeToAndCall","inputs":[{"name":"newImplementation","type":"address","internalType":"address"},{"name":"data","type":"bytes","internalType":"bytes"}],"outputs":[],"stateMutability":"payable"},{"type":"function","name":"verifierAddress","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"withdraw","inputs":[{"name":"amount","type":"uint256","internalType":"uint256"},{"name":"payee","type":"address","internalType":"address payable"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"event","name":"AddAggregateVkeyHash","inputs":[{"name":"aggregateVkeyHash","type":"bytes32","indexed":true,"internalType":"bytes32"}],"anonymous":false},{"type":"event","name":"AddPerQueryAggregateVkeyHash","inputs":[{"name":"querySchema","type":"bytes32","indexed":true,"internalType":"bytes32"},{"name":"target","type":"address","indexed":false,"internalType":"address"},{"name":"aggregateVkeyHash","type":"bytes32","indexed":false,"internalType":"bytes32"}],"anonymous":false},{"type":"event","name":"AddPerQueryProver","inputs":[{"name":"querySchema","type":"bytes32","indexed":true,"internalType":"bytes32"},{"name":"target","type":"address","indexed":false,"internalType":"address"},{"name":"prover","type":"address","indexed":false,"internalType":"address"}],"anonymous":false},{"type":"event","name":"AdminChanged","inputs":[{"name":"previousAdmin","type":"address","indexed":false,"internalType":"address"},{"name":"newAdmin","type":"address","indexed":false,"internalType":"address"}],"anonymous":false},{"type":"event","name":"BeaconUpgraded","inputs":[{"name":"beacon","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"Deposit","inputs":[{"name":"payor","type":"address","indexed":true,"internalType":"address"},{"name":"amount","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"FreezeAll","inputs":[],"anonymous":false},{"type":"event","name":"Initialized","inputs":[{"name":"version","type":"uint8","indexed":false,"internalType":"uint8"}],"anonymous":false},{"type":"event","name":"OffchainQueryFulfilled","inputs":[{"name":"queryId","type":"uint256","indexed":true,"internalType":"uint256"},{"name":"callbackSucceeded","type":"bool","indexed":false,"internalType":"bool"}],"anonymous":false},{"type":"event","name":"QueryFeeInfoRecorded","inputs":[{"name":"queryId","type":"uint256","indexed":true,"internalType":"uint256"},{"name":"payor","type":"address","indexed":true,"internalType":"address"},{"name":"deadlineBlockNumber","type":"uint32","indexed":false,"internalType":"uint32"},{"name":"maxFeePerGas","type":"uint64","indexed":false,"internalType":"uint64"},{"name":"callbackGasLimit","type":"uint32","indexed":false,"internalType":"uint32"},{"name":"amount","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"QueryFulfilled","inputs":[{"name":"queryId","type":"uint256","indexed":true,"internalType":"uint256"},{"name":"payee","type":"address","indexed":false,"internalType":"address"},{"name":"callbackSucceeded","type":"bool","indexed":false,"internalType":"bool"}],"anonymous":false},{"type":"event","name":"QueryGasIncreased","inputs":[{"name":"queryId","type":"uint256","indexed":true,"internalType":"uint256"},{"name":"maxFeePerGas","type":"uint64","indexed":false,"internalType":"uint64"},{"name":"callbackGasLimit","type":"uint32","indexed":false,"internalType":"uint32"},{"name":"overrideAxiomQueryFee","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"QueryInitiatedOnchain","inputs":[{"name":"caller","type":"address","indexed":true,"internalType":"address"},{"name":"queryHash","type":"bytes32","indexed":true,"internalType":"bytes32"},{"name":"queryId","type":"uint256","indexed":true,"internalType":"uint256"},{"name":"userSalt","type":"bytes32","indexed":false,"internalType":"bytes32"},{"name":"refundee","type":"address","indexed":false,"internalType":"address"},{"name":"target","type":"address","indexed":false,"internalType":"address"},{"name":"extraData","type":"bytes","indexed":false,"internalType":"bytes"}],"anonymous":false},{"type":"event","name":"QueryInitiatedWithIpfsData","inputs":[{"name":"caller","type":"address","indexed":true,"internalType":"address"},{"name":"queryHash","type":"bytes32","indexed":true,"internalType":"bytes32"},{"name":"queryId","type":"uint256","indexed":true,"internalType":"uint256"},{"name":"userSalt","type":"bytes32","indexed":false,"internalType":"bytes32"},{"name":"ipfsHash","type":"bytes32","indexed":false,"internalType":"bytes32"},{"name":"refundee","type":"address","indexed":false,"internalType":"address"},{"name":"target","type":"address","indexed":false,"internalType":"address"},{"name":"extraData","type":"bytes","indexed":false,"internalType":"bytes"}],"anonymous":false},{"type":"event","name":"QueryRefunded","inputs":[{"name":"queryId","type":"uint256","indexed":true,"internalType":"uint256"},{"name":"refundee","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"RemoveAggregateVkeyHash","inputs":[{"name":"aggregateVkeyHash","type":"bytes32","indexed":true,"internalType":"bytes32"}],"anonymous":false},{"type":"event","name":"RemovePerQueryAggregateVkeyHash","inputs":[{"name":"querySchema","type":"bytes32","indexed":true,"internalType":"bytes32"},{"name":"target","type":"address","indexed":false,"internalType":"address"},{"name":"aggregateVkeyHash","type":"bytes32","indexed":false,"internalType":"bytes32"}],"anonymous":false},{"type":"event","name":"RemovePerQueryProver","inputs":[{"name":"querySchema","type":"bytes32","indexed":true,"internalType":"bytes32"},{"name":"target","type":"address","indexed":false,"internalType":"address"},{"name":"prover","type":"address","indexed":false,"internalType":"address"}],"anonymous":false},{"type":"event","name":"RoleAdminChanged","inputs":[{"name":"role","type":"bytes32","indexed":true,"internalType":"bytes32"},{"name":"previousAdminRole","type":"bytes32","indexed":true,"internalType":"bytes32"},{"name":"newAdminRole","type":"bytes32","indexed":true,"internalType":"bytes32"}],"anonymous":false},{"type":"event","name":"RoleGranted","inputs":[{"name":"role","type":"bytes32","indexed":true,"internalType":"bytes32"},{"name":"account","type":"address","indexed":true,"internalType":"address"},{"name":"sender","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"RoleRevoked","inputs":[{"name":"role","type":"bytes32","indexed":true,"internalType":"bytes32"},{"name":"account","type":"address","indexed":true,"internalType":"address"},{"name":"sender","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"Unescrow","inputs":[{"name":"payor","type":"address","indexed":true,"internalType":"address"},{"name":"queryId","type":"uint256","indexed":true,"internalType":"uint256"},{"name":"payee","type":"address","indexed":true,"internalType":"address"},{"name":"refundee","type":"address","indexed":false,"internalType":"address"},{"name":"amountUsed","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"UnfreezeAll","inputs":[],"anonymous":false},{"type":"event","name":"UpdateAxiomHeaderVerifierAddress","inputs":[{"name":"newAddress","type":"address","indexed":false,"internalType":"address"}],"anonymous":false},{"type":"event","name":"UpdateAxiomProverAddress","inputs":[{"name":"newAddress","type":"address","indexed":false,"internalType":"address"}],"anonymous":false},{"type":"event","name":"UpdateAxiomQueryFee","inputs":[{"name":"newAxiomQueryFee","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"UpdateMinMaxFeePerGas","inputs":[{"name":"newMinMaxFeePerGas","type":"uint64","indexed":false,"internalType":"uint64"}],"anonymous":false},{"type":"event","name":"UpdateProofVerificationGas","inputs":[{"name":"newProofVerificationGas","type":"uint32","indexed":false,"internalType":"uint32"}],"anonymous":false},{"type":"event","name":"UpdateQueryDeadlineInterval","inputs":[{"name":"newQueryDeadlineInterval","type":"uint32","indexed":false,"internalType":"uint32"}],"anonymous":false},{"type":"event","name":"UpdateVerifierAddress","inputs":[{"name":"newAddress","type":"address","indexed":false,"internalType":"address"}],"anonymous":false},{"type":"event","name":"Upgraded","inputs":[{"name":"implementation","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"Withdraw","inputs":[{"name":"payor","type":"address","indexed":true,"internalType":"address"},{"name":"amount","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"payee","type":"address","indexed":false,"internalType":"address"}],"anonymous":false},{"type":"error","name":"AggregateVkeyHashIsNotValid","inputs":[]},{"type":"error","name":"AxiomHeaderVerifierAddressIsZero","inputs":[]},{"type":"error","name":"AxiomProverAddressIsZero","inputs":[]},{"type":"error","name":"AxiomQueryFeeIsTooLarge","inputs":[]},{"type":"error","name":"CallbackHashDoesNotMatchQueryWitness","inputs":[]},{"type":"error","name":"CanOnlyIncreaseGasOnActiveQuery","inputs":[]},{"type":"error","name":"CannotFulfillFromOffchainIfNotInactive","inputs":[]},{"type":"error","name":"CannotFulfillIfNotActive","inputs":[]},{"type":"error","name":"CannotRefundBeforeDeadline","inputs":[]},{"type":"error","name":"CannotRefundIfNotActive","inputs":[]},{"type":"error","name":"CannotRefundIfNotRefundee","inputs":[]},{"type":"error","name":"ComputeResultsHashDoesNotMatch","inputs":[]},{"type":"error","name":"ContractIsFrozen","inputs":[]},{"type":"error","name":"DepositAmountIsZero","inputs":[]},{"type":"error","name":"DepositTooLarge","inputs":[]},{"type":"error","name":"EscrowAmountExceedsBalance","inputs":[]},{"type":"error","name":"GuardianAddressIsZero","inputs":[]},{"type":"error","name":"InsufficientFunds","inputs":[]},{"type":"error","name":"InsufficientGasForCallback","inputs":[]},{"type":"error","name":"MaxFeePerGasIsTooLow","inputs":[]},{"type":"error","name":"MinMaxFeePerGasIsZero","inputs":[]},{"type":"error","name":"NewMaxQueryPriMustBeLargerThanPrevious","inputs":[]},{"type":"error","name":"NotAxiomRole","inputs":[]},{"type":"error","name":"NotProverRole","inputs":[]},{"type":"error","name":"OnlyPayeeCanFulfillOffchainQuery","inputs":[]},{"type":"error","name":"OnlyPayeeCanUnescrow","inputs":[]},{"type":"error","name":"PayeeAddressIsZero","inputs":[]},{"type":"error","name":"PayorAddressIsZero","inputs":[]},{"type":"error","name":"ProofVerificationFailed","inputs":[]},{"type":"error","name":"ProofVerificationGasIsTooLarge","inputs":[]},{"type":"error","name":"ProverAddressIsZero","inputs":[]},{"type":"error","name":"ProverNotAuthorized","inputs":[]},{"type":"error","name":"QueryDeadlineIntervalIsTooLarge","inputs":[]},{"type":"error","name":"QueryHashDoesNotMatchProof","inputs":[]},{"type":"error","name":"QueryIsNotFulfilled","inputs":[]},{"type":"error","name":"QueryIsNotInactive","inputs":[]},{"type":"error","name":"SourceChainIdDoesNotMatch","inputs":[]},{"type":"error","name":"TimelockAddressIsZero","inputs":[]},{"type":"error","name":"UnescrowAmountExceedsEscrowedAmount","inputs":[]},{"type":"error","name":"UnfreezeAddressIsZero","inputs":[]},{"type":"error","name":"VerifierAddressIsZero","inputs":[]},{"type":"error","name":"WithdrawalAmountExceedsFreeBalance","inputs":[]},{"type":"error","name":"WithdrawalAmountIsZero","inputs":[]}]} \ No newline at end of file diff --git a/harness/test/search_chaindata.sh b/harness/test/search_chaindata.sh new file mode 100755 index 00000000..79b9713c --- /dev/null +++ b/harness/test/search_chaindata.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +cd $(git rev-parse --show-toplevel) + +cd harness +source .env + +node dist/cli/index.js search --provider $PROVIDER_URI_1 --output ./output +# node dist/cli/index.js search --provider $PROVIDER_URI_11155111 --include 5658516,5672778,5672780,5672783,5672787,5675149 --output ./output +# node dist/cli/index.js search --provider $PROVIDER_URI_84532 --include 8285121 --output ./output +# node dist/cli/index.js search --provider $PROVIDER_URI_8453 --include 13006428 --output ./output diff --git a/harness/test/unit/goerli.test.ts b/harness/test/unit/goerli.test.ts deleted file mode 100644 index 4085d0fb..00000000 --- a/harness/test/unit/goerli.test.ts +++ /dev/null @@ -1,50 +0,0 @@ -import fs from 'fs'; -import path from 'path'; -import { listDir, makeFileMap } from "../utils"; -import { harness } from "../../src/harness"; - -describe("Goerli unit tests", () => { - if (process.env.PROVIDER_URI_GOERLI === undefined) { - throw new Error("`PROVIDER_URI_GOERLI` environment variable must be defined"); - } - - const inputBasePath = path.resolve("./test/circuits/goerli/input"); - const outputBasePath = path.resolve("./test/unit/goerli/output"); - const files = listDir(inputBasePath); - const fileMap = makeFileMap(files); - - // Delete output files - fs.rmSync(outputBasePath, { recursive: true, force: true }); - - for (let [folder, files] of Object.entries(fileMap)) { - for (let file of files) { - const inputFile = `${inputBasePath}/${folder}/${file}`; - const fileName = file.split(".js")[0]; - const outputBasePathType = `${outputBasePath}/${folder}`; - const outputFileBase = `${outputBasePathType}/${fileName}`; - - test(`Test ${folder}: ${inputFile}`, async () => { - console.log(`Running test: ${inputFile}`) - - // Run the circuit - await harness( - inputFile, - { - outputs: outputBasePathType, - function: "circuit", - chainId: "5", - provider: process.env.PROVIDER_URI_GOERLI, - } - ); - - // Check build file exists - const buildFile = `${outputFileBase}.compiled.json`; - expect(fs.existsSync(buildFile)).toBe(true); - - // Check output file exists - const outputFile = `${outputFileBase}.proven.json`; - expect(fs.existsSync(outputFile)).toBe(true); - }, 180000); - } - } -}); \ No newline at end of file diff --git a/harness/test/unit/sepolia.test.ts b/harness/test/unit/sepolia.test.ts deleted file mode 100644 index 95d3135c..00000000 --- a/harness/test/unit/sepolia.test.ts +++ /dev/null @@ -1,50 +0,0 @@ -import fs from 'fs'; -import path from 'path'; -import { listDir, makeFileMap } from "../utils"; -import { harness } from "../../src/harness"; - -describe("Sepolia unit tests", () => { - if (process.env.PROVIDER_URI_SEPOLIA === undefined) { - throw new Error("`PROVIDER_URI_SEPOLIA` environment variable must be defined"); - } - - const inputBasePath = path.resolve("./test/circuits/sepolia/input"); - const outputBasePath = path.resolve("./test/unit/sepolia/output"); - const files = listDir(inputBasePath); - const fileMap = makeFileMap(files); - - // Delete output files - fs.rmSync(outputBasePath, { recursive: true, force: true }); - - for (let [folder, files] of Object.entries(fileMap)) { - for (let file of files) { - const inputFile = `${inputBasePath}/${folder}/${file}`; - const fileName = file.split(".js")[0]; - const outputBasePathType = `${outputBasePath}/${folder}`; - const outputFileBase = `${outputBasePathType}/${fileName}`; - - test(`Test ${folder}: ${inputFile}`, async () => { - console.log(`Running test: ${inputFile}`) - - // Run the circuit - await harness( - inputFile, - { - outputs: outputBasePathType, - function: "circuit", - chainId: "11155111", - provider: process.env.PROVIDER_URI_SEPOLIA, - } - ); - - // Check build file exists - const buildFile = `${outputFileBase}.compiled.json`; - expect(fs.existsSync(buildFile)).toBe(true); - - // Check output file exists - const outputFile = `${outputFileBase}.proven.json`; - expect(fs.existsSync(outputFile)).toBe(true); - }, 220000); - } - } -}); \ No newline at end of file diff --git a/harness/tsconfig.json b/harness/tsconfig.json index 59fd066d..f61c2286 100644 --- a/harness/tsconfig.json +++ b/harness/tsconfig.json @@ -12,7 +12,7 @@ "es2020", "es6" ], - "preserveSymlinks": true, + "preserveSymlinks": false, "preserveWatchOutput": true, "pretty": false, "strict": true, diff --git a/harness/version.ts b/harness/version.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/package.json b/package.json index aef5e49e..e359eb7e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "axiom-sdk-client", - "version": "2.0.7", + "version": "2.0.9", "description": "Axiom client SDK", "scripts": { "remote": "node -e 'require(\"./scripts/setRemote.js\").setRemote()'", @@ -13,6 +13,7 @@ "author": "Intrinsic Technologies", "license": "MIT", "devDependencies": { - "ethers": "^6.11.1" + "@types/jest": "^29.5.12", + "tsx": "^4.7.1" } -} +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 00000000..5ca6dd2f --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,622 @@ +lockfileVersion: '6.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +devDependencies: + '@types/jest': + specifier: ^29.5.12 + version: 29.5.12 + tsx: + specifier: ^4.7.1 + version: 4.7.1 + +packages: + + /@babel/code-frame@7.24.2: + resolution: {integrity: sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/highlight': 7.24.2 + picocolors: 1.0.0 + dev: true + + /@babel/helper-validator-identifier@7.22.20: + resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/highlight@7.24.2: + resolution: {integrity: sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-validator-identifier': 7.22.20 + chalk: 2.4.2 + js-tokens: 4.0.0 + picocolors: 1.0.0 + dev: true + + /@esbuild/aix-ppc64@0.19.12: + resolution: {integrity: sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [aix] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm64@0.19.12: + resolution: {integrity: sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm@0.19.12: + resolution: {integrity: sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-x64@0.19.12: + resolution: {integrity: sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-arm64@0.19.12: + resolution: {integrity: sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-x64@0.19.12: + resolution: {integrity: sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-arm64@0.19.12: + resolution: {integrity: sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-x64@0.19.12: + resolution: {integrity: sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm64@0.19.12: + resolution: {integrity: sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm@0.19.12: + resolution: {integrity: sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ia32@0.19.12: + resolution: {integrity: sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-loong64@0.19.12: + resolution: {integrity: sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-mips64el@0.19.12: + resolution: {integrity: sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ppc64@0.19.12: + resolution: {integrity: sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-riscv64@0.19.12: + resolution: {integrity: sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-s390x@0.19.12: + resolution: {integrity: sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-x64@0.19.12: + resolution: {integrity: sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/netbsd-x64@0.19.12: + resolution: {integrity: sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/openbsd-x64@0.19.12: + resolution: {integrity: sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/sunos-x64@0.19.12: + resolution: {integrity: sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-arm64@0.19.12: + resolution: {integrity: sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-ia32@0.19.12: + resolution: {integrity: sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-x64@0.19.12: + resolution: {integrity: sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@jest/expect-utils@29.7.0: + resolution: {integrity: sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + jest-get-type: 29.6.3 + dev: true + + /@jest/schemas@29.6.3: + resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@sinclair/typebox': 0.27.8 + dev: true + + /@jest/types@29.6.3: + resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/schemas': 29.6.3 + '@types/istanbul-lib-coverage': 2.0.6 + '@types/istanbul-reports': 3.0.4 + '@types/node': 20.12.7 + '@types/yargs': 17.0.32 + chalk: 4.1.2 + dev: true + + /@sinclair/typebox@0.27.8: + resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} + dev: true + + /@types/istanbul-lib-coverage@2.0.6: + resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} + dev: true + + /@types/istanbul-lib-report@3.0.3: + resolution: {integrity: sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==} + dependencies: + '@types/istanbul-lib-coverage': 2.0.6 + dev: true + + /@types/istanbul-reports@3.0.4: + resolution: {integrity: sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==} + dependencies: + '@types/istanbul-lib-report': 3.0.3 + dev: true + + /@types/jest@29.5.12: + resolution: {integrity: sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==} + dependencies: + expect: 29.7.0 + pretty-format: 29.7.0 + dev: true + + /@types/node@20.12.7: + resolution: {integrity: sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==} + dependencies: + undici-types: 5.26.5 + dev: true + + /@types/stack-utils@2.0.3: + resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} + dev: true + + /@types/yargs-parser@21.0.3: + resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} + dev: true + + /@types/yargs@17.0.32: + resolution: {integrity: sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==} + dependencies: + '@types/yargs-parser': 21.0.3 + dev: true + + /ansi-styles@3.2.1: + resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} + engines: {node: '>=4'} + dependencies: + color-convert: 1.9.3 + dev: true + + /ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + dependencies: + color-convert: 2.0.1 + dev: true + + /ansi-styles@5.2.0: + resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} + engines: {node: '>=10'} + dev: true + + /braces@3.0.2: + resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} + engines: {node: '>=8'} + dependencies: + fill-range: 7.0.1 + dev: true + + /chalk@2.4.2: + resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} + engines: {node: '>=4'} + dependencies: + ansi-styles: 3.2.1 + escape-string-regexp: 1.0.5 + supports-color: 5.5.0 + dev: true + + /chalk@4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + dev: true + + /ci-info@3.9.0: + resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} + engines: {node: '>=8'} + dev: true + + /color-convert@1.9.3: + resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} + dependencies: + color-name: 1.1.3 + dev: true + + /color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + dependencies: + color-name: 1.1.4 + dev: true + + /color-name@1.1.3: + resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} + dev: true + + /color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + dev: true + + /diff-sequences@29.6.3: + resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dev: true + + /esbuild@0.19.12: + resolution: {integrity: sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/aix-ppc64': 0.19.12 + '@esbuild/android-arm': 0.19.12 + '@esbuild/android-arm64': 0.19.12 + '@esbuild/android-x64': 0.19.12 + '@esbuild/darwin-arm64': 0.19.12 + '@esbuild/darwin-x64': 0.19.12 + '@esbuild/freebsd-arm64': 0.19.12 + '@esbuild/freebsd-x64': 0.19.12 + '@esbuild/linux-arm': 0.19.12 + '@esbuild/linux-arm64': 0.19.12 + '@esbuild/linux-ia32': 0.19.12 + '@esbuild/linux-loong64': 0.19.12 + '@esbuild/linux-mips64el': 0.19.12 + '@esbuild/linux-ppc64': 0.19.12 + '@esbuild/linux-riscv64': 0.19.12 + '@esbuild/linux-s390x': 0.19.12 + '@esbuild/linux-x64': 0.19.12 + '@esbuild/netbsd-x64': 0.19.12 + '@esbuild/openbsd-x64': 0.19.12 + '@esbuild/sunos-x64': 0.19.12 + '@esbuild/win32-arm64': 0.19.12 + '@esbuild/win32-ia32': 0.19.12 + '@esbuild/win32-x64': 0.19.12 + dev: true + + /escape-string-regexp@1.0.5: + resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} + engines: {node: '>=0.8.0'} + dev: true + + /escape-string-regexp@2.0.0: + resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} + engines: {node: '>=8'} + dev: true + + /expect@29.7.0: + resolution: {integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/expect-utils': 29.7.0 + jest-get-type: 29.6.3 + jest-matcher-utils: 29.7.0 + jest-message-util: 29.7.0 + jest-util: 29.7.0 + dev: true + + /fill-range@7.0.1: + resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} + engines: {node: '>=8'} + dependencies: + to-regex-range: 5.0.1 + dev: true + + /fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /get-tsconfig@4.7.3: + resolution: {integrity: sha512-ZvkrzoUA0PQZM6fy6+/Hce561s+faD1rsNwhnO5FelNjyy7EMGJ3Rz1AQ8GYDWjhRs/7dBLOEJvhK8MiEJOAFg==} + dependencies: + resolve-pkg-maps: 1.0.0 + dev: true + + /graceful-fs@4.2.11: + resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + dev: true + + /has-flag@3.0.0: + resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} + engines: {node: '>=4'} + dev: true + + /has-flag@4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + dev: true + + /is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + dev: true + + /jest-diff@29.7.0: + resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + chalk: 4.1.2 + diff-sequences: 29.6.3 + jest-get-type: 29.6.3 + pretty-format: 29.7.0 + dev: true + + /jest-get-type@29.6.3: + resolution: {integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dev: true + + /jest-matcher-utils@29.7.0: + resolution: {integrity: sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + chalk: 4.1.2 + jest-diff: 29.7.0 + jest-get-type: 29.6.3 + pretty-format: 29.7.0 + dev: true + + /jest-message-util@29.7.0: + resolution: {integrity: sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/code-frame': 7.24.2 + '@jest/types': 29.6.3 + '@types/stack-utils': 2.0.3 + chalk: 4.1.2 + graceful-fs: 4.2.11 + micromatch: 4.0.5 + pretty-format: 29.7.0 + slash: 3.0.0 + stack-utils: 2.0.6 + dev: true + + /jest-util@29.7.0: + resolution: {integrity: sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.6.3 + '@types/node': 20.12.7 + chalk: 4.1.2 + ci-info: 3.9.0 + graceful-fs: 4.2.11 + picomatch: 2.3.1 + dev: true + + /js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + dev: true + + /micromatch@4.0.5: + resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} + engines: {node: '>=8.6'} + dependencies: + braces: 3.0.2 + picomatch: 2.3.1 + dev: true + + /picocolors@1.0.0: + resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + dev: true + + /picomatch@2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + dev: true + + /pretty-format@29.7.0: + resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/schemas': 29.6.3 + ansi-styles: 5.2.0 + react-is: 18.2.0 + dev: true + + /react-is@18.2.0: + resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} + dev: true + + /resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + dev: true + + /slash@3.0.0: + resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} + engines: {node: '>=8'} + dev: true + + /stack-utils@2.0.6: + resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} + engines: {node: '>=10'} + dependencies: + escape-string-regexp: 2.0.0 + dev: true + + /supports-color@5.5.0: + resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} + engines: {node: '>=4'} + dependencies: + has-flag: 3.0.0 + dev: true + + /supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + dependencies: + has-flag: 4.0.0 + dev: true + + /to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + dependencies: + is-number: 7.0.0 + dev: true + + /tsx@4.7.1: + resolution: {integrity: sha512-8d6VuibXHtlN5E3zFkgY8u4DX7Y3Z27zvvPKVmLon/D4AjuKzarkUBTLDBgj9iTQ0hg5xM7c/mYiRVM+HETf0g==} + engines: {node: '>=18.0.0'} + hasBin: true + dependencies: + esbuild: 0.19.12 + get-tsconfig: 4.7.3 + optionalDependencies: + fsevents: 2.3.3 + dev: true + + /undici-types@5.26.5: + resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + dev: true diff --git a/react/package.json b/react/package.json index 1129df0b..d9badf98 100644 --- a/react/package.json +++ b/react/package.json @@ -1,6 +1,6 @@ { "name": "@axiom-crypto/react", - "version": "2.0.8", + "version": "2.0.9", "description": "React components for Axiom SDK", "author": "Intrinsic Technologies", "license": "MIT", diff --git a/react/src/AxiomCircuitProvider.tsx b/react/src/AxiomCircuitProvider.tsx index 1da94106..79679d70 100644 --- a/react/src/AxiomCircuitProvider.tsx +++ b/react/src/AxiomCircuitProvider.tsx @@ -11,13 +11,12 @@ import { AxiomV2CompiledCircuit, AxiomV2Callback, AxiomV2SendQueryArgs, - AxiomV2ClientOptions, + AxiomV2QueryOptions, DEFAULT_CAPACITY, } from "@axiom-crypto/client"; type AxiomCircuitContextType = { - setOptions: React.Dispatch>, - setParams: (inputs: T, callbackTarget: string, callbackExtraData: string, refundee: string) => void, + setParams: (inputs: T, callbackTarget: string, callbackExtraData: string, caller: string) => void, areParamsSet: boolean, build: () => Promise, builtQuery: AxiomV2SendQueryArgs | null, @@ -46,21 +45,22 @@ function AxiomCircuitProvider({ children: React.ReactNode, }) { const [inputs, setInputs] = useState(null); - const [options, setOptions] = useState(null); + const [options, setOptions] = useState(null); const [callback, setCallback] = useState(null); - const [refundee, setRefundee] = useState(null); + const [caller, setCaller] = useState(null); const [builtQuery, setBuiltQuery] = useState(null); const workerApi = useRef>(); const build = async () => { - if (!inputs || !callback || !refundee) { - console.warn("`inputs` or `callback` or `refundee` not set"); + if (!inputs || !callback || !caller) { + console.warn("`inputs` or `callback` or `caller` not set"); return null; } if (builtQuery !== null) { return null; } + const setup = async () => { const worker = new Worker(new URL("./worker", import.meta.url), { type: "module" }); const MyAxiomCircuit = wrap(worker); @@ -81,10 +81,10 @@ function AxiomCircuitProvider({ const generateQuery = async () => { await workerApi.current?.run(inputs); const res = await workerApi.current?.getSendQueryArgs({ - options: options ?? {refundee}, callbackTarget: callback.target, callbackExtraData: callback.extraData, - callerAddress: refundee, + callerAddress: caller, + options: options ?? {}, }); if (res === undefined) { return null; @@ -100,7 +100,7 @@ function AxiomCircuitProvider({ setBuiltQuery(null); } - const setParams = useCallback((inputs: any, callbackTarget: string, callbackExtraData: string, refundee: string) => { + const setParams = useCallback((inputs: any, callbackTarget: string, callbackExtraData: string, caller: string, options?: AxiomV2QueryOptions) => { if (callbackExtraData === "") { callbackExtraData = "0x"; } @@ -109,13 +109,13 @@ function AxiomCircuitProvider({ target: callbackTarget, extraData: callbackExtraData, }); - setRefundee(refundee); + setCaller(caller); + setOptions(options ?? {}); }, []); const areParamsSet = (inputs !== null && callback !== null); const contextValues = { - setOptions, setParams, areParamsSet, build, diff --git a/scripts/setVersions.js b/scripts/setVersions.js index 67ac7bc1..4162631c 100644 --- a/scripts/setVersions.js +++ b/scripts/setVersions.js @@ -14,6 +14,10 @@ if (setVersion.toLowerCase() === "increment" || setVersion.toLowerCase() === "in } const packages = { + "axiom-sdk-client": { + path: "..", + version: "", + }, "@axiom-crypto/circuit": { path: "../circuit", version: "", @@ -32,7 +36,7 @@ const packages = { }, }; -console.log("setVersion", setVersion); +console.log("setVersions", setVersion); function setVersions() { // Write package version to all paths