> For the complete documentation index, see [llms.txt](https://docs.rome.builders/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rome.builders/es/guias-para-desarrolladores/verify-contracts.md).

# Verificar contratos

Verifica el código fuente de un contrato Solidity en Rome mediante el servicio Sourcify alojado: flujos estándar de forge verify-contract y hardhat-verify, insignias en el explorador Via.

Rome ejecuta un servicio alojado de [Sourcify](https://sourcify.dev) para la verificación. Una vez que verificas un contrato, su código fuente y su ABI se pueden reproducir públicamente y aparecen con la insignia **✓ Código fuente verificado** en el explorador de bloques de Rome (Via).

La verificación funciona con los flujos estándar de `forge verify-contract` y `hardhat-verify` ; solo tienes que configurarlos para usar el verificador de Rome.

## Punto de conexión del verificador

| Entorno           | URL del verificador                       |
| ----------------- | ----------------------------------------- |
| Testnet y Devnet  | `https://verify.testnet.romeprotocol.xyz` |
| Mainnet (Rubicon) | `https://verify.mainnet.romeprotocol.xyz` |

Una instancia compartida sirve a todas las cadenas de testnet y devnet de Rome: selecciona la cadena con la opción estándar `--chain-id`  .

## Foundry

Después de desplegar (consulta [Desplegar contratos de Solidity](https://docs.rome.builders/es/guias-para-desarrolladores/deploy-solidity.md)):

```bash
forge verify-contract <CONTRACT_ADDRESS> src/MyContract.sol:MyContract \
  --verifier sourcify \
  --verifier-url https://verify.testnet.romeprotocol.xyz/ \
  --chain-id <YOUR_CHAIN_ID> \
  --compiler-version 0.8.20
```

Si el constructor recibió argumentos, pásalos para que coincida el código de bytes:

```bash
  --constructor-args $(cast abi-encode "constructor(uint256)" 42)
```

También puedes verificar durante el despliegue con `forge create … --verify` o `forge script … --verify` (Foundry infiere el ID de cadena a partir de `--rpc-url`).

## Hardhat

`hardhat-verify` viene incluido con la caja de herramientas de Hardhat 3. Configura el proveedor Sourcify para que use el verificador de Rome en `hardhat.config.ts` y ejecuta `hardhat verify`:

```typescript
export default defineConfig({
  // …plugins, solidity, networks…
  verify: {
    etherscan: { enabled: false },
    blockscout: { enabled: false },
    sourcify: {
      enabled: true,
      apiUrl: "https://verify.testnet.romeprotocol.xyz",   // Rubicon mainnet: "https://verify.mainnet.romeprotocol.xyz"
    },
  },
});
```

```bash
npx hardhat verify --network <your-network> <CONTRACT_ADDRESS> [constructor args…]
```

Si la verificación se realiza correctamente, el verificador enlaza el código fuente publicado, por ejemplo: `https://verify.testnet.romeprotocol.xyz/repo-ui/<CHAIN_ID>/<ADDRESS>`.

## Consultar el estado de verificación

El explorador obtiene el estado de verificación de la API del verificador. Puedes consultarlo directamente:

```bash
curl https://verify.testnet.romeprotocol.xyz/v2/contract/<CHAIN_ID>/<ADDRESS>
```

Un contrato verificado devuelve un campo `match` :

* **`exact_match`** — coincide el código de bytes *y* el hash de los metadatos (una coincidencia perfecta, «completa»).
* **`match`** — coincide el código de bytes; los metadatos difieren ligeramente (sigue siendo una coincidencia auténtica y verificada).
* `404` / `null` — no está verificado.

## Notas

* Los contratos verificados en el verificador de Rome muestran el nombre del contrato en Rome Via (el explorador).
* En el caso de los proxies actualizables, verifica tanto la implementación como el proxy.
* Para verificar solo necesitas el código de bytes desplegado de tu contrato, el código fuente y la configuración del compilador que envíes: las mismas entradas que en cualquier cadena EVM.
* Las nuevas cadenas de Rome se incorporan automáticamente al verificador. Si despliegas en una cadena nueva y el verificador aún no la encuentra, espera un poco o ponte en contacto con nosotros.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rome.builders/es/guias-para-desarrolladores/verify-contracts.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
