Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verfication failed #1076

Open
ghost opened this issue May 4, 2021 · 9 comments
Open

verfication failed #1076

ghost opened this issue May 4, 2021 · 9 comments

Comments

@ghost
Copy link

ghost commented May 4, 2021

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.

@evoh-nft
Copy link

evoh-nft commented Jun 6, 2021

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

@jeanlucmongrain
Copy link

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

@aturX
Copy link

aturX commented Aug 23, 2021

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

@CryptoZ258
Copy link

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.

@SuperZooper3
Copy link

Having similar issues in mine, solc 0.8.0

@thomasoss
Copy link

thomasoss commented Feb 18, 2022

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

@skellet0r
Copy link
Collaborator

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

@rodriguesmvinicius
Copy link

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

@Jeevan-J
Copy link

Jeevan-J commented Aug 31, 2022

Possible related issue #1604

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants