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

Multicall Error #2930

Closed
1 task done
yogaajs opened this issue Oct 25, 2024 · 6 comments
Closed
1 task done

Multicall Error #2930

yogaajs opened this issue Oct 25, 2024 · 6 comments
Labels
needs reproduction Misc: Needs Reproduction

Comments

@yogaajs
Copy link

yogaajs commented Oct 25, 2024

Check existing issues

Viem Version

2.21.35

Current Behavior

When I call Multicall to read contract, with this addresses:

[
    "0x6624d3ced12d84bd6423b2b38d9eb272ee036cf8",
    "0x09e18da172ce3d09e0107950980f476a9ca7f55b",
]

Use this ABI:

parseAbi([

    // Common
    "function owner() view returns (address)",

    // Token
    "function name() view returns (string)",
    "function name() view returns (bytes32)",
    "function symbol() view returns (string)",
    "function symbol() view returns (bytes32)",
    "function decimals() view returns (uint8)",
    "function totalSupply() view returns (uint256)",

    // Pool
    "function token0() view returns (address)",
    "function token1() view returns (address)",
]);

This error happened:

{
  cause: {
    cause: {
      details: "out of gas",
      docsPath: undefined,
      metaMessages: ...,
      shortMessage: "Missing or invalid parameters.\nDouble check you have provided the correct parameters.",
      version: "2.21.35",
      name: "InvalidInputRpcError",
      code: -32000,
    },
    details: "out of gas",
    docsPath: undefined,
    metaMessages: ...,
    shortMessage: "Missing or invalid parameters.\nDouble check you have provided the correct parameters.",
    version: "2.21.35",
    name: "CallExecutionError",
  },
  details: "out of gas",
  docsPath: "/docs/contract/readContract",
  metaMessages: ...,
  shortMessage: "Missing or invalid parameters.\nDouble check you have provided the correct parameters.",
  version: "2.21.35",
  name: "ContractFunctionExecutionError",
  abi: ...,
  args: [...],
  contractAddress: "0xca11bde05977b3631167028862be2a173976ca11",
  formattedArgs: undefined,
  functionName: "aggregate3",
  sender: undefined,
}

Expected Behavior

But if I call each address separately, everything's good...

Steps To Reproduce

No response

Link to Minimal Reproducible Example

https://stackblitz.com/edit/viem-getting-started-sxz5j5?file=viem.ts

No response

Anything else?

No response

@jxom jxom added the needs reproduction Misc: Needs Reproduction label Oct 26, 2024
Copy link
Contributor

Hello @yogaajs.

Please provide a minimal reproduction using StackBlitz, TypeScript Playground (for type issues), or a separate minimal GitHub repository.

Minimal reproductions are required as they save us a lot of time reproducing your config/environment and issue, and allow us to help you faster.

Once a minimal reproduction is added, a team member will confirm it works, then re-open the issue.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 26, 2024
@yogaajs
Copy link
Author

yogaajs commented Oct 26, 2024

@yogaajs
Copy link
Author

yogaajs commented Oct 26, 2024

It’s interesting—when I test with the following:

const addresses = [
    // "0x6624d3ced12d84bd6423b2b38d9eb272ee036cf8",
    // "0x6624d3ced12d84bd6423b2b38d9eb272ee036cf8",
    "0x09e18da172ce3d09e0107950980f476a9ca7f55b",
    "0x09e18da172ce3d09e0107950980f476a9ca7f55b",
];

everything works fine. However, when I switch to:

const addresses = [
    "0x6624d3ced12d84bd6423b2b38d9eb272ee036cf8",
    "0x6624d3ced12d84bd6423b2b38d9eb272ee036cf8",
    // "0x09e18da172ce3d09e0107950980f476a9ca7f55b",
    // "0x09e18da172ce3d09e0107950980f476a9ca7f55b",
];

it fails. Interestingly, if I only call "0x6624d3ced12d84bd6423b2b38d9eb272ee036cf8" on its own, it succeeds.

Additionally, when I call an Externally Owned Account (EOA), it works as expected (and it's not a contract...)

The challenge is that I don’t know in advance which addresses I’ll need to call, as the selection is random. If a batch (or “chunk”) fails, it doesn’t specify which address caused the failure, making it difficult to isolate the problem. Consequently, I can’t filter out problematic addresses easily. And I have approximately 50 addresses in each Multicall

@yogaajs
Copy link
Author

yogaajs commented Oct 28, 2024

Same error for another lib

joshstevens19/ethereum-multicall#14

@yogaajs
Copy link
Author

yogaajs commented Oct 28, 2024

For this contract, with only one contract in call, I got the same error

https://basescan.org/address/0x9140adceabb0f98a8d3639e42b56bf23d4cae6d0

Copy link
Contributor

This issue has been locked since it has been closed for more than 14 days.

If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Viem version. If you have any questions or comments you can create a new discussion thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs reproduction Misc: Needs Reproduction
Projects
None yet
Development

No branches or pull requests

2 participants