> 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/ru/rukovodstva-dlya-razrabotchikov/verify-contracts.md).

# Проверка контрактов

Проверяйте исходный код контрактов Solidity в Rome через размещённый сервис Sourcify — стандартные потоки forge verify-contract и hardhat-verify, значки в обозревателе Via.

Rome использует размещённый сервис [Sourcify](https://sourcify.dev) для верификации. После верификации контракта его исходный код и ABI становятся общедоступными и доступными для воспроизведения, а в обозревателе блоков Rome (Via) появляется значок **✓ Исходный код верифицирован** .

Верификация поддерживает стандартные сценарии работы с `forge verify-contract` и `hardhat-verify` — достаточно указать в них верификатор Rome.

## Адрес верификатора

| Среда                   | URL верификатора                          |
| ----------------------- | ----------------------------------------- |
| Тестовая сеть и Devnet  | `https://verify.testnet.romeprotocol.xyz` |
| Основная сеть (Rubicon) | `https://verify.mainnet.romeprotocol.xyz` |

Один общий экземпляр обслуживает все тестовые сети Rome и Devnet — сеть выбирается с помощью стандартного флага `--chain-id` .

## Foundry

После развертывания (см. [Развертывание контрактов Solidity](https://docs.rome.builders/ru/rukovodstva-dlya-razrabotchikov/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
```

Если конструктор принимает аргументы, передайте их, чтобы байткод совпал:

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

Также можно выполнить верификацию во время развертывания с помощью `forge create … --verify` или `forge script … --verify` (Foundry определяет идентификатор сети по параметру `--rpc-url`).

## Hardhat

`hardhat-verify` входит в состав набора инструментов Hardhat 3. Укажите адрес верификатора Sourcify для Rome в файле `hardhat.config.ts` и выполните команду `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…]
```

В случае успеха верификатор связывает опубликованный исходный код, например: `https://verify.testnet.romeprotocol.xyz/repo-ui/<CHAIN_ID>/<ADDRESS>`.

## Проверка статуса верификации

Обозреватель получает статус верификации через API верификатора. Его можно запросить напрямую:

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

Для верифицированного контракта поле `match` возвращает:

* **`exact_match`** — байткод *и* хеш метаданных совпадают (полное совпадение).
* **`match`** — байткод совпадает, но метаданные немного различаются (при этом контракт подлинный и верифицированный).
* `404` / `null` — не верифицирован.

## Примечания

* В Rome Via (обозревателе) у контрактов, верифицированных через верификатор Rome, отображается их имя.
* Для обновляемых прокси верифицируйте как реализацию, так и сам прокси.
* Для верификации нужны только байткод развернутого контракта, исходный код и параметры компилятора, которые вы указываете, — те же данные, что и для любой EVM-сети.
* Новые сети Rome автоматически подключаются к верификатору. Если вы развернули контракт в новой сети, но верификатор пока не находит её, подождите немного или обратитесь за помощью.


---

# 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/ru/rukovodstva-dlya-razrabotchikov/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.
