Outils·6 min de lecture·Par Solingo

Sourcify — Verified Source Code for Every Contract

Sourcify provides decentralized source code verification on IPFS. Learn how to verify your contracts.

# Sourcify — Verified Source Code for Every Contract

Etherscan verification is centralized. Sourcify stores verified source code on IPFS for decentralized access.

Why Sourcify

  • Decentralized: Source code on IPFS, not a single server
  • Full match: Verifies metadata hash for exact compilation match
  • Multi-chain: Supports 100+ EVM chains
  • Open source: Anyone can run a node

Verify with Foundry

forge verify-contract \

--verifier sourcify \

--chain-id 1 \

0xYourContract \

src/MyContract.sol:MyContract

Verify with Hardhat

// hardhat.config.js

module.exports = {

sourcify: { enabled: true },

};

npx hardhat verify --network mainnet 0xYourContract "arg1"

Full Match vs Partial Match

  • Full match: Exact compiler settings, metadata, source. The bytecode metadata hash matches perfectly.
  • Partial match: Same runtime bytecode, but metadata may differ.

Always aim for full match. It guarantees the exact source that was compiled.

CI/CD Integration

- name: Verify on Sourcify

run: forge verify-contract --verifier sourcify --chain-id 1 $CONTRACT src/MyContract.sol:MyContract

Verify on both Etherscan AND Sourcify for maximum transparency.

Prêt à mettre en pratique ?

Applique ces concepts avec des exercices interactifs sur Solingo.

Commencer gratuitement