Search code examples
soliditysmartcontractshardhatetherscan

HardHat - Fail - Unable to verify / Etherscan


Here's my contract.

// SPDX-License-Identifier: MIT

pragma solidity >= 0.7.3;

contract terceiroTest {
    // We pass and old String, a new string and when this event is
    // broadcast everybody is able to see that the even happened.
    // and see the strings exposed too.
    event UpdatedMessages(string oldStr, string newStr);

    string public message;

    // When this contract is deployed we require an argument passed called initMessasge
    constructor (string memory initMessage) {
        message = initMessage;
    }

    function update(string memory newMessage) public {
        string memory oldMsg = message;
        message = newMessage;
        emit UpdatedMessages(oldMsg, newMessage);
    }
} 

and it gives me the error:

I've tried to find any kind of description about this error, even changed solidity's version. I'm studying about smartcontracts still, if someone having or had the same error I would apretiate for enlighting me. Thanks.


Solution

  • I have had similar problems and they all resolved by themselves. It is possible that there is no issue in your code and the issue is with etherscan.

    Here are a few things I recommend to triage:

    1. Submit again
    2. Give gap between submission and verification
    3. Try a different env like polygonscan.
    4. Manually submit from their UI.