From 0762a0209b7148569b83ca68afaf12ccee140fb5 Mon Sep 17 00:00:00 2001 From: Muang Date: Fri, 31 Jul 2026 23:35:11 +0900 Subject: [PATCH] Make public deployment verification explicit on GIWA Constraint: GIWA Sepolia uses a Blockscout endpoint that Foundry cannot safely infer from --verify alone. Rejected: Running the generic GIWA Deploy.s.sol example | it bypasses Corner Store artifact and post-deployment verification handling. Confidence: high Scope-risk: narrow Directive: Preserve network-specific verifier selection as explicit deployment input. Tested: bash -n; wrapper help output; git diff --check Not-tested: live GIWA broadcast and Blockscout submission --- .env.testnet.example | 3 +++ docs/testnet-deployment.md | 19 +++++++++++++++++-- howtodeploy.md | 10 ++++++++-- scripts/deploy-testnet-rfq.sh | 12 +++++++++++- 4 files changed, 39 insertions(+), 5 deletions(-) diff --git a/.env.testnet.example b/.env.testnet.example index ef6b3ce..f4b6281 100644 --- a/.env.testnet.example +++ b/.env.testnet.example @@ -2,6 +2,9 @@ RPC_URL= CHAIN_ID= +# Optional explorer source verification. GIWA Sepolia uses Blockscout. +BLOCKSCOUT_API_URL=https://sepolia-explorer.giwa.io/api + # Foundry sender address. Import its key with: # cast wallet import corner-store-testnet --interactive CORNER_STORE_TESTNET_DEPLOYER= diff --git a/docs/testnet-deployment.md b/docs/testnet-deployment.md index 792ec73..c0f5df6 100644 --- a/docs/testnet-deployment.md +++ b/docs/testnet-deployment.md @@ -214,8 +214,23 @@ scripts/deploy-testnet-rfq.sh \ --verify ``` -Custom explorers may require a verifier URL or Sourcify instead. Use the -network's official instructions; never commit explorer credentials. +GIWA Sepolia uses Blockscout and requires its official verifier endpoint: + +```sh +export BLOCKSCOUT_API_URL=https://sepolia-explorer.giwa.io/api + +scripts/deploy-testnet-rfq.sh \ + --rpc-url "$RPC_URL" \ + --chain-id "$CHAIN_ID" \ + --account corner-store-giwa \ + --broadcast \ + --verify \ + --verifier blockscout \ + --verifier-url "$BLOCKSCOUT_API_URL" +``` + +Other custom explorers may require a different verifier URL or Sourcify. Use +the network's official instructions; never commit explorer credentials. ## Deployment Outputs for a Hackathon Submission diff --git a/howtodeploy.md b/howtodeploy.md index cf6bc0f..3dcf694 100644 --- a/howtodeploy.md +++ b/howtodeploy.md @@ -148,6 +148,7 @@ ls -la .env.testnet.example scripts/deploy-testnet-rfq.sh ```dotenv RPC_URL=https://sepolia-rpc.giwa.io CHAIN_ID=91342 +BLOCKSCOUT_API_URL=https://sepolia-explorer.giwa.io/api # cast wallet address --account corner-store-giwa 결과 CORNER_STORE_TESTNET_DEPLOYER=0x... @@ -259,10 +260,15 @@ scripts/deploy-testnet-rfq.sh \ --rpc-url "$RPC_URL" \ --chain-id "$CHAIN_ID" \ --account corner-store-giwa \ - --broadcast + --broadcast \ + --verify \ + --verifier blockscout \ + --verifier-url "$BLOCKSCOUT_API_URL" ``` -Foundry가 keystore 비밀번호를 요청하면 3번 단계에서 설정한 비밀번호를 입력한다. +GIWA 공식 Foundry 가이드의 Blockscout API endpoint를 사용해 배포와 source +verification을 함께 수행한다. Foundry가 keystore 비밀번호를 요청하면 3번 +단계에서 설정한 비밀번호를 입력한다. 스크립트는 다음을 자동으로 수행한다. 1. GIWA Chain ID 재확인 diff --git a/scripts/deploy-testnet-rfq.sh b/scripts/deploy-testnet-rfq.sh index 20f744c..52d841a 100755 --- a/scripts/deploy-testnet-rfq.sh +++ b/scripts/deploy-testnet-rfq.sh @@ -12,6 +12,8 @@ PASSWORD_FILE="" USE_LEDGER=0 BROADCAST=0 VERIFY=0 +VERIFIER="" +VERIFIER_URL="" ARTIFACT="${CORNER_STORE_ARTIFACT:-}" FINAL_ARTIFACT="" @@ -20,7 +22,7 @@ usage() { Usage: scripts/deploy-testnet-rfq.sh --rpc-url URL --chain-id ID \ (--account NAME | --keystore FILE [--password-file FILE] | --ledger) \ - [--broadcast] [--verify] + [--broadcast] [--verify [--verifier NAME] [--verifier-url URL]] Required environment: CORNER_STORE_TESTNET_DEPLOYER @@ -59,6 +61,8 @@ while [[ $# -gt 0 ]]; do --ledger) USE_LEDGER=1; shift ;; --broadcast) BROADCAST=1; shift ;; --verify) VERIFY=1; shift ;; + --verifier) require_value "$1" "${2-}"; VERIFIER="$2"; shift 2 ;; + --verifier-url) require_value "$1" "${2-}"; VERIFIER_URL="$2"; shift 2 ;; -h|--help) usage; exit 0 ;; *) echo "ERROR: unknown argument: $1" >&2; usage >&2; exit 2 ;; esac @@ -78,6 +82,10 @@ if [[ -n "$PASSWORD_FILE" && -z "$KEYSTORE" ]]; then echo "ERROR: --password-file requires --keystore" >&2 exit 2 fi +if [[ ( -n "$VERIFIER" || -n "$VERIFIER_URL" ) && "$VERIFY" -ne 1 ]]; then + echo "ERROR: --verifier and --verifier-url require --verify" >&2 + exit 2 +fi for name in \ CORNER_STORE_TESTNET_DEPLOYER \ @@ -144,6 +152,8 @@ else fi if [[ "$VERIFY" -eq 1 ]]; then MUTATION_ARGS+=(--verify) + [[ -n "$VERIFIER" ]] && MUTATION_ARGS+=(--verifier "$VERIFIER") + [[ -n "$VERIFIER_URL" ]] && MUTATION_ARGS+=(--verifier-url "$VERIFIER_URL") fi forge script script/DeployTestnetRFQ.s.sol:DeployTestnetRFQ \