Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Fix multicall on base #876

Open
taarushv opened this issue May 11, 2024 · 1 comment
Open

[Bug] Fix multicall on base #876

taarushv opened this issue May 11, 2024 · 1 comment

Comments

@taarushv
Copy link

taarushv commented May 11, 2024

Not sure if there's a way to manually set the multicall contract for each network but it doesn't seem to work out of the box with base, forcing me to create/use a custom viem client. Replacing the client (to viem with base as the defined chain) below fixes my issue, despite using the same RPC on both runs

    const results = await client.multicall({
        contracts: [
          {
            ...ClubsV2Contract,
            functionName: "name",
            args: [event.args.id],
          },
          {
            ...ClubsV2Contract,
            functionName: "uris",
            args: [event.args.id],
          },
          {
            ...ClubsV2Contract,
            functionName: "coefficients",
            args: [event.args.id],
          }
        ],
      })

"@ponder/core": "^0.4.22"

@0xOlias
Copy link
Collaborator

0xOlias commented May 12, 2024

Got it. We're planning to make it possible to pass a viem Chain as an option to networks, which would solve this issue. Still working out the details of the API and migration path, cc @kyscott18.

In the meantime, you might be able to construct the multicall request using context.client.readContract, which means you'd still benefit from caching. The custom client approach will slow down reindexing significantly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants