Skip to content

Commit

Permalink
chore: trying new things
Browse files Browse the repository at this point in the history
  • Loading branch information
0xsambugs committed Feb 16, 2024
1 parent bb9d0ff commit 7ab9b6d
Showing 1 changed file with 2 additions and 58 deletions.
60 changes: 2 additions & 58 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,42 +1,10 @@
import 'dotenv/config';
import '@nomicfoundation/hardhat-toolbox';
import { removeConsoleLog } from 'hardhat-preprocessor';
import 'hardhat-deploy';
import { HardhatUserConfig, MultiSolcUserConfig, NetworksUserConfig } from 'hardhat/types';
import * as env from './utils/env';
import { HardhatUserConfig } from 'hardhat/types';
import 'tsconfig-paths/register';

const networks: NetworksUserConfig =
env.isHardhatCompile() || env.isHardhatClean() || env.isTesting()
? {}
: {
hardhat: {
forking: {
enabled: process.env.FORK ? true : false,
url: env.getNodeUrl('ethereum'),
},
},
kovan: {
url: env.getNodeUrl('kovan'),
accounts: env.getAccounts('kovan'),
},
ethereum: {
url: env.getNodeUrl('ethereum'),
accounts: env.getAccounts('ethereum'),
},
};

const config: HardhatUserConfig = {
defaultNetwork: 'hardhat',
namedAccounts: {
deployer: {
default: 0,
},
},
mocha: {
timeout: process.env.MOCHA_TIMEOUT || 300000,
},
networks,
solidity: {
compilers: [
{
Expand All @@ -50,18 +18,7 @@ const config: HardhatUserConfig = {
},
],
},
gasReporter: {
currency: process.env.COINMARKETCAP_DEFAULT_CURRENCY,
coinmarketcap: process.env.COINMARKETCAP_API_KEY,
showMethodSig: true,
onlyCalledMethods: false,
},
preprocess: {
eachLine: removeConsoleLog((hre) => hre.network.name !== 'hardhat'),
},
etherscan: {
apiKey: env.getEtherscanAPIKeys(['ethereum']),
},
defaultNetwork: 'hardhat',
typechain: {
outDir: 'typechained',
target: 'ethers-v5',
Expand All @@ -71,17 +28,4 @@ const config: HardhatUserConfig = {
},
};

if (env.isTesting()) {
(config.solidity as MultiSolcUserConfig).compilers = (config.solidity as MultiSolcUserConfig).compilers.map((compiler) => {
return {
...compiler,
outputSelection: {
'*': {
'*': ['storageLayout'],
},
},
};
});
}

export default config;

0 comments on commit 7ab9b6d

Please sign in to comment.