> 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/id/panduan-pengembang/verify-contracts.md).

# Verifikasi Kontrak

Verifikasi sumber kontrak Solidity di Rome melalui layanan Sourcify yang di-host — alur standar forge verify-contract dan hardhat-verify, badge di penjelajah Via.

Rome menjalankan layanan [Sourcify](https://sourcify.dev) verifikasi yang dihosting. Setelah memverifikasi kontrak, kode sumber dan ABI-nya dapat direproduksi secara publik dan akan ditampilkan dengan lencana **✓ Source verified** di penjelajah blok Rome (Via).

Verifikasi berfungsi dengan alur standar `forge verify-contract` dan `hardhat-verify` — Anda hanya perlu mengarahkannya ke verifier Rome.

## Endpoint verifier

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

Satu instance bersama melayani semua chain testnet/devnet Rome — Anda memilih chain dengan flag standar `--chain-id` .

## Foundry

Setelah melakukan deployment (lihat [Deploy Kontrak Solidity](https://docs.rome.builders/id/panduan-pengembang/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
```

Jika konstruktor menerima argumen, sertakan argumen tersebut agar bytecode cocok:

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

Anda juga dapat melakukan verifikasi saat deployment dengan `forge create … --verify` atau `forge script … --verify` (Foundry menyimpulkan ID chain dari `--rpc-url`).

## Hardhat

`hardhat-verify` disertakan dalam toolbox Hardhat 3. Arahkan penyedia Sourcify-nya ke verifier Rome di `hardhat.config.ts` lalu jalankan `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…]
```

Jika berhasil, verifier akan menautkan source code yang dipublikasikan, misalnya `https://verify.testnet.romeprotocol.xyz/repo-ui/<CHAIN_ID>/<ADDRESS>`.

## Memeriksa status verifikasi

Explorer membaca status verifikasi dari API verifier. Anda dapat memeriksanya secara langsung:

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

Kontrak yang terverifikasi akan mengembalikan kolom `match` :

* **`exact_match`** — bytecode *dan* hash metadata cocok (cocok sempurna, "penuh").
* **`match`** — bytecode cocok; metadata sedikit berbeda (tetap merupakan kecocokan yang valid dan terverifikasi).
* `404` / `null` — belum terverifikasi.

## Catatan

* Kontrak yang diverifikasi di verifier Rome akan menampilkan nama kontraknya di Rome Via (explorer).
* Untuk proxy yang dapat di-upgrade, verifikasi implementasi dan proxy-nya.
* Verifikasi hanya memerlukan bytecode kontrak yang telah di-deploy beserta source code dan pengaturan compiler yang Anda kirimkan—input yang sama seperti pada rantai EVM mana pun.
* Rantai Rome baru ditambahkan ke verifier secara otomatis; jika Anda melakukan deployment ke rantai baru dan verifikasi belum dapat menemukannya, tunggu sebentar atau hubungi kami.


---

# 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/id/panduan-pengembang/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.
