Key Error when deploying OpenZeppelin Contract with Etherscan verification ON
See original GitHub issueEnvironment information
brownie
Version: 1.16.4ganache-cli
Version: 6.12.2solc
Version: 0.8.2- Python Version: 3.9.5
- OS: win
What was wrong?
Using OpenZeppelin@4.3.2 a simple ERC721 will deploy but verification by Etherscan will not occur due to KeyError
Code nft = MyNFT.deploy({‘from’:dev},publish_source=True)
Error
nft = MyNFT.deploy({‘from’:dev},publish_source=True) Transaction sent: 0x1da78e781c6bf817864d4c0c7769ce76111bc595d5774593ee947d0b1315477d Gas price: 1.000000008 gwei Gas limit: 1859082 Nonce: 13 MyNFT.constructor confirmed Block: 9333994 Gas used: 1690075 (90.91%) MyNFT deployed at: 0x072097bb99103EE2d99a92ef98D9ca49c6b33f3d
File “<console>”, line 1, in <module> File "d:\program, line line, in in return tx[“from”].deploy( File "d:\program, line line, in in contract.publish_source(deployed_contract, silent=silent) File "d:\program, line line, in in contract_info = self.get_verification_info() File "d:\program, line line, in in build_json = self._project._build.get(name) File "d:\program, line line, in in return self._interfaces[key] KeyError: ‘OpenZeppelin/openzeppelin-contracts@4.3.2/Address’
How can it be fixed?
Brownie may be loading interfaces with wrong key and it fails when it is iterated to flatten files
Issue Analytics
- State:
- Created 2 years ago
- Comments:9
Looks as if it was fixed in 1.17. https://github.com/eth-brownie/brownie/pull/1283
If you compile your contract with 0.8.0 solidity version, the error goes away. I believe there is something wrong with the 0.8.n versions. Not the best solution but if you are in a hurry, that should solve it.