Skip to main content

Contract Verification (Sourcify)

Verify your Solidity contract source code against on-chain bytecode using Sentrix's self-hosted Sourcify instance.

Endpoint: https://verify.sentrixchain.com Supported chains: mainnet (7119), testnet (7120)

Why verify

Once verified, your contract:

  • Shows a green ✓ "verified" badge on scan.sentrixchain.com address pages
  • Returns matched source + ABI + metadata via API (any tool can fetch your code)
  • Independently re-compilable by auditors / users (transparency)
  • Required for many listing platforms + due-diligence reviews

Quick reference: existing verified contracts

All 4 canonical contracts on both chains are already verified:

ContractMainnet (7119)Testnet (7120)
WSRX0x4693b113...0x85d5E769...
Multicall30xFd4b34b5...0x7900826D...
TokenFactory0xc753199b...0x7A2992af...
SentrixSafe0x6272dC0C...0xc9D7a61D...

How to verify your own contract

Prerequisites

You need:

  • The deployed contract address
  • The Solidity source file (.sol)
  • The compiler-emitted metadata.json

Getting metadata.json

Foundry / forge

After forge build, find it under out/<ContractName>.sol/<ContractName>.json — the build artifact contains a rawMetadata field which IS the metadata.json content. Extract:

jq -r '.rawMetadata' out/MyToken.sol/MyToken.json > metadata.json

Hardhat

After npx hardhat compile, find it under artifacts/build-info/<hash>.json — extract the metadata for your contract:

jq -r '.output.contracts["contracts/MyToken.sol"]["MyToken"].metadata' artifacts/build-info/*.json > metadata.json

Or use the Hardhat verify plugin (if a Sourcify-compatible one exists; check the plugin docs).

Remix

In Remix, after compile:

  • Go to Solidity Compiler tab → Compilation Details (top-right of compile output)
  • Click METADATA → copy the JSON
  • Save as metadata.json

Submit verification (curl)

curl -X POST https://verify.sentrixchain.com/verify \
-H "Content-Type: application/json" \
-d '{
"address": "0xYourContractAddress",
"chain": "7119",
"files": {
"MyToken.sol": "<paste full source code here>",
"metadata.json": "<paste full metadata.json here>"
}
}'

Use "chain": "7120" for testnet.

Multi-file contracts

If your contract imports other contracts, include each file with the path used in the import:

curl -X POST https://verify.sentrixchain.com/verify \
-H "Content-Type: application/json" \
-d '{
"address": "0xYourContractAddress",
"chain": "7119",
"files": {
"src/MyToken.sol": "<source>",
"src/IERC20.sol": "<imported source>",
"lib/openzeppelin/Ownable.sol": "<another import>",
"metadata.json": "<metadata json>"
}
}'

The metadata.json has the canonical filenames in its sources field — match those exactly.

Submit verification (Python)

import json, urllib.request

with open("MyToken.sol") as f:
source = f.read()
with open("metadata.json") as f:
metadata = f.read()

payload = {
"address": "0xYourContractAddress",
"chain": "7119", # or "7120" for testnet
"files": {
"MyToken.sol": source,
"metadata.json": metadata,
},
}

req = urllib.request.Request(
"https://verify.sentrixchain.com/verify",
data=json.dumps(payload).encode(),
headers={"Content-Type": "application/json"},
method="POST",
)
resp = urllib.request.urlopen(req, timeout=120)
print(resp.read().decode())

Response

Success:

{
"result": [
{
"address": "0x...",
"chainId": "7119",
"status": "perfect"
}
]
}

Status values:

  • perfect — bytecode + metadata exact match (green badge)
  • partial — bytecode matches but metadata differs (amber badge — usually means compiler optimization mismatch)
  • HTTP 500 with error: verification failed (bytecode mismatch, source doesn't compile to deployed bytecode, RPC fetch failed, etc.)

Check verification status

Via API

curl https://verify.sentrixchain.com/files/any/7119/0xYourContractAddress

Returns JSON with status (full/partial) and the verified files. 404 if not verified.

Via scan UI

Visit https://scan.sentrixchain.com/en/address/0xYourContractAddress — verification badge appears in the header next to the address label.

List supported chains

curl https://verify.sentrixchain.com/chains

Currently returns chains 7119 (mainnet) and 7120 (testnet). If your chain isn't listed, this is a self-hosted instance scoped to Sentrix only — for other chains use sourcify.dev.

Common verification failures

ErrorCauseFix
"Cannot fetch bytecode"Sourcify can't reach the RPC, or the address has no bytecode (EOA)Verify address is a contract via eth_getCode first
"perfect" not achieved, only "partial"Compiler version or settings differ from deploymentUse the EXACT solc version + optimization runs that were used to deploy
"Source code does not match"Source file modified after deployUse the exact source that was compiled + deployed
HTTP 500 with cryptic errorSourcify internal issueRetry after a few seconds; if persistent, file an issue at sentrix-labs/sentrix

Self-hosted vs public Sourcify

  • Self-hosted (verify.sentrixchain.com): Sentrix-specific. Supports chain 7119 + 7120. All canonical Sentrix contracts verified here.
  • Public (sourcify.dev): Doesn't currently support Sentrix chains. If/when Sourcify adds Sentrix to their supported list, the public instance will work too — for now, use ours.

Privacy / security

  • Verification is public by design — uploaded source code becomes publicly readable via the API.
  • Do NOT upload contracts you want to keep private (e.g., proprietary / not-yet-released code).
  • The API has no authentication — anyone can verify any contract address (this is intentional; Sourcify model).