Search code examples
ethereumsoliditysmartcontracts

Error: Unable to Verify Contract source code


I am a newbie in Solidity and Ethereum smart contract deployment. I have been trying to deploy some contract on Ethereum Testnet - Ropsten. I have successfully deployed and published

But, I received the error "Unable to Verify Contract source code." when trying to publish the following source code for this contract: https://ropsten.etherscan.io/address/0x811f7cf0f9534f54c4a56c383bbaed73dc88f609#code

I didn't know where did I do wrong.

pragma solidity ^0.4.0;
contract Test3 {
    uint storageData;
    function set(uint x) public {
        storageData = x;
    }
}

Any help would be appreciated.


Solution

  • First I assumed you deployed with remix. So go to the settings tab and make sure that on etherscan you selected the same version that is displayed there, otherwise it will not work and then if the optimization box is not checked which is the third checkbox down then select no on etherscan otherwise again it wont work.

    Then you just copy the exact source code into the box and type in the name of the contract and that is it.