> 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/pt-br/guias-do-desenvolvedor/verify-contracts.md).

# Verificar contratos

Verifique o código-fonte de contratos Solidity na Rome via o serviço Sourcify hospedado — fluxos padrão forge verify-contract e hardhat-verify, selos no explorer Via.

Rome opera um serviço hospedado [Sourcify](https://sourcify.dev) de verificação. Depois que você verifica um contrato, seu source e ABI se tornam reproduzíveis publicamente e aparecem com um **✓ Source verificado** selo no explorador de blocos da Rome (Via).

A verificação funciona com o padrão `forge verify-contract` e `hardhat-verify` fluxos — basta apontá-los para o verificador da Rome.

## Endpoint do verificador

| Ambiente          | URL do verificador                        |
| ----------------- | ----------------------------------------- |
| Testnet & Devnet  | `https://verify.testnet.romeprotocol.xyz` |
| Mainnet (Rubicon) | `https://verify.mainnet.romeprotocol.xyz` |

Uma instância compartilhada atende a todas as chains de testnet/devnet da Rome — você seleciona a chain com o padrão `--chain-id` flag.

## Foundry

Após implantar (veja [Deploy de Contratos Solidity](/pt-br/guias-do-desenvolvedor/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
```

Se o construtor recebeu argumentos, passe-os para que o bytecode corresponda:

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

Você também pode verificar no momento da implantação com `forge create … --verify` ou `forge script … --verify` (O Foundry infere o chain id a partir de `--rpc-url`).

## Hardhat

`hardhat-verify` vem com a toolbox do Hardhat 3. Aponte seu provider Sourcify para o verificador da Rome em `hardhat.config.ts` e execute `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…]
```

Em caso de sucesso, o verificador vincula o source publicado, por exemplo `https://verify.testnet.romeprotocol.xyz/repo-ui/<CHAIN_ID>/<ADDRESS>`.

## Verificando o status da verificação

O explorador lê o status da verificação pela API do verificador. Você pode consultá-la diretamente:

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

Um contrato verificado retorna um `match` campo:

* **`exact_match`** — bytecode *e* correspondência do hash de metadata (uma correspondência perfeita, "completa").
* **`match`** — o bytecode corresponde; a metadata difere levemente (ainda assim uma correspondência genuína e verificada).
* `404` / `null` — não verificado.

## Observações

* A verificação precisa apenas do bytecode implantado do seu contrato + do source e das configurações do compilador que você enviar — os mesmos inputs de qualquer chain EVM.
* Novas chains da Rome são integradas ao verificador automaticamente; se você implantar em uma chain nova e a verificação ainda não a encontrar, aguarde um pouco ou entre em contato.


---

# 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/pt-br/guias-do-desenvolvedor/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.
