From 2f837f40da3b3b2296b78a0e6162db5578a46800 Mon Sep 17 00:00:00 2001 From: Daniel Beal Date: Tue, 24 Sep 2024 19:56:06 +0900 Subject: [PATCH] add warning when no contracts found for storage dump. --- utils/hardhat-storage/src/tasks/dump.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/utils/hardhat-storage/src/tasks/dump.ts b/utils/hardhat-storage/src/tasks/dump.ts index 276913e828..0a8633ee63 100644 --- a/utils/hardhat-storage/src/tasks/dump.ts +++ b/utils/hardhat-storage/src/tasks/dump.ts @@ -40,6 +40,12 @@ task(TASK_STORAGE_DUMP, 'Dump storage slots to a file') const { contracts, getArtifact } = await hre.run(SUBTASK_GET_ARTIFACTS); + if (!contracts.length) { + logger.warn( + 'WARN: No contracts were found for storage checking, and your storage dump will be empty. Please check (and possibly add) a storage configuration in your hardhat configuration and try again.' + ); + } + if (!noValidate) { await hre.run(SUBTASK_VALIDATE_CONTRACTS, { contracts, getArtifact }); }