# Hardhat

Hardhat is a development environment to compile, deploy, test, and debug your smart contract. It helps developers manage and automate the recurring tasks that are inherent to the process of building smart contracts and dApps, as well as easily introducing more functionality around this workflow. This means compiling, running and testing smart contracts at the very core.

More information can be found on Hardhat's official documentation [here](https://hardhat.org/getting-started/#overview)

## Configuration for KardiaChain

When run, Hardhat will read configuration from `hardhat.config.js` file. To set up your config, you have to export an object from that.

Configuration for KardiaChain network can be as simple as below

```json
module.exports = {
  defaultNetwork: "kardiachain",
  networks: {
    hardhat: {
    },
    kardiachain: {
      url: "https://rpc.kardiachain.io",
      accounts: ["YOUR_PRIVATE_KEY"]
    }
  },
  solidity: {
    version: "0.8.0", // Recommended version >= 0.5.0
    settings: {
      optimizer: {
        enabled: true,
        runs: 200
      }
    }
  }
}
```

More detailed config such as `gas`, `gasPrice`... can be found in Hardhat's documentation for configuration [here](https://hardhat.org/config/)


---

# 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.kardiachain.io/docs/archived-docs/tutorials/smart-contract-development/dev-environment/ide-and-tools/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.
