Skip to content

feat: update Sourcify integration to support API v2 #11065

@kuzdogan

Description

@kuzdogan

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge Version: 1.2.3-stable Commit SHA: a813a2c Build Timestamp: 2025-06-08T15:42:50.507050000Z (1749397370) Build Profile: maxperf

What version of Foundryup are you on?

foundryup: 1.0.1

What command(s) is the bug in?

forge verify-check

Operating System

macOS (Apple Silicon)

Describe the bug

I wasn't able to get a successful response for any of the already verified contracts on Sourcify using forge verify-check:

$ forge verify-check 0xdAC17F958D2ee523a2206206994597C13D831ec7 --verifier sourcify    
                                                                                                           
Checking verification status on mainnet
Attempting to verify on Sourcify. Pass the --etherscan-api-key <API_KEY> to verify on Etherscan, or use the --verifier flag to verify on another provider.
Contract source code is not verified

See the verified contract: https://repo.sourcify.dev/1/0xdAC17F958D2ee523a2206206994597C13D831ec7

Also tried with --chain=1

However this command worked:

$ forge verify-check 0xa5F565650890fBA1824Ee0F21EbBbF660a179934 --verifier sourcify --chain=10        
                                                                                            
Checking verification status on optimism
Attempting to verify on Sourcify. Pass the --etherscan-api-key <API_KEY> to verify on Etherscan, or use the --verifier flag to verify on another provider.
Contract successfully verified

This contract also works:

$ forge verify-check 0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE --verifier sourcify                                                                                                               

Checking verification status on mainnet
Attempting to verify on Sourcify. Pass the --etherscan-api-key <API_KEY> to verify on Etherscan, or use the --verifier flag to verify on another provider.
Contract successfully verified

Other failing ones:

  • 0xD6C2Af244DD56DB3C9D276808EdA8B5Fb040007b
  • 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D

Feels very random and I wasn't able to recognize a pattern.

If you need example verified contracts use this API: https://sourcify.dev/server/v2/contracts/1?limit=10&sort=desc

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions