Open alexanderattar opened 1 year ago
Believe issue #126 is a duplicate of this. I also had this issue, and think it would be useful if this was fixed as foundry/hardhat hybrid repositories are somewhat common. My workaround was to duplicate the dependencies, and remap them in foundry so that they match hardhat (and remove hardhat-preprocessor).
Hello @alexanderattar,
Is the issue resolved for you in some of the newer versions of the plugin?
Or you are still having the same error?
Thanks for reporting! Also, sorry for the research that you had to go to in order to RCA this :(
After much debugging trying to get the
tenderly:verify
function to work I've realized that these libraries are incompatible. I kept getting the error:Error: There are multiple definitions of libraries the contract should use. One is defined in the verify request and the other as an compiler config override. Please remove one of them.
Due to these lines of code in util.js:
After logging the compiler.settings.libraries object I realized a cache buster was getting injected and causing this error to get thrown. Eventually I pinpointed it down to be a result of hardhat-preprocessor injecting this value.
Please consider rethinking how this is handled to avoid others from going down the same rabbit hole I had to 🙏
For context these are the relevant lines in hardhat-preprocessor index.js