diff --git a/packages/hardhat-core/src/internal/hardhat-network/provider/provider.ts b/packages/hardhat-core/src/internal/hardhat-network/provider/provider.ts index 045fc168a0..cb0b1d7d61 100644 --- a/packages/hardhat-core/src/internal/hardhat-network/provider/provider.ts +++ b/packages/hardhat-core/src/internal/hardhat-network/provider/provider.ts @@ -408,10 +408,9 @@ export class EdrProviderWrapper if (stackTrace !== undefined) { error = encodeSolidityStackTrace(response.error.message, stackTrace); // Pass data and transaction hash from the original error - (error as any).data = { - data: response.error.data?.data ?? undefined, - transactionHash: response.error.data?.transactionHash ?? undefined, - }; + (error as any).data = response.error.data?.data ?? undefined; + (error as any).transactionHash = + response.error.data?.transactionHash ?? undefined; } else { if (response.error.code === InvalidArgumentsError.CODE) { error = new InvalidArgumentsError(response.error.message);