brownie
brownie copied to clipboard
verfication failed
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.
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
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
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
This issue maybe cause by flatten wrong. I also got the same problem in Solc 0.6.12.
I fix by these steps:
- In brownie console, run
MyContract.get_verification_info()
, then I can get the flattened source code - Paste flattened source code into etherscan, verify by hand
- When compile error, it will said which character failed, fix it in source code
- Redo verify, then it success.
This method can solve verify error temp, hope new version come up early.
Having similar issues in mine, solc 0.8.0
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
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
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
Possible related issue #1604