You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Hardhat project and would like to add a Foundry script. I’m wondering if this is possible?
I’ve already installed hardhat-foundry and successfully built the project using both Foundry and Hardhat. However, I’m running into an issue with running a Foundry script. I’ve added the script contract to the script folder, but it isn’t being compiled and, as a result, it isn’t recognized when I try to execute it.
Is there a way to run Foundry scripts within a Hardhat project? Could there be something I’m missing in the configuration?
I’d appreciate any guidance on this.
Update: adding the script in the contracts folder seems to work because it compiles the contract, but I would like to have the script contract in the corresponding folder instead of the contracts one
The text was updated successfully, but these errors were encountered:
How do you execute the script is it through Foundry or Hardhat?
You can add extra folders to the path configuration for sources: #6112, this should get the Solidity files in the scripts folder included in the compilation.
It turns out the issue was a typo on my end. When I created the script contract, I mistakenly placed it in a folder named scripts (with an extra 's') instead of script. After renaming the folder or updating the script configuration in the foundry.toml, everything seems to work perfectly.
Hi there,
I have a Hardhat project and would like to add a Foundry script. I’m wondering if this is possible?
I’ve already installed hardhat-foundry and successfully built the project using both Foundry and Hardhat. However, I’m running into an issue with running a Foundry script. I’ve added the script contract to the script folder, but it isn’t being compiled and, as a result, it isn’t recognized when I try to execute it.
Is there a way to run Foundry scripts within a Hardhat project? Could there be something I’m missing in the configuration?
I’d appreciate any guidance on this.
Update: adding the script in the contracts folder seems to work because it compiles the contract, but I would like to have the script contract in the corresponding folder instead of the contracts one
The text was updated successfully, but these errors were encountered: