Popular Guide • 9.4k views

Verify Contract Source Code

Make your smart contracts transparent and trustworthy by verifying source code on Tetreum Explorer.

Why Verify Your Contract?
  • Transparency: Users can read and audit your contract code
  • Trust: Verified contracts build user confidence
  • Interaction: Easy contract interaction through the explorer
  • Debug: Better error messages and debugging
Before You Start
  • Deploy your contract on Tetreum testnet
  • Keep your original source code (.sol files)
  • Remember the compiler version used
  • Note any constructor parameters
1
Find Your Contract

Navigate to your deployed contract on Tetreum Explorer:

  1. Go to Tetreum Explorer
  2. Search for your contract address
  3. Click on the contract address in search results
  4. You should see contract details page
2
Start Verification Process

On the contract page, look for verification options:

  1. Look for "Contract" tab on the contract page
  2. Click "Verify & Publish" button
  3. Choose verification method (usually "Solidity Single File")

Note: If you see "Contract Source Code Verified", your contract is already verified by someone else.

3
Complete Verification Form

Fill out the verification form with exact details:

Required Information:

Contract Address: (Auto-filled)
Contract Name: Exact name from your .sol file
Compiler Version: e.g., v0.8.19+commit.7dd6d404
License Type: MIT, GPL-3.0, etc.

Source Code:

Copy and paste your complete Solidity source code, including:

  • • SPDX license identifier
  • • All import statements
  • • Complete contract code
  • • Comments and formatting
4
Add Constructor Parameters

If your contract has constructor parameters, you need to encode them:

Example:

// Contract with constructor
constructor(string memory _name, uint256 _supply) {
    name = _name;
    totalSupply = _supply;
}

// If deployed with:
// _name = "MyToken"
// _supply = 1000000

// ABI-encoded parameters:
000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000f4240000000000000000000000000000000000000000000000000000000000000000074d79546f6b656e00000000000000000000000000000000000000000000000000

Tip: Use online ABI encoding tools or Remix IDE to get the correct ABI-encoded constructor parameters.

5
Submit Verification

Complete the verification process:

  1. Review all information for accuracy
  2. Complete any CAPTCHA if required
  3. Click "Verify and Publish"
  4. Wait for verification (usually takes 1-2 minutes)

Success Indicators:

  • • Green checkmark appears next to contract
  • • "Contract Source Code Verified" message
  • • Source code tab becomes readable
  • • Read/Write contract functions available
Common Issues

Compilation failed:

Ensure exact compiler version and source code match what was used for deployment.

Bytecode doesn't match:

Check constructor parameters encoding and optimization settings.

Import errors:

Include all imported contracts or use flattened source code.

Contract Verified Successfully!

Your contract is now transparent and trustworthy. Users can interact with it directly through the explorer.