> 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 컨트랙트 배포](/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는 다음에서 체인 ID를 추론합니다 `--rpc-url`).

## Hardhat

`hardhat-verify` Hardhat 3 툴박스와 함께 제공됩니다. Sourcify 프로바이더를 Rome의 검증기로 지정하세요. `hardhat.config.ts` 그리고 다음을 실행하세요 `hardhat verify`:

```typescript
export default defineConfig({
  // …플러그인, solidity, 네트워크…
  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>
```

검증된 계약은 다음을 반환합니다: `일치` 필드:

* **`exact_match`** — 바이트코드 *및* 메타데이터 해시가 일치함(완벽한 "전체" 일치).
* **`일치`** — 바이트코드는 일치하지만, 메타데이터가 약간 다릅니다(여전히 진짜 검증된 일치입니다).
* `404` / `null` — 검증되지 않음.

## 참고

* 검증에는 계약의 배포된 바이트코드와 제출한 소스 및 컴파일러 설정만 있으면 됩니다 — 어떤 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.
