> 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 [Sourcify](https://sourcify.dev) de verificación. Una vez que verificas un contrato, su código fuente y ABI se vuelven reproducibles públicamente y aparecen con una **✓ Código fuente verificado** insignia 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 apuntarlos al verificador de Rome.

## Punto final del verificador

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

Una única instancia compartida sirve para todas las cadenas de testnet/devnet de Rome — seleccionas la cadena con la opción estándar `--chain-id` .

## Foundry

Después de desplegar (consulta [Deploy Solidity Contracts](/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 el bytecode coincida:

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

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

## Hardhat

`hardhat-verify` incluye la toolbox de Hardhat 3. Apunta su proveedor de Sourcify al verificador de Rome en `hardhat.config.ts` y ejecuta `hardhat verify`:

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

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

Si tiene éxito, el verificador enlaza el código fuente publicado, p. ej.: `https://verify.testnet.romeprotocol.xyz/repo-ui/<CHAIN_ID>/<ADDRESS>`.

## Comprobando el estado de verificación

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

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

Un contrato verificado devuelve una `coincidencia` campo:

* **`coincidencia_exacta`** — bytecode *y* coincidencia del hash de metadatos (una coincidencia perfecta, "completa").
* **`coincidencia`** — el bytecode coincide; los metadatos difieren ligeramente (sigue siendo una coincidencia auténtica y verificada).
* `404` / `null` — no verificado.

## Notas

* La verificación solo necesita el bytecode 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 al verificador automáticamente; si despliegas en una cadena nueva y la verificación aún no la encuentra, espera un poco o ponte en contacto.


---

# 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.
