0

I am trying to verify a contract (yearn-strategy) that uses the openZeppelin library, other yearn files and a few interfaces for external contracts. The contract deploys just fine but the verification always fails.

I have tried to debug/ investigate further but nothing has worked:

On a related github issue I found "Make sure all your source files use the same compiler version, otherwise the verification will fail." openzeplin library files all say "pragma solidity ^0.6.0" but my files and the yearn libraries I am using have "pragma solidity 0.6.12", Could this be the issue ?

Etherscan shows a single solidity file "stitched" with all the imported files. How can I make such a file with brownie so I can manually verify on etherscan ?

contract

3 Answers 3

0

This is currently an issue with brownie verification.

https://github.com/eth-brownie/brownie/issues/1221

It's being worked on.

1

I had this problem for days and finally here's what worked for me:

I changed my global compiler version to the version of solidity I declared for my contract: 0.6.6 (from top left...code > preferences > solidity > settings > search solidity > click on solidity configurations > compile using remote version OR just right click on the "pragma solidity..." and select "Change global compiler version")

For some reason, this worked. I'm guessing it has something to do with this from the brownie documentation.

WARNING: Make sure all your source files use the same compiler version, otherwise the verification will fail.

0
  1. I once had this issue, and the only way I could get around it was copying the source codes of the imported files into specific files and importing these files instead. Them making sure all the files had the same pragma solidity version on them.

You might consider try it out.

  1. Make sure you set your Infura.io token correctly if you use Infura.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.