Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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