You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
git clone git@github.com:vsmelov/brownie_fail_verification.git
cd brownie_fail_verification
virtualenv venv -p python3.9
. venv/bin/activate
pip install -r requirements.txt
brownie compile
export BRAVE_MAIN_PASS='xxx'
brownie run scripts/deploy_and_verify_ok.py --network polygon-main
brownie run scripts/deploy_and_verify_fail.py --network polygon-main
What was wrong?
Contract verification with dependency on the file that imports the file with the same name does not work.
e.g.
https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.3.3/contracts/interfaces/IERC165.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/introspection/IERC165.sol";
what command you ran
brownie run scripts/deploy_and_verify_fail.py --network polygon-main
full output of the error you received
brownie run scripts/deploy_and_verify_fail.py --network polygon-main
#Running 'scripts/deploy_and_verify_fail.py::main'...
#Transaction sent: 0xd3cbb5004acd636cb14738034f091afd98d74d1b7e4f2d8ae1e954b3d9a9beb2
# Gas price: 114.379120423 gwei Gas limit: 108170 Nonce: 141
# VerificationFail.constructor confirmed Block: 40759442 Gas used: 98337 (90.91%)
# VerificationFail deployed at: 0x1AF0b97581d883B9260182d00f8619e5B3a4f7d4
#
#Verification submitted successfully. Waiting for result...
#Verification complete. Result: Fail - Unable to verify
How can it be fixed?
If you go into function publish_source and check what is inside
contract_info = self.get_verification_info()
you will see IERC165 from contracts/interfaces/IERC165.sol which refers to itself from "../utils/introspection/IERC165.sol"
First, I'm sure brownie should give a warning in case if file with some filename imports the same filename from inside. I spent 2 days trying to realize what is going on!
I see a way how to fix it:
automatically attach uniq prefix to every same-name files like "utils_introspection_IERC165.sol" and "interfaces_IERC165.sol"
The text was updated successfully, but these errors were encountered:
Environment information
brownie
Version: 1.19.3ganache-cli
Version: Ganache CLI v6.12.2 (ganache-core: 2.13.2)solc
Version: 0.8.6How to reproduce
What was wrong?
Contract verification with dependency on the file that imports the file with the same name does not work.
e.g.
brownie run scripts/deploy_and_verify_fail.py --network polygon-main
How can it be fixed?
If you go into function publish_source and check what is inside
you will see IERC165 from contracts/interfaces/IERC165.sol which refers to itself from "../utils/introspection/IERC165.sol"
First, I'm sure brownie should give a warning in case if file with some filename imports the same filename from inside. I spent 2 days trying to realize what is going on!
I see a way how to fix it:
The text was updated successfully, but these errors were encountered: