smartcontractkit / full-blockchain-solidity-course-py

Ultimate Solidity, Blockchain, and Smart Contract - Beginner to Expert Full Course | Python Edition
MIT License
10.75k stars 2.9k forks source link

Lesson 11: Can't verify AdvancedCollectible.sol on Etherscan #434

Open mhannig13 opened 2 years ago

mhannig13 commented 2 years ago

In the lesson you repeatedly say the contract should automatically be verified on Etherscan, but mine is not. When I try to verify it, I keep getting the error: Error! Unable to generate Contract ByteCode and ABI (General Exception, unable to get compiled [bytecode]). I saw a suggestion to flatten the files. Does that mean to paste in the code for the ERC721.sol and VRFConsumerBase.sol? What about all the contracts they import? Is there another way to do this? Please help! :-) Thank you

BTW: The contract address is: 0x2d52108E7258D27291983Bd561D356Df122f7c68 on https://rinkeby.etherscan.io/

cromewar commented 2 years ago

Hello, the contract would be automatically get verified if and just if the code is the exact same (point to point, space to space, etc) remember even one small change, a lletter, a variable name etc with change the bytecode of the contract drastically, so you can verify it adding verify_source=true on brownie deployment or verify it manually on etherscan.

Sevamove commented 2 years ago

Hello @mhannig13,

I conclude from that contract address on the rinkeby testnet that the contract apparently not verified. How did you install eth-brownie (pip3 or pipx)? If you did it with pip3, try to upgrade the package by running:

pip3 install eth-brownie --upgrade --user

Then give brownie a try to deploy it again.

Also you can refer to this issues #354 and #163 for additional ideas.