brownie icon indicating copy to clipboard operation
brownie copied to clipboard

verfication failed

Open ghost opened this issue 3 years ago • 9 comments

Environment information

  • brownie Version: 1.14.6
  • solc Version: 0.8.4
  • Python Version: 3.9.4
  • OS: linux

What was wrong?

Given a contract

// contracts/hodl.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "OpenZeppelin/[email protected]/contracts/utils/Context.sol";
import "OpenZeppelin/[email protected]/contracts/token/ERC777/ERC777.sol";

contract TestToken is ERC777 {
    constructor() ERC777("Test Token", "TEST", new address[](0)) {
        _mint(msg.sender, 1e25, "", "");
    }
}

brownie compile runs perfect. But in brownie console, verification always fails using either deploy() or publish_source().

How can it be fixed?

I don't know how to fix this.

ghost avatar May 04 '21 02:05 ghost

I have the same issue. Using solc 0.8.3 instead of 0.8.4 seems to have fixed. Guessing this is related to the issue that makes coverage reports fail on 0.8.4

evoh-nft avatar Jun 06 '21 15:06 evoh-nft

in my case, it fail because the output of flattened_source is invalid, there is a character removed:

// Part: ReentrancyGuard

ontract ReentrancyGuard {

when I add the c and verify on the web ui it works

jeanlucmongrain avatar Jul 21 '21 03:07 jeanlucmongrain

I have the same issue. Using solc 0.8.3 instead of 0.8.4 seems to have fixed.

I have the same issue. Using solc 0.8.3 instead of 0.8.4 seems to have fixed.

Me too

aturX avatar Aug 23 '21 08:08 aturX

This issue maybe cause by flatten wrong. I also got the same problem in Solc 0.6.12.

I fix by these steps:

  1. In brownie console, run MyContract.get_verification_info(), then I can get the flattened source code
  2. Paste flattened source code into etherscan, verify by hand
  3. When compile error, it will said which character failed, fix it in source code
  4. Redo verify, then it success.

This method can solve verify error temp, hope new version come up early.

CryptoZ258 avatar Nov 09 '21 07:11 CryptoZ258

Having similar issues in mine, solc 0.8.0

SuperZooper3 avatar Jan 27 '22 03:01 SuperZooper3

Having similar issue (Brownie 1.16.3, solc 0.8.0) My py-solc-ast version: 1.2.9 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from eth-brownie) (1.2.9) Hence the fix described by @skellet0r does not fix the problem with the verification

thomasoss avatar Feb 18 '22 08:02 thomasoss

Odd, so you're using flattened source to verify ? Does the standard json input verification fail as well ? Brownie by default uses standard json input on etherscan

skellet0r avatar Feb 23 '22 16:02 skellet0r

Odd, so you're using flattened source to verify ? Does the standard json input verification fail as well ? Brownie by default uses standard json input on etherscan

how can i choose the method of verification?

I am using ContractContainer.publish_source(ContractContainer[-1]) I have 4 contracts, only one fails verification

rodriguesmvinicius avatar Feb 26 '22 17:02 rodriguesmvinicius

Possible related issue #1604

Jeevan-J avatar Aug 31 '22 18:08 Jeevan-J