> 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

Rome menjalankan layanan hosted [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 hanya perlu mengarahkannya ke verifier Rome.

## Titik akhir verifier

| Lingkungan       | URL verifier                              |
| ---------------- | ----------------------------------------- |
| Testnet & Devnet | `https://verify.testnet.romeprotocol.xyz` |

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

## Foundry

Setelah melakukan deployment (lihat [Deploy Kontrak Solidity](/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, teruskan argumen tersebut agar bytecode cocok:

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

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

## Hardhat

`hardhat-verify` disertakan dengan toolbox Hardhat 3. Arahkan penyedia 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",
    },
  },
});
```

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

Explorer 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` kolom:

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

## Catatan

* Verifikasi hanya memerlukan bytecode kontrak yang sudah dideploy + source dan pengaturan compiler yang Anda kirim — input yang sama seperti pada chain EVM mana pun.
* Chain Rome baru otomatis di-onboard ke verifier; jika Anda melakukan 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.rome.builders/id/panduan-pengembang/verify-contracts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
