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 am using hardhat-viem to generate type definitions for my smart contracts every time they are compiled, however, it only works for contracts inside of my /src directory (/contracts).
Since I have integrated Hardhat into my Foundry project, I have smart contracts inside my /script and /test directories as well. Specifically, I'd like to import one of my deploy scripts for testing. It's highly likely that I will create hardhat deploy scripts written in Javascript/Typescript to accompany the hardhat tests, but currently, since all of my deploy scripts are written in Solidity, it would be extremely convenient if I could directly use them in my hardhat Typescript tests.
I know a similar issue was also considered in 2020 and was given this code snippet as a part of a possible solution:
subtask(TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS,async(_,{ config })=>{constmainContracts=awaitglob(path.join(config.paths.root,"contracts/**/*.sol"));consttestContracts=awaitglob(path.join(config.paths.root,"test/**/*.sol"));// and so onreturn[
...mainContracts,
...testContracts,// and so on].map(path.normalize);// not sure if normalize is needed here});
However, since it is becoming more common for developers to use both Foundry and Hardhat in projects, it might also become more common for users to encounter this issue, see this StackExchange post as an example. For this reason, I think it would be beneficial to include support for this natively.
Search terms
compile artifacts types viem
The text was updated successfully, but these errors were encountered:
Describe the feature
I am using
hardhat-viem
to generate type definitions for my smart contracts every time they are compiled, however, it only works for contracts inside of my/src
directory (/contracts
).Since I have integrated Hardhat into my Foundry project, I have smart contracts inside my
/script
and/test
directories as well. Specifically, I'd like to import one of my deploy scripts for testing. It's highly likely that I will create hardhat deploy scripts written in Javascript/Typescript to accompany the hardhat tests, but currently, since all of my deploy scripts are written in Solidity, it would be extremely convenient if I could directly use them in my hardhat Typescript tests.I know a similar issue was also considered in 2020 and was given this code snippet as a part of a possible solution:
However, since it is becoming more common for developers to use both Foundry and Hardhat in projects, it might also become more common for users to encounter this issue, see this StackExchange post as an example. For this reason, I think it would be beneficial to include support for this natively.
Search terms
compile artifacts types viem
The text was updated successfully, but these errors were encountered: