# Hardhat

**Hardhat** es un entorno de desarrollo diseñado para Ethereum que se destaca por ser flexible, extensible y rápido. Es una herramienta esencial para aquellos que trabajan en el desarrollo de contratos inteligentes.

Si estás trabajando con Base, puedes utilizar **Hardhat** para editar, compilar, depurar y, finalmente, desplegar tus contratos inteligentes.

#### Usando Hardhat con Base

Para configurar **Hardhat** y que sea compatible con Base, es necesario hacer algunas modificaciones en el archivo de configuración `hardhat.config.ts` de tu proyecto. A continuación, te muestro cómo añadir Base como una red:

```typescript
typescriptCopy codenetworks: {
  // Configuración para mainnet
  "base-mainnet": {
    url: 'https://mainnet.base.org',
    accounts: [process.env.WALLET_KEY as string],
    gasPrice: 1000000000,
  },

  // Configuración para testnet
  "base-goerli": {
    url: 'https://goerli.base.org',
    accounts: [process.env.PRIVATE_KEY as string],
    gasPrice: 1000000000,
  },

  // Configuración para entorno de desarrollo local
  "base-local": {
    url: 'http://localhost:8545',
    accounts: [process.env.PRIVATE_KEY as string],
    gasPrice: 1000000000,
  },
},
defaultNetwork: "base-local",
```

**INFO:**\
Si deseas obtener una guía detallada sobre cómo utilizar **Hardhat** para desplegar contratos en Base, te recomiendo que consultes [Desplegando un Contrato Inteligente](https://docs.base.org/guides/deploy-smart-contracts).

Espero que esta reescritura te ayude a entender mejor cómo configurar y utilizar **Hardhat** con Base. ¡Buena suerte en tu desarrollo!


---

# 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://base-es.gitbook.io/base/overview/cadena-de-herramientas/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.
