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

MultipleMatchingNetworksError in Kairos network #5768

Open
aiiiden opened this issue Sep 21, 2024 · 0 comments
Open

MultipleMatchingNetworksError in Kairos network #5768

aiiiden opened this issue Sep 21, 2024 · 0 comments
Assignees

Comments

@aiiiden
Copy link

aiiiden commented Sep 21, 2024

Version of Hardhat

2.22.11

What happened?

When I try to use hre.viem.getContractAt in kairos network (chainId: 1_001), this error occur.

MultipleMatchingNetworksError: Multiple networks with chain id 1001 found. You can override the chain by passing it as a parameter to the client getter:

import { someChain } from "viem/chains";
const client = await hre.viem.getPublicClient({
  chain: someChain,
  ...
});

It seems like there is a duplicated chains definition in viem, so this might be happened.
I want to find the way how to bypass this issue.

const contract = await hre.viem.getContractAt(
    'ContractName',
    '0x....',
    {
      client: {
        public: await hre.viem.getPublicClient({
          chain: kairos,
        }),
      },
    },
  );

I tried this, but this is not helpful

Minimal reproduction steps

Try hre.viem.getContractAt in Kairos(chainId: 1_001).

Search terms

No response

@aiiiden aiiiden changed the title MultipleMatchingNetworksError in Kairos network MultipleMatchingNetworksError in Kairos network Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

2 participants