Skip to content
Home » News » Verifying My Smart Contract on SolScan: A Step-by-Step Guide

Verifying My Smart Contract on SolScan: A Step-by-Step Guide

    Quick Facts

    • A Verify contract on SolScan is a smart contract that has been verified, meaning its source code is made public and available for review.
    • Verify contracts are important for ensuring the transparency and security of blockchain transactions.
    • SolScan is a blockchain explorer for the Solana network, where you can find and verify contracts.
    • Verify contracts on SolScan have undergone a verification process to confirm the code matches the deployed contract.
    • Verified contracts can be easily inspected for vulnerabilities and logic errors, increasing trust in the contract.
    • Anyone can verify a contract on SolScan, as long as they have access to the contract’s source code and deployment details.
    • Verify contracts can be created for various use cases, such as decentralized applications (dApps), token sales, and decentralized finance (DeFi) platforms.
    • SolScan provides a user-friendly interface to view and interact with verify contracts, including transaction history and contract state.
    • Verify contracts can be searched and filtered by various criteria, such as contract address, owner, and transaction count.
    • Verify contracts on SolScan are essential for maintaining a secure and transparent Solana network.

    Verifying Contracts on SolScan: A Personal, Practical Guide

    As a developer working with decentralized finance (DeFi) platforms, I have come to rely on SolScan for contract verification. In this article, I’ll take you through the process of verifying a contract on SolScan, sharing tips and best practices along the way.

    Getting Started

    Before we dive into the verification process, let’s first discuss what contract verification is and why it’s important.

    Contract verification is the process of making the source code of a smart contract available for public scrutiny. This is important because it allows users to independently verify the functionality of a contract before interacting with it. By verifying a contract on SolScan, you can increase trust and transparency within the DeFi community.

    The Verification Process

    To get started with contract verification on SolScan, you’ll need to have the following:

    1. The source code of the contract you wish to verify
    2. A Solidity compiler version compatible with the contract code
    3. A SolScan account (optional, but recommended)

    Here are the steps to verify a contract on SolScan:

    1. Compile your contract: Before you can verify your contract on SolScan, you need to compile it using a compatible Solidity compiler. You can use an online compiler like Remix or a local one like Truffle.
      • Easy to use
      • No setup required
      • Limited customization options
      • Greater customization options
      • Better integration with development tools
      • Requires local setup
    2. Obtain the contract’s bytecode and ABI: Once you’ve compiled your contract, you’ll need to obtain its bytecode and Application Binary Interface (ABI). These are typically provided as output by the compiler.
    3. Navigate to SolScan: Go to the SolScan website () and click on the “Verify Contract” button.
    4. Enter contract details: Input the following details about your contract:
      • Network: Choose the network where the contract is deployed (e.g. Mainnet, Testnet).
      • Contract Address: Provide the address of the deployed contract.
      • Bytecode: Paste the bytecode obtained from the compiler.
      • ABI: Paste the ABI obtained from the compiler.
    5. Select compiler version: Choose the Solidity compiler version used to compile the contract.
    6. Verify the contract: Click the “Verify” button to initiate the verification process. SolScan will compare the provided bytecode and ABI with the contract at the specified address. If they match, the contract will be verified.

    Common Issues and Solutions

    • Compiler version mismatch: Ensure that the selected compiler version matches the one used to compile the contract.
    • Bytecode or ABI errors: Double-check that the provided bytecode and ABI are correct and match the deployed contract.
    • Contract not verified: If the contract fails to verify, there might be a discrepancy between the provided code and the deployed contract. Review the code and try again.

    Frequently Asked Questions: Verifying Contract on SolScan

    1. What is contract verification on SolScan?

    Contract verification on SolScan is the process of confirming that the on-chain code of a smart contract matches the intended source code. This helps to increase trust and transparency in the contract’s functionality and behavior.

    2. Why should I verify my contract on SolScan?

    Verifying your contract on SolScan provides several benefits, including: increased trust and transparency, easier debugging and troubleshooting, and improved security for users of your contract.

    3. How do I verify my contract on SolScan?

    To verify your contract on SolScan, you will need to follow these steps:

    1. Compile your source code and generate the abi (Application Binary Interface) and bin (bytecode) files.
    2. Go to the SolScan website and navigate to the “Verify Contract” section.
    3. Enter the contract address, abi, and bin files in the appropriate fields.
    4. Click the “Verify” button and wait for the verification process to complete.

    4. What file formats are acceptable for the abi and bin files?

    The abi file should be in JSON format, and the bin file should be in hexadecimal format.

    5. How long does contract verification take?

    The verification process typically takes a few minutes to complete, but it can take longer if there is high network traffic.

    6. What should I do if my contract verification fails?

    If your contract verification fails, you should check that you have entered the correct contract address, abi, and bin files, and that the files are in the correct format. If the problem persists, you can contact SolScan support for assistance.

    7. Can I verify a contract that has already been deployed?

    Yes, you can verify a contract that has already been deployed on the Solana blockchain. However, you will need to have access to the original source code and the abi and bin files.

    8. Is there a fee for contract verification on SolScan?

    No, there is currently no fee for contract verification on SolScan.

    9. Can I verify multiple contracts at once?

    No, each contract must be verified individually.

    10. Can I verify a contract that is still in development?

    No, you can only verify a contract that has been deployed on the Solana blockchain.