> 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/ko/developer-guides/verify-contracts.md).

# 컨트랙트 검증

호스팅된 Sourcify 서비스를 통해 Rome에서 Solidity 계약 소스를 검증하세요 — 표준 forge verify-contract 및 hardhat-verify 흐름, Via 탐색기의 배지.

Rome은 호스팅되는 [Sourcify](https://sourcify.dev) 검증 서비스를 운영합니다. 컨트랙트를 검증하면 소스 코드와 ABI를 누구나 재현할 수 있게 공개하고, Rome 블록 탐색기(Via)에 **✓ 소스 검증 완료** 배지가 표시됩니다.

검증에는 표준 `forge verify-contract` 및 `hardhat-verify` 워크플로를 사용할 수 있습니다. Rome의 검증기를 지정하기만 하면 됩니다.

## 검증기 엔드포인트

| 환경           | 검증기 URL                                   |
| ------------ | ----------------------------------------- |
| 테스트넷 및 개발넷   | `https://verify.testnet.romeprotocol.xyz` |
| 메인넷(Rubicon) | `https://verify.mainnet.romeprotocol.xyz` |

하나의 공유 인스턴스가 모든 Rome 테스트넷/개발넷 체인을 지원합니다. 표준 `--chain-id` 플래그로 체인을 선택합니다.

## Foundry

배포한 뒤(참조: [Solidity 컨트랙트 배포](https://docs.rome.builders/ko/developer-guides/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 툴박스에 포함되어 있습니다. Rome의 검증기를 Sourcify 제공자로 지정하려면 `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 메인넷: "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의 검증기에서 검증된 컨트랙트는 Rome Via(익스플로러)에 컨트랙트 이름이 표시됩니다.
* 업그레이드 가능한 프록시의 경우 구현 컨트랙트와 프록시를 모두 검증하세요.
* 검증에는 배포된 컨트랙트의 바이트코드와 제출하는 소스 코드 및 컴파일러 설정만 필요합니다. 이는 모든 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/ko/developer-guides/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.
