Forrest logo
back to the hardhat tool

hardhat:tldr:004e9

hardhat: Clean the cache and all artifacts.
$ hardhat clean
try on your machine

The command "hardhat clean" is a command used in the Hardhat development environment for Ethereum smart contracts.

The "clean" command is used to remove the "artifacts" directory, which is a directory where Hardhat stores the compiled contract artifacts and build files. These artifacts are generated when you compile your smart contract using Hardhat.

By running "hardhat clean", you essentially delete the "artifacts" directory and its content. This can be useful when you want to start fresh or remove any previously generated artifacts before recompiling your contracts.

It's important to note that running the "clean" command will delete all the compiled contract artifacts, so make sure you have a backup or a repository where you can retrieve them if needed.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the hardhat tool