Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access default hardhat compile and test while still using this plugin #88

Open
dino-rodriguez opened this issue Jul 20, 2022 · 3 comments

Comments

@dino-rodriguez
Copy link

dino-rodriguez commented Jul 20, 2022

Is there some way to still access the native hardhat calls using this plugin?

I really like how this cleanly integrates into hardhat and replaces the compilation pipeline with forge and hardhat node with anvil as it gives a huge performance boost. And because it generates hardhat artifacts, all the hardhat scripts work well with foundry under the hood.

However, it would still be useful to do the default hardhat compile from time to time to be able to generate typechain artifacts that I can pass to the front-end. And similarly, I can't seem to figure out a way to run the native hardhat tests, as hardhat test only looks for forge tests.

@dino-rodriguez dino-rodriguez changed the title Run typescript tests while still using this plugin Access default hardhat compile and test while still using this plugin Jul 20, 2022
@dino-rodriguez
Copy link
Author

Similarly, it seems if I try to run hardhat typechain to just generate the types I need, that command is overriden by foundry and only attempts to compile the contract.

λ › npx hardhat typechain                                                                  indie/contract  dr-foundry
[⠒] Compiling...
No files changed, compilation skipped

@dino-rodriguez
Copy link
Author

dino-rodriguez commented Jul 20, 2022

One suggestion here might be to add a flag for compilation and testing. Something like npx hardhat compile --forge instead of directly overwriting these commands. But I'm open to any solution or workaround you guys might have. @gakonst Using this plugin as opposed to the template because I saw your talk and I was really stoked about getting the performance benefits of foundry in Hardhat as we transition over :)

@clarkohw
Copy link

clarkohw commented Jan 25, 2024

+1 one on this, if anyone has any workarounds this would be great. Looking to transition to forge as a drop in compiler for local dev while slowly migrating from hardhat to forge on-chain. However, the ability to use the default impl would be super helpful.

Edit:
one workaround to this is to use a separate config file for hardhat vs foundry where you only import @foundry-rs/hardhat-forge in the foundry config :

yarn hardhat compile
yarn hardhat compile --config hardhat.config.forge.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants