Requesting Chain Support
Do you want to verify contracts on an EVM chain? Great! We don't want to be the single source of truth and encourage you to run your own Sourcify instance.
If you still want to request an EVM chain to be supported by Sourcify, please open a pull request with the instructions below for a speedy process:
Make sure the new chain is listed in chains.json but this file should not be edited. It is kept in sync with chainid.network (github: ethereum-lists/chains) periodically. If your chain is not included, please first add your chains to the ethereum-lists/chains repository first.
Fork the repository. Branch out from the staging branch with name
add-chain-{chainId}
(e.g. for Ethereum Mainnetadd-chain-1
). This branch name format is required for automated testing. For each chain please open a new PR for the tests to run (no multiple chains e.g.)add-chain-1234-1235
Add the chain details in sourcify-chains.ts similar to other chains with
supported: true
andmonitored: false
. If your chain uses an Etherscan or Blockscout fork, use the same regex for other chains with the same block explorer. This field is used for verification via the creator transaction.Install and build the project with
npx lerna bootstrap
andnpx lerna run build
.Provide test contracts:
- Deploy a test contract:
- Using the provided script: You can easily deploy both contracts with an account private key using
test/chains/deployContracts.js
. Seenode deployContracts.js --help
. - Sending a raw transaction with a web wallet: You can send a raw tx with the contract's creation code using https://www.myetherwallet.com/wallet/deploy and choose your wallet. Paste the bytecode and abi found in
test/chains/sources/shared/1_Storage.json
and send the transaction with your wallet. - Using Remix: Copy-paste the contract
test/chains/sources/shared/1_Storage.sol
. Use the compiler settings defined in the metadata: compiler version0.8.7+commit.e28d00a7
and optimizer disabled on Remix, you should have exactly the same metadata file. You can check by pasting and decoding the bytecode60a0604...
at playground.sourcify.dev that it matches toipfs://QmSffyjwZxAWUYaAiE25YPpKYyBegQKCBnnBK3tknDSgJ5
. Take note of the contract address.
- Using the provided script: You can easily deploy both contracts with an account private key using
- If you are not able to deploy new test contracts above (e.g. because it costs on a mainnet) you can provide existing contracts. Create a folder
test/chains/sources/{chainId}
and store the contract source files and metadata of already deployed contracts there.
- Deploy a test contract:
Add the test for the new chain in
test/chain/chain-tests.js
similar to other chains. If you deployed a test contract as described above, the contract and the metadata are the following:- Storage.sol:
shared/1_Storage.sol
andshared/1_Storage.metadata.json
- Storage.sol:
To test locally run
NEW_CHAIN_ID={chainId} npx mocha test/chains/chain-tests.js --exit
If the tests pass, open a pull request targeting the Sourcify staging branch.
If the tests pass, the chain will be added quickly. The chain will be added to production (master branch) with the next release, which usually happens in 1-2 weeks.