Skip to main content

Contract Repository

Verified contracts are stored in the Sourcify repository and are available via Web or IPFS.

Bouncing Sourcify logo for loading content
Calculating the repository size

You can find the number of contracts and the total size for each chain and match type (full and partial) at https://repo.sourcify.dev/stats.json

IPFS

The contract repository is periodically updated and pinned to the IPFS.

The repo is accessible under the following IPNS DNSLink names:

You can also access the contract repository with the /ipns/:ipns/contracts/:match/:chainId/:contractAddress format on IPFS. Example:

https://ipfs.io/ipns/repo.sourcify.dev/contracts/full_match/1/0x5ed4a410A612F2fe625a8F3cB4d70f197fF8C8be

Pin the IPFS repository

Pin and help us decentralize the Sourcify repository!

Refer to the guide by @wmitsuda

Web

The repository interface is at https://repo.sourcify.dev and https://repo.staging.sourcify.dev (unstable).

However for performance reasons, it is not possible to navigate the folders above the contract level. You need to know ahead the contract you are looking for.

Lookup

Instead of entering the chain, you can check an address over all chains at https://sourcify.dev/#/lookup

The contracts are accessible under the following path format:

https://repo.sourcify.dev/contracts/:match/:chainId/:contractAddress
  • :match: either full_match or partial_match
  • :chainId: EVM chain id 1 for Ethereum Mainnet, 5 Ethereum testnet Görli etc. See chainlist.org
  • :contractAddress: e.g. 0x5ed4a410A612F2fe625a8F3cB4d70f197fF8C8be

Examples

Here are some example contracts:

View Source Code in Remix IDE

It is possible to view the contract folder in the Remix IDE by clicking "View in Remix".

Allow the Sourcify plugin on the next screen in Remix IDE (might take a while to load). The contract folder will be available under verified-sources/<contract-address> in the Remix file explorer.

Sourcify repository screenshot

Download folders

You can download the whole folder by clicking on top left download icon.

Alternatively you can select which files/folders to download by clicking the checkmarks, and click the download icon.

Sourcify repository screenshot

Download

IPFS

You can download the whole repository over IPFS by

ipfs get "/ipns/repo.sourcify.dev" -o <output-directory>

S3 Bucket

We also backup our repo at an S3 Bucket. We enabled the "Requester Pays" feature ( https://docs.aws.amazon.com/AmazonS3/latest/userguide/RequesterPaysBuckets.html ) on the s3 Sourcify bucket.

mkdir contracts
cd contracts
aws s3 cp --request-payer requester --recursive s3://sourcify-backup-s3/stable/repository/contracts/ .
Free credentials

If you need free credentials reach us out at hello@sourcify.dev to get read-only credential. First download and install the AWS CLI.

Then run

aws configure

and provide the credentials. Leave "Default region name" and "Default output format" empty.

Finally run

mkdir contracts
cd contracts
aws s3 cp --recursive s3://sourcify-backup-s3/stable/repository/contracts/ .