2.7.3. ChainIDE Scan Verifier
ChainIDE offers contract verification plug-ins that can scan and verify smart contracts on Ethereum, Polygon, BNB Chain, Conflux and Astar.
Last updated
ChainIDE offers contract verification plug-ins that can scan and verify smart contracts on Ethereum, Polygon, BNB Chain, Conflux and Astar.
Last updated
Verifying a smart contract on Blockchain Scan is important for several reasons:
Ensuring accuracy: Verifying a smart contract on scan ensures that the contract code that is published on the blockchain is the same as the original code that was used to create the contract. This helps prevent errors or malicious code from being introduced into the contract.
Building trust: By verifying a smart contract on scan, developers and users can be confident that the contract is legitimate and not a scam. This builds trust and confidence in the contract and the parties involved.
Facilitating audits: Verifying a smart contract on scan also facilitates audits by third-party security experts who can review the code and provide feedback on any vulnerabilities or issues that need to be addressed.
Improving transparency: Verifying a smart contract on scan increases transparency by making the contract code visible to anyone who wants to see it. This helps ensure that the contract operates as intended and provides the expected outcomes.
Interaction through scan: Once a smart contract is verified on scan, users can interact with it directly through the scan website. This allows users to view and interact with the smart contract's functions and data without the need for a separate user interface or application.
The above-mentioned are some of the reasons why we need to verify a smart contract. Let's move on forward and see how to verify a smart contract.
Once a smart contract is deployed, its source code can be uploaded and authenticated using a scan verifier. The procedure is divided into three steps:
Enter ChainIDE and select the verification plug-in panel.
Go to scan to register an account and obtain an API key. (Optional)
Fill in the necessary parameters for the contract verification.
Go to ChainIDE. Choose a smart contract that you want to get verified, compile , connect wallet and deploy the smart contract. After deployment, open the "Scan Verifier" and fill in all the required information.
Click on the icon to navigate to the corresponding scan, and create an account if you don't have one already.
After creating an account, log in to your account, and go to the "API Keys" section under the "OTHERS". Click the "+Add" button in front of the "My API Keys" and a new panel will be popped up;
Write down your project name there and press the "Create New API Key" button;
Now you'll get a new API Key Token.
The details of each required field are given below:
API End Point: The API URL provided by scan will be automatically filled in when connecting to a specific network. For example, the link in the figure is the Sepolia Testnet of Ethereum.
API Key: The API Key obtained in the previous step; you need to bring this address to access the URL of scan.
Remember the API Key: this will record the API in local storage.
Compiled Contract: Select among the compiled contracts the one that needs to be verified.
Contract Address: Fill in the address of the deployed smart contract.
Constructor Parameters: Fill in the deployment parameters.
After filling in all the above information, click the "Verify" button.
After clicking the "Verify" button, if everything is correct, your contract will be verified, and a link to view your verified smart contract on the scan will be given.
If you need it, please refer to how to verify contracts in Astar WASM.