Skip to content

ErrorDecoder fails to capture custom errors on Hardhat local network #12

@AhmadFarazWeb3Developer

Description

Hi,

I am using this library, and it works well for capturing custom errors reverted from contracts deployed on testnets such as Sepolia, Polygon Amoy, and Avalanche Fuji.

However, I am facing an issue when testing the same contracts on a Hardhat localhost network. Initially, I thought this might be a configuration problem on my side. But when I deployed the contracts to a live testnet, the same configuration was able to capture the custom errors correctly.

Here is the code I am using:

const errorDecoder = ErrorDecoder.create([
  factoryAbi,
  fractionalNftVaultAbi,
  vaultTokenAbi,
  fractionalNFTAbi,
]);

const decodedError: DecodedError = await errorDecoder.decode(error);

I would appreciate guidance on how custom error decoding should work with Hardhat’s local network. If the current library is not compatible with Hardhat localhost, it would be great to update it to make this process more streamlined.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions