# Debugging smart contract using Hardhat?

&#x20;         In this guide, you'll explore how to debug smart contracts using Hardhat's built-in debugging tools.

## Learning Goals

&#x20;         By the end of this guide, you will be able to:

* Utilize `console.log` to output debugging information
* Identify common errors and understand how to resolve them
* Distinguish between errors originating from the contract and those caused by the test code

## Overview

&#x20;         Debugging smart contracts can be complex, particularly in the context of decentralized applications and blockchain systems. Fortunately, **Hardhat** offers robust tools that make the process more manageable.

&#x20;         In this tutorial, you'll dive into Hardhat's core debugging features and learn practical techniques for identifying and fixing common issues in your smart contracts.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.icb.network/build-on-icb-network/hardhat/debugging-smart-contract-using-hardhat.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
