Skip to content

Commit

Permalink
Compile show stack-trace and being verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
Yosif committed Jun 17, 2024
1 parent ee2364e commit e0c39fa
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/nftc-contracts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ jobs:
- name: Copy local solc cache
run: |
mkdir -p ~/.cache/hardhat-nodejs/Cache/compilers/linux-amd64
cp .solc_cache/list.json ~/.cache/hardhat-nodejs/Cache/compilers/linux-amd64/
cp .solc_cache/solc-linux-amd64-v0.8.21+commit.d9974bed ~/.cache/hardhat-nodejs/Cache/compilers/linux-amd64/solc-linux-amd64-v0.8.21+commit.d9974bed
cp .solc_cache/list.json ~/.cache/hardhat-nodejs/compilers/linux-amd64/
cp .solc_cache/solc-linux-amd64-v0.8.21+commit.d9974bed ~/.cache/hardhat-nodejs/compilers/linux-amd64/solc-linux-amd64-v0.8.21+commit.d9974bed
- name: Hardhat compiler cache
run: ls ~/.cache/hardhat-nodejs/Cache/compilers/linux-amd64/
run: ls ~/.cache/hardhat-nodejs/compilers/linux-amd64/

- name: Make solc executable
run: chmod +x ~/.cache/hardhat-nodejs/Cache/compilers/linux-amd64/solc-linux-amd64-v0.8.21+commit.d9974bed
run: chmod +x ~/.cache/hardhat-nodejs/compilers/linux-amd64/solc-linux-amd64-v0.8.21+commit.d9974bed

- name: Clean install
run: npm ci
Expand Down
28 changes: 27 additions & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,34 @@
import { resolve } from 'path';

import dotenv from 'dotenv';
dotenv.config(); // console.log(process.env);
import { HardhatUserConfig } from 'hardhat/config';
import { TASK_COMPILE_SOLIDITY_GET_SOLC_BUILD } from 'hardhat/builtin-tasks/task-names';
import { HardhatUserConfig, subtask } from 'hardhat/config';
import '@nomicfoundation/hardhat-toolbox';

/**
* This overrides the standard compiler version to use a custom compiled version. See `bin/README.md` for more
* information.
*/
subtask<{ solcVersion: string }>(TASK_COMPILE_SOLIDITY_GET_SOLC_BUILD, async (args, hre, next) => {
if (args.solcVersion === '0.8.21') {
const compilerPath = resolve(__dirname, 'solc-linux-amd64-v0.8.21+commit.d9974bed');

console.log('-----------');
console.log(compilerPath);
console.log('-----------');

return {
compilerPath,
isSolcJs: true,
version: args.solcVersion,
longVersion: '0.8.21+commit.d9974bed'
};
}

return next();
});

const REPORT_GAS: boolean = (process.env.REPORT_GAS || '').trim() === 'true';
//To enable, run 'npm run test:gas'. Not enabled by default using 'npx hardhat test'.
console.warn(`Include gas summary: ${REPORT_GAS}.`);
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"build-ts:compile": "tsc -p tsconfig.module.json --declaration",
"build": "run-p build:*",
"build:ts-module": "run-s build-ts:*",
"build:hardhat": "npx hardhat compile",
"build:hardhat": "npx hardhat compile --show-stack-traces --verbose",
"fix": "run-s fix:*",
"fix:prettier-sol": "prettier \"contracts/**/*.sol\" --write",
"fix:prettier-ts": "prettier \"src/**/*.ts\" --write",
Expand Down

0 comments on commit e0c39fa

Please sign in to comment.