Closed pegahcarter closed 1 year ago
Encountering the same issue with a foundry based setup where the dependencies are under lib/
. I've installed hardhat-foundry as well. I'm not sure if hardhat-tenderly uses hardhats ability to derive the correct contract dependency path or if it implements it by itself. Either way it does not account for remappings. For contracts without dependencies it works fine. Without any custom workarounds currently it's not possible to use this plugin in a foundry + hardhat setup.
Hello 👋🏽
The resolving of dependencies is offloaded to hardhat. That is, we are asking hardhat to do the compilation and resolving of dependencies making the request to our backend server.
It seems that hardhat didn't resolve the dependencies right, thus all of the sources needed for compilation are not sent to the backend server which then reports the compilation error.
I can't pinpoint the problem since I am not able to reproduce it, that is, I am successfully managing to verify the contract you provided on my fork.
Some of the questions I can ask in order to debug the problem are:
I've created this POC. https://github.com/BarnBridge/tenderly-poc. I would expect it to work if hardhat-foundry is installed.
Resolved. We named remappings
parameter in compiler configuration remapping
. So when the client was sending remappings parameter to our backend server, the server couldn't resolve it.
This caused the compiler to fail to find the sources it needed to compile the contract for verification.
The new version is deployed now and the PoC should work as expected.
I'm running a simple script
script/deploy.ts
which deploys a very minimal ERC20 contract:I'm authenticated with tenderly CLI and here is my hardhat config:
When I run
npx hardhat run script/deploy.ts --network tenderly
I get the following error:What am I missing to make this automatic verification work?