I'm starting to use HardHat for my project and I created a list of (super useful) tasks ans now I'm trying to implement tests and I want to use some task (like deploy to setup my smart-contract environment without re-writing the code everywhere.
Is this possible ?
Thank
Best Answer
Yes you can run a Hardhat task programmatically by importing the
run
function from the Hardhat Runtime Environment:See the docs for more examples.