brownie
brownie copied to clipboard
Brownie is unable to verify contracts deployed other smart contracts
Environment information
-
brownie
Version: 1.19.1 -
solc
Version: 0.8.7 - Python Version: 3.10.5
- OS: osx
What was wrong?
Contract.publish_source
fails to verify contracts deployed by other smart contracts.
No error message is given by brownie.
Investigation showed that Brownie failed at the constructor_arguments
lookup step.
How can it be fixed?
Brownie is not smart enough to look up the constructor parameters for contracts deployed by other contracts. For example, see this contract deployed by an internal transaction:
- https://etherscan.io/tx/0x07d10c02e14b8f468c0369b03f56a3ab229d0d116e1fa7f86b8781c7f33e550a
- Brownie fails to verify contracts deployed this way.
I put together a diff to show a potential workaround that we currently use, but I am not sure if that’s the best fix to adopt in Brownie. The workaround involves skipping the constructor_arguments
lookup if supplied directly.
See https://github.com/eth-brownie/brownie/pull/1662/files