Skip to content

Commit

Permalink
added npm run check and updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ahramy committed Aug 22, 2024
1 parent e5e11e5 commit eda7312
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ REPORT_GAS=true npm run test

Check storage layout of contracts.
```bash
STORAGE_LAYOUT=true npx hardhat check
STORAGE_LAYOUT=true npm run check
```

Check contract bytecode size
Expand Down
16 changes: 9 additions & 7 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,20 @@ const optimizerSettings = {

// Need to manually specify outputSelection settings for the hardhat-storage-layout plugin since we're using customized compiler settings.
// https://www.npmjs.com/package/hardhat-storage-layout?activeTab=code
const outputSelectionSettings = {
"*": {
"*": ["storageLayout"],
},
};
const outputSelectionSettings = process.env.STORAGE_LAYOUT
? {
'*': {
'*': ['storageLayout'],
},
}
: {};

const defaultSettings = {
version: '0.8.23',
settings: {
evmVersion: process.env.EVM_VERSION || 'london',
optimizer: optimizerSettings,
outputSelection: process.env.STORAGE_LAYOUT ? {} : outputSelectionSettings,
outputSelection: outputSelectionSettings,
},
};

Expand All @@ -58,7 +60,7 @@ const compilerSettings = {
settings: {
evmVersion: process.env.EVM_VERSION || 'london',
optimizer: optimizerSettings,
outputSelection: process.env.STORAGE_LAYOUT ? {} : outputSelectionSettings,
outputSelection: outputSelectionSettings,
},
};

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"build": "npx hardhat clean && npx hardhat compile && npm run copy:interfaces",
"test": "npx hardhat test",
"check": "npx hardhat clean && npx hardhat compile && npx hardhat check",
"test-evm-versions": "bash scripts/test-evm-versions.sh",
"copy:interfaces": "rm -rf interfaces && mkdir interfaces && cp artifacts/contracts/interfaces/*/*.json interfaces/ && rm interfaces/*.dbg.json",
"clean:artifacts": "rm -rf artifacts/build-info artifacts/*/test artifacts/contracts/*/*/*.dbg.json",
Expand Down

0 comments on commit eda7312

Please sign in to comment.