Home > front end >  HardHat - Fail - Unable to verify / Etherscan
HardHat - Fail - Unable to verify / Etherscan

Time:01-14

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.

CodePudding user response:

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.

CodePudding user response:

I took your contract and tested it in my hardhat env. Everything worked fine. Maybe there's something else happening in your local setup?

Try again with a fresh hardhat setup. Try using this 'badass hardhat setup' enter image description here

  • Related