Skip to content

Commit cd82419

Browse files
authored
Merge pull request #51 from PraneshASP/fix/contract-size-hardhat
🔨 Fix Hardhat artifacts path detection
2 parents f8aedc9 + 9f7b793 commit cd82419

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
custom: "https://www.omo.so/praneshasp"

src/commands/contract-size.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,12 @@ function getContractSizes(fileName) {
130130
const foundryJsonPath = path.join(workspaceRoot, foundryOutDir, `${path.basename(fileName)}`, `${contractName}.json`);
131131
let hardhatJsonPath = null;
132132
if (hardhatOutDir) {
133-
const relativePath = path.relative(path.join(workspaceRoot, 'contracts'), fileName);
133+
const relativePath = path.relative(workspaceRoot, fileName);
134134
hardhatJsonPath = path.join(hardhatOutDir, relativePath, `${contractName}.json`);
135135
}
136136

137137
const jsonPaths = [foundryJsonPath, hardhatJsonPath].filter(Boolean);
138-
139-
for (const jsonPath of jsonPaths) {
138+
for (const jsonPath of jsonPaths) {
140139
try {
141140
if (fs.existsSync(jsonPath)) {
142141
const jsonContent = JSON.parse(fs.readFileSync(jsonPath, 'utf8'));

0 commit comments

Comments
 (0)