> 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/de/entwicklerleitfaden/verify-contracts.md).

# Verträge verifizieren

Verifiziere den Solidity-Contract-Quellcode auf Rome über den gehosteten Sourcify-Service — standardmäßige forge verify-contract- und hardhat-verify-Abläufe, Badges im Via-Explorer.

Rome betreibt einen gehosteten [Sourcify](https://sourcify.dev) Verifizierungsdienst. Sobald du einen Contract verifizierst, werden sein Quellcode und ABI öffentlich reproduzierbar und erscheinen mit einem **✓ Quelle verifiziert** Badge im Rome-Block-Explorer (Via).

Die Verifizierung funktioniert mit dem Standard `forge verify-contract` und `hardhat-verify` Abläufe — du musst sie nur auf den Verifier von Rome richten.

## Verifier-Endpunkt

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

Eine gemeinsame Instanz bedient jede Rome-Testnet-/Devnet-Chain — du wählst die Chain mit dem Standard `--chain-id` Flag.

## Foundry

Nach dem Deployen (siehe [Solidity-Verträge deployen](/de/entwicklerleitfaden/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
```

Wenn der Konstruktor Argumente angenommen hat, übergib sie, damit der Bytecode übereinstimmt:

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

Du kannst auch zum Zeitpunkt des Deployments verifizieren mit `forge create … --verify` oder `forge script … --verify` (Foundry leitet die Chain-ID aus `--rpc-url`).

## Hardhat

`hardhat-verify` wird mit der Hardhat-3-Toolbox ausgeliefert. Richte seinen Sourcify-Provider in Rome's Verifier aus unter `hardhat.config.ts` und führe aus `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…]
```

Bei Erfolg verlinkt der Verifier den veröffentlichten Quellcode, z. B. `https://verify.testnet.romeprotocol.xyz/repo-ui/<CHAIN_ID>/<ADDRESS>`.

## Überprüfen des Verifizierungsstatus

Der Explorer liest den Verifizierungsstatus über die API des Verifiers. Du kannst ihn direkt abfragen:

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

Ein verifizierter Contract gibt ein `Match` Feld zurück:

* **`exact_match`** — Bytecode *und* Übereinstimmung des Metadaten-Hashes (eine perfekte, „vollständige“ Übereinstimmung).
* **`Match`** — Bytecode stimmt überein; Metadaten unterscheiden sich leicht (immer noch eine echte, verifizierte Übereinstimmung).
* `404` / `null` — nicht verifiziert.

## Hinweise

* Die Verifizierung benötigt nur den bereitgestellten, deployten Bytecode deines Contracts sowie den Quellcode und die Compiler-Einstellungen — dieselben Eingaben wie bei jeder EVM-Chain.
* Neue Rome-Chains werden automatisch beim Verifier aufgenommen; wenn du auf einer frischen Chain deployt hast und die Verifizierung sie noch nicht finden kann, warte kurz oder melde dich.


---

# 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/de/entwicklerleitfaden/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.
