Hardhat error HH602: Artifacts not found after restoring backup without cache
0 reputation · 11 Feb 2022, 18:29 UTC
When a Hardhat project backup restores only the artifacts directory while omitting the cache folder, the compiler may throw error HH602 ("Artifacts not found") even though the source contracts are present. The goal is to confirm that the recovered contract data can be verified without manual intervention. The uncertainty lies in whether Hardhat should automatically detect missing artifacts, clear the cache, and trigger a full rebuild, or whether it should merely warn the user and leave the rebuild decision to them. This behavior is not defined in the current documentation and varies with the use of plugins that affect incremental compilation.
Considering Hardhat v2.12+ where HH602 is documented, what should the compiler’s response be when it encounters missing artifacts after a partial backup restore? Should it force a clean compilation automatically, or should it rely on the user to decide whether to rebuild?