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

A Rome executa um serviço hospedado de [Sourcify](https://sourcify.dev) verificação. Depois que você verifica um contrato, o código-fonte e a ABI dele podem ser reproduzidos publicamente e aparecem com o selo **✓ Código-fonte verificado** no explorador de blocos da Rome (Via).

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

## Endpoint do verificador

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

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

## Foundry

Depois de fazer a implantação (consulte [Implantar contratos Solidity](https://docs.rome.builders/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, informe-os para que o bytecode corresponda:

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

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

## Hardhat

`hardhat-verify` vem incluído no toolbox do Hardhat 3. Aponte o provedor 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…]
```

Após a verificação bem-sucedida, o verificador vincula o código-fonte publicado, por exemplo: `https://verify.testnet.romeprotocol.xyz/repo-ui/<CHAIN_ID>/<ADDRESS>`.

## Verificar o status da verificação

O explorador consulta o status da verificação na API do verificador. Você pode consultá-lo diretamente:

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

Um contrato verificado retorna um campo `match` :

* **`exact_match`** — correspondência do bytecode *e do* hash dos metadados (uma correspondência perfeita, "completa").
* **`match`** — o bytecode corresponde; os metadados apresentam pequenas diferenças (ainda é uma correspondência genuína e verificada).
* `404` / `null` — não verificado.

## Observações

* Os contratos verificados no verificador da Rome exibem o nome do contrato na Rome Via (o explorador).
* Para proxies atualizáveis, verifique também a implementação, além do proxy.
* A verificação precisa apenas do bytecode implantado do seu contrato, do código-fonte e das configurações do compilador que você enviar — as mesmas informações exigidas em qualquer cadeia EVM.
* As novas cadeias da Rome são adicionadas automaticamente ao verificador. Se você implantar em uma cadeia recém-criada e a verificação ainda não a encontrar, aguarde um pouco ou entre em contato conosco.


---

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