> ## Documentation Index
> Fetch the complete documentation index at: https://docs.optimism.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Verify 명령

> 블록 탐색기에서 배포된 컨트랙트 소스 코드를 검증하는 방법을 알아봅니다.

[`bootstrap`](https://docs.optimism.io/ko/chain-operators/tools/op-deployer/usage/bootstrap) 또는 [`apply`](https://docs.optimism.io/ko/chain-operators/tools/op-deployer/usage/apply)로 컨트랙트를 배포한 후에는 `verify` 명령을 사용하여 Etherscan 또는 Blockscout와 같은 블록 탐색기에서 소스 코드를 검증할 수 있습니다. 이 명령은 `forge verify-contract` 바이너리를 사용하며, 생성자 인수 감지와 소스 코드 검증을 자동으로 처리합니다.

## 사용법

`verify` 명령은 다음과 같이 호출할 수 있습니다.

```shell theme={null}
op-deployer verify \
  --l1-rpc-url <l1 rpc url> \
  --input-file <filepath to input .json or state.json file> \
  --verifier-api-key <your api key> \
  --artifacts-locator <l1 forge-artifacts locator> \
  --verifier etherscan
```

Blockscout 검증의 경우(mainnet/sepolia의 기본 URL 사용, API 키 불필요):

```shell theme={null}
op-deployer verify \
  --l1-rpc-url <l1 rpc url> \
  --input-file <filepath to input .json or state.json file> \
  --artifacts-locator <l1 forge-artifacts locator> \
  --verifier blockscout
```

커스텀 블록 탐색기 검증의 경우(Etherscan v2 호환, API 키가 필요할 수 있음):

```shell theme={null}
op-deployer verify \
  --l1-rpc-url <l1 rpc url> \
  --input-file <filepath to input .json or state.json file> \
  --artifacts-locator <l1 forge-artifacts locator> \
  --verifier custom \
  --verifier-url <custom etherscan v2 compatible api url>
```

## CLI 인수

### `--l1-rpc-url`

배포할 L1 체인의 RPC URL을 정의합니다(현재 mainnet과 sepolia만 지원).

### `--input-file`

입력 파일의 전체 경로입니다. 다음 중 하나일 수 있습니다.

* 컨트랙트 이름/주소 쌍이 포함된 단순 JSON 파일(`bootstrap superchain|implementations`의 출력)
* 전체 `state.json` 파일(`apply`의 출력)

verifier는 파일 형식을 자동으로 감지하고 모든 컨트랙트를 추출합니다. `--contract-name` 플래그를 전달하지 않으면 입력 파일의 모든 컨트랙트가 검증됩니다.

예시:

```json theme={null}
{
  "opcmAddress": "0x437d303c20ea12e0edba02478127b12cbad54626",
  "opcmContractsContainerAddress": "0xf89d7ce62fc3a18354b37b045017d585f7e332ab",
  "opcmGameTypeAdderAddress": "0x9aa4b6c0575e978dbe6d6bc31b7e4403ea8bd81d",
  "opcmDeployerAddress": "0x535388c15294dc77a287430926aba5ba5fe6016a",
  "opcmUpgraderAddress": "0x68a7a93750eb56dd043f5baa41022306e6cd50fa",
  "delayedWETHImplAddress": "0x33ddc90167c923651e5aef8b14bc197f3e8e7b56",
  "optimismPortalImplAddress": "0x54b75cb6f44e36768912e070cd9cb995fc887e6c",
  "ethLockboxImplAddress": "0x05484deeb3067a5332960ca77a5f5603df878ced",
  "preimageOracleSingletonAddress": "0xfbcd4b365f97cb020208b5875ceaf6de76ec068b",
  "mipsSingletonAddress": "0xcc50288ad0d79278397785607ed675292dce37b1",
  "systemConfigImplAddress": "0xfb24aa6d99824b2c526768e97b23694aa3fe31d6",
  "l1CrossDomainMessengerImplAddress": "0x957c0bf84fe541efe46b020a6797fb1fb2eaa6ac",
  "l1ERC721BridgeImplAddress": "0x62786d16978436f5d85404735a28b9eb237e63d0",
  "l1StandardBridgeImplAddress": "0x6c9b377c00ec7e6755aec402cd1cfff34fa75728",
  "optimismMintableERC20FactoryImplAddress": "0x3842175f3af499c27593c772c0765f862b909b93",
  "disputeGameFactoryImplAddress": "0x70ed1725abb48e96be9f610811e33ed8a0fa97f9",
  "anchorStateRegistryImplAddress": "0xce2206af314e5ed99b48239559bdf8a47b7524d4",
  "superchainConfigImplAddress": "0x77008cdc99fb1cf559ac33ca3a67a4a2f04cc5ef"
}
```

### `--contract-name`(선택 사항)

검증할 단일 컨트랙트 이름을 지정하며, 입력 파일 내의 컨트랙트 키와 일치해야 합니다. 지정하지 않으면 입력 파일의 모든 컨트랙트가 검증됩니다.

### `--artifacts-locator`

`forge build` 명령의 출력(즉, 컴파일된 바이트코드와 solidity 소스 코드)이 포함된 forge-artifacts의 locator입니다. 로컬 경로(`file://` 접두사), 원격 URL(`http://` 또는 `https://` 접두사), 또는 표준 컨트랙트 태그(`tag://op-contracts/v` 접두사)를 사용할 수 있습니다.

### `--verifier`

검증에 사용할 블록 탐색기입니다. 쉼표로 구분하여 여러 verifier를 지정할 수 있습니다.

옵션:

* `etherscan`(기본값): mainnet/sepolia에 Etherscan을 사용합니다
* `blockscout`: mainnet/sepolia의 기본 Blockscout URL을 사용합니다
* `custom`: 커스텀 Etherscan v2 호환 인스턴스용입니다(`--verifier-url` 필요)

예시:

* 단일 verifier: `--verifier etherscan`
* 여러 verifier: `--verifier etherscan,blockscout`(둘 다에서 검증)

### `--verifier-url`

verifier API URL입니다. 사용 방법은 verifier 유형에 따라 다릅니다.

* `etherscan`: 무시됩니다(chain ID에서 자동으로 결정됨)
* `blockscout`: 선택 사항입니다(기본값은 mainnet/sepolia의 표준 Blockscout URL)
* `custom`: 필수입니다. 예: `https://etherscanv2.compat-api.example.com/api`

## 출력

출력 로그는 콘솔에 다음과 같은 형태로 표시됩니다. 최종 결과에 `numFailed=0`이 표시되면 모든 컨트랙트가 성공적으로 검증된 것입니다.

```sh theme={null}
INFO [03-05|15:56:55.900] Formatting etherscan verify request      name=superchainConfigProxyAddress            address=0x805fc6750ec23bdD58f7BBd6ce073649134C638A
INFO [03-05|15:56:55.900] Opening artifact                         path=Proxy.sol/Proxy.json           name=superchainConfigProxyAddress
INFO [03-05|15:56:55.905] contractName                             name=src/universal/Proxy.sol:Proxy
INFO [03-05|15:56:55.905] Extracting constructor args from initcode address=0x805fc6750ec23bdD58f7BBd6ce073649134C638A argSlots=1
INFO [03-05|15:56:56.087] Contract creation tx hash                txHash=0x71b377ccc11304afc32e1016c4828a34010a0d3d81701c7164fb19525ba4fbc4
INFO [03-05|15:56:56.494] Successfully extracted constructor args  address=0x805fc6750ec23bdD58f7BBd6ce073649134C638A
INFO [03-05|15:56:56.683] Verification request submitted           name=superchainConfigProxyAddress            address=0x805fc6750ec23bdD58f7BBd6ce073649134C638A
INFO [03-05|15:57:02.035] Verification complete                    name=superchainConfigProxyAddress            address=0x805fc6750ec23bdD58f7BBd6ce073649134C638A
INFO [03-05|15:57:07.971] --- COMPLETE ---
INFO [03-05|15:57:07.971] final results                            numVerified=2 numSkipped=1 numFailed=0
```

## 자동 검증

`apply` 또는 `bootstrap` 명령에 `--verify` 플래그를 사용하면 배포 후 컨트랙트를 자동으로 검증할 수 있습니다.

```shell theme={null}
op-deployer apply \
  --workdir ./.deployer \
  --l1-rpc-url <l1 rpc url> \
  --private-key <deployer private key> \
  --verify \
  --verifier-api-key <your api key>
```

이렇게 하면 배포 프로세스가 끝날 때 배포된 모든 컨트랙트가 검증됩니다.

### 다중 verifier 배포

여러 블록 탐색기에서 동시에 검증할 수 있습니다.

```shell theme={null}
op-deployer bootstrap superchain \
  --l1-rpc-url <l1 rpc url> \
  --private-key <deployer private key> \
  --outfile ./superchain.json \
  --superchain-proxy-admin-owner <owner address> \
  --guardian <guardian address> \
  --verify \
  --verifier etherscan,blockscout \
  --verifier-api-key <etherscan api key>
```

이 명령은 다음을 수행합니다.

1. 공유 컨트랙트를 배포합니다
2. Etherscan에서 검증합니다(API 키 사용)
3. Blockscout에서 검증합니다(API 키 불필요)
4. 두 verifier의 결과를 합쳐 보고합니다

## 지원되는 컨트랙트 번들

verify 명령은 이제 모든 컨트랙트 번들을 지원합니다.

* **Shared** 컨트랙트(`bootstrap superchain`에서 배포)
* **Implementations** 컨트랙트(`bootstrap implementations`에서 배포)
* **OpChain** 컨트랙트(`apply`에서 배포, 모든 체인별 컨트랙트 포함)

`apply`의 `state.json` 파일을 사용하면 verifier가 모든 배포 단계의 컨트랙트를 자동으로 추출하고 검증합니다.

## 블록 탐색기 지원

verify 명령은 forge 바이너리를 통해 Etherscan 및 Blockscout 블록 탐색기를 모두 지원하며, 모든 Etherscan v2 호환 API도 지원합니다.
