Live#…
Reading the chain…
Network now · GullyChain Testnet
Block
—
Txs · 30 blocks
—
Gas, gwei
—
Launches
—

Verify your contract

On this page

GullyChain runs its own Sourcify (opens in a new tab) server at verify.gullychain.xyz for chain 485590. Verify a contract once and the Gully Explorer shows a Verified badge plus a Contract tab with the source files, ABI, compiler settings and Read / Write contract forms.

Sourcify recompiles your sources with the exact compiler settings from the metadata and compares the result with the bytecode on chain:

  • Exact match (Sourcify "perfect"): bytecode and the metadata hash match, so the sources are byte-for-byte the ones that were compiled.
  • Match ("partial"): the bytecode matches but the metadata differs (comments, file paths, or bytecode_hash = "none").

Every Gully contract and every standard contract on the chain (Uniswap v3, Safe 1.4.1, Kernel, EntryPoint, Permit2, Multicall3, CreateX, WETH9, Hyperlane, the Arbitrum token bridge) is already verified there.

Verifier URL https://verify.gullychain.xyz/
API Sourcify API v2: https://verify.gullychain.xyz/v2/
Chain ID 485590
API key none needed

#Foundry

Use forge verify-contract with the Sourcify verifier. You don't need an API key or constructor arguments: Sourcify reads them from the creation transaction.

Shell
forge verify-contract <address> src/Counter.sol:Counter \
  --chain-id 485590 \
  --verifier sourcify \
  --verifier-url https://verify.gullychain.xyz/ \
  --rpc-url https://rpc.gullychain.xyz \
  --watch

To verify while deploying, add the same flags to forge create or forge script:

Shell
forge script script/Deploy.s.sol --rpc-url https://rpc.gullychain.xyz --broadcast \
  --verify --verifier sourcify --verifier-url https://verify.gullychain.xyz/

Build with the same foundry.toml you deployed with (solc version, optimizer runs, evm_version, via_ir), or the bytecode won't match.

Note

On Windows, forge can send a broken file path. If you get cannot resolve file or contract_not_found_in_compiler_output, run the command from WSL, or upload the metadata on the web page (below).

#Hardhat

Hardhat's verify plugin (@nomicfoundation/hardhat-verify) supports Sourcify. The server only speaks the Sourcify API v2, so use a plugin version that calls /v2/verify (the Hardhat 3 plugin); older ones call the removed v1 API and fail with a 404. Point it at the GullyChain server in hardhat.config.ts:

TypeScript
import "@nomicfoundation/hardhat-verify";

export default {
  solidity: { version: "0.8.28", settings: { optimizer: { enabled: true, runs: 200 }, evmVersion: "cancun" } },
  networks: {
    gullychain: { url: "https://rpc.gullychain.xyz", chainId: 485590, accounts: [process.env.PRIVATE_KEY!] },
  },
  sourcify: {
    enabled: true,
    apiUrl: "https://verify.gullychain.xyz",
    browserUrl: "https://testnet-explorer.gullychain.xyz",
  },
  etherscan: { enabled: false },
};
Shell
npx hardhat verify --network gullychain <address>

Any Hardhat version can also use the artifacts/build-info/*.json file: its input is the standard JSON input you can upload on the web page.

#On the web page

  1. Open verify.gullychain.xyz and enter the contract address (and the creation transaction hash if you want a creation-bytecode match too).
  2. Pick one of two ways:
    • metadata.json + sources: drop the metadata (Foundry: the rawMetadata field of out/<File>.sol/<Name>.json, or the whole artifact file) and every source file it lists.
    • Standard JSON input: upload the solc input file, then give the full compiler version (for example 0.8.28+commit.7893614a) and the path:ContractName.
  3. Press Verify. The page polls the job and links to the contract in the explorer.

The Look up tab shows the status, compiler settings and proxy → implementation link of any verified address.

#Proxies

Verify both contracts: the proxy and its implementation. Sourcify detects EIP-1967, transparent, UUPS, beacon, Safe and ZeppelinOS proxies and records the implementation (proxyResolution in the API). The explorer then offers As proxy, which reads and writes the proxy with the implementation's ABI.

#Use the API

Shell
# status and match level
curl https://verify.gullychain.xyz/v2/contract/485590/<address>

# everything: sources, ABI, compiler settings, std JSON input, proxy resolution
curl "https://verify.gullychain.xyz/v2/contract/485590/<address>?fields=all"

# every verified contract on the chain (paged, 200 per page)
curl "https://verify.gullychain.xyz/v2/contracts/485590?limit=200"

The API answers CORS for *.gullychain.xyz and localhost. The full reference is the Sourcify API v2 docs (opens in a new tab).

#When it doesn't match

  • no_match / bytecode_length_mismatch: the settings differ from the ones you deployed with. Check the solc version, optimizer runs, evm_version, via_ir and the library addresses.
  • extra_file_input_bug: the original build had extra files in the same compiler run. Upload the original standard JSON input (Hardhat build-info) instead of the metadata.
  • Only "Match": the build used bytecode_hash = "none" or a different file layout. The source is still verified; keep the default bytecode_hash (ipfs) for an exact match next time.
  • Contract created by a factory: you get a runtime match only. That is expected, because the server has no trace API to find the inner creation.