> 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 hosting [Sourcify](https://sourcify.dev) layanan verifikasi. Setelah Anda memverifikasi sebuah kontrak, source dan ABI-nya menjadi dapat direproduksi secara publik dan muncul dengan sebuah **✓ Source terverifikasi** lencana di penjelajah blok Rome (Via).

Verifikasi bekerja dengan standar `forge verify-contract` dan `hardhat-verify` alur — Anda cukup 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 setiap chain testnet/devnet Rome — Anda memilih chain dengan standar `--chain-id` flag.

## Foundry

Setelah deploy (lihat [Deploy Solidity Contracts](/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 mengambil argumen, kirimkan argumen tersebut agar bytecode cocok:

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

Anda juga dapat memverifikasi saat deploy dengan `forge create … --verify` atau `forge script … --verify` (Foundry menyimpulkan chain id dari `--rpc-url`).

## Hardhat

`hardhat-verify` disertakan dengan toolbox Hardhat 3. Arahkan provider Sourcify-nya ke verifier Rome di `hardhat.config.ts` dan 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 menautkan source yang dipublikasikan, misalnya. `https://verify.testnet.romeprotocol.xyz/repo-ui/<CHAIN_ID>/<ADDRESS>`.

## Memeriksa status verifikasi

Penjelajah membaca status verifikasi dari API verifier. Anda dapat menanyakannya langsung:

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

Kontrak yang terverifikasi mengembalikan sebuah `kecocokan` field:

* **`exact_match`** — bytecode *dan* cocok hash metadata (cocokan “penuh” yang sempurna).
* **`kecocokan`** — bytecode cocok; metadata sedikit berbeda (tetap merupakan kecocokan yang nyata dan terverifikasi).
* `404` / `null` — tidak terverifikasi.

## Catatan

* Verifikasi hanya memerlukan bytecode kontrak Anda yang telah di-deploy + source dan pengaturan compiler yang Anda kirim — input yang sama seperti pada chain EVM mana pun.
* Chain Rome baru secara otomatis ditambahkan ke verifier; jika Anda deploy ke chain baru dan verifikasi belum 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.
