hardhat/types#HardhatUserConfig TypeScript Examples
The following examples show how to use
hardhat/types#HardhatUserConfig.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.ts From openzeppelin-upgrades with MIT License | 6 votes |
extendConfig((config: HardhatConfig, userConfig: Readonly<HardhatUserConfig>) => {
if (!userConfig.defender || !userConfig.defender.apiKey || !userConfig.defender.apiSecret) {
const sampleConfig = JSON.stringify({ apiKey: 'YOUR_API_KEY', apiSecret: 'YOUR_API_SECRET' }, null, 2);
console.warn(
`Defender API key and secret are not set. Add the following to your hardhat.config.js exported configuration:\n\n${sampleConfig}\n`,
);
}
config.defender = userConfig.defender;
});
Example #2
Source File: index.ts From hardhat-kms-signer with MIT License | 6 votes |
extendConfig(
(config: HardhatConfig, userConfig: Readonly<HardhatUserConfig>) => {
const userNetworks = userConfig.networks;
if (userNetworks === undefined) {
return;
}
for (const networkName in userNetworks) {
if (networkName === "hardhat") {
continue;
}
const network = userNetworks[networkName]!;
if (network.kmsKeyId) {
config.networks[networkName].kmsKeyId = network.kmsKeyId;
}
}
}
);
Example #3
Source File: hardhat.config.ts From hardhat-circom with GNU General Public License v3.0 | 6 votes |
config: HardhatUserConfig = {
solidity: "0.7.3",
defaultNetwork: "hardhat",
paths: {
sources: "/contracts",
artifacts: "/artifacts",
},
circom: {
inputBasePath: "/circuits",
outputBasePath: "/client/public",
ptau: "pot15_final.ptau",
circuits: [
{
name: "biomebase",
beacon: "0000000005060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
},
{
name: "move",
protocol: "plonk",
},
{
name: "init",
version: 1,
circuit: "circuit.circom",
input: "input.json",
wasm: "circuit.wasm",
r1cs: "circuit.r1cs",
zkey: "circuit.zkey",
vkey: "circuit.vkey.json",
},
],
},
}
Example #4
Source File: hardhat.config.ts From hardhat-circom with GNU General Public License v3.0 | 6 votes |
config: HardhatUserConfig = {
solidity: "0.6.7",
circom: {
ptau: "pot15_final.ptau",
circuits: [
{
name: "hash",
},
],
},
}
Example #5
Source File: hardhat.flatten.clearinghouse.config.ts From perpetual-protocol with GNU General Public License v3.0 | 6 votes |
config: HardhatUserConfig = {
...originalConfig,
paths: {
// source & artifacts does not work since we use openzeppelin-sdk for upgradable contract
sources: join(FLATTEN_BASE_DIR, dirName, SRC_DIR_NAME),
artifacts: join(FLATTEN_BASE_DIR, dirName, ARTIFACTS_DIR),
tests: join(FLATTEN_BASE_DIR, dirName, "./tests"),
cache: join(FLATTEN_BASE_DIR, dirName, "./cache"),
},
}
Example #6
Source File: hardhat.flatten.amm.config.ts From perpetual-protocol with GNU General Public License v3.0 | 6 votes |
config: HardhatUserConfig = {
...originalConfig,
paths: {
// source & artifacts does not work since we use openzeppelin-sdk for upgradable contract
sources: join(FLATTEN_BASE_DIR, dirName, SRC_DIR_NAME),
artifacts: join(FLATTEN_BASE_DIR, dirName, ARTIFACTS_DIR),
tests: join(FLATTEN_BASE_DIR, dirName, "./tests"),
cache: join(FLATTEN_BASE_DIR, dirName, "./cache"),
},
}
Example #7
Source File: hardhat.config.ts From airnode with MIT License | 6 votes |
config: HardhatUserConfig = {
defaultNetwork: 'localhost',
solidity: {
compilers: [{ version: '0.6.12', settings: {} }],
},
networks: {
hardhat: {
accounts: {
// These accounts are used to deploy contracts and fund all Airnode
// related accounts. Make sure they have more than enough ETH to
// do this (1m ETH each).
accountsBalance: '1000000000000000000000000',
count: 1000,
},
},
localhost: {
url: 'http://127.0.0.1:8545/',
},
coverage: {
url: 'http://127.0.0.1:8555', // Coverage launches its own ganache-cli client
},
},
}
Example #8
Source File: hardhat.config.ts From commonwealth with GNU General Public License v3.0 | 5 votes |
config: HardhatUserConfig = {
networks: {
hardhat: {
allowUnlimitedContractSize: true,
loggingEnabled: true,
},
},
solidity: {
compilers: [
{
version: '0.8.4',
settings: {
optimizer: { enabled: true, runs: 200 },
evmVersion: 'istanbul',
},
},
{
version: '0.8.0',
settings: {
optimizer: { enabled: true, runs: 200 },
evmVersion: 'istanbul',
},
},
{
version: '0.7.5',
settings: {
optimizer: { enabled: true, runs: 200 },
evmVersion: 'istanbul',
},
},
{
version: '0.6.8',
settings: {
optimizer: { enabled: true, runs: 200 },
evmVersion: 'istanbul',
},
},
{
version: '0.6.12',
settings: {
optimizer: { enabled: true, runs: 200 },
evmVersion: 'istanbul',
},
},
{
version: '0.7.5',
settings: {
optimizer: { enabled: true, runs: 200 },
evmVersion: 'istanbul',
},
},
{
version: '0.5.5',
settings: {
optimizer: { enabled: true, runs: 200 },
evmVersion: 'petersburg',
},
},
{
version: '0.5.16',
settings: {
optimizer: { enabled: true, runs: 200 },
evmVersion: 'istanbul',
},
},
],
},
typechain: {
outDir: './types',
target: 'ethers-v5',
},
}
Example #9
Source File: hardhat.config.ts From hoprnet with GNU General Public License v3.0 | 5 votes |
hardhatConfig: HardhatUserConfig = {
networks,
namedAccounts: {
deployer: 0,
admin: {
default: 1,
goerli: '0xA18732DC751BE0dB04157eb92C92BA9d0fC09FC5',
xdai: '0xE9131488563776DE7FEa238d6112c5dA46be9a9F'
},
alice: {
default: 2,
goerli: '0x3dA21EB3D7d40fEA6bd78c627Cc9B1F59E7481E1',
xdai: '0x3dA21EB3D7d40fEA6bd78c627Cc9B1F59E7481E1'
}
},
solidity: {
compilers: ['0.8.9', '0.6.6', '0.4.24'].map<SolcUserConfig>((version) => ({
version,
settings: {
optimizer: {
enabled: true,
runs: 200
},
outputSelection: {
'*': {
'*': ['storageLayout']
}
}
}
}))
},
paths: {
sources: './contracts',
tests: './test',
cache: './hardhat/cache',
artifacts: './hardhat/artifacts',
// used by hardhat-deploy
deployments: `./deployments/${HOPR_ENVIRONMENT_ID}`
},
typechain: {
outDir: './src/types',
target: 'ethers-v5'
},
gasReporter: {
currency: 'USD',
excludeContracts: ['mocks', 'utils/console.sol']
},
verify: {
etherscan: {
apiKey: ETHERSCAN_KEY
}
}
}
Example #10
Source File: hardhat.config.ts From airnode with MIT License | 5 votes |
config: HardhatUserConfig = {
defaultNetwork: integrationInfo?.network,
networks,
solidity: '0.8.9',
}
Example #11
Source File: index.ts From hardhat-circom with GNU General Public License v3.0 | 5 votes |
extendConfig((config: HardhatConfig, userConfig: Readonly<HardhatUserConfig>) => {
const { root } = config.paths;
const { inputBasePath, outputBasePath, ptau, circuits = [] } = userConfig.circom ?? {};
if (circuits.length === 0) {
throw new HardhatPluginError(
PLUGIN_NAME,
"Missing required circuits list, please provide via hardhat.config.js (circom.circuits) a list of circuit names to load from the inputBasePath"
);
}
if (!ptau) {
throw new HardhatPluginError(
PLUGIN_NAME,
"Missing required ptau location, please provide via hardhat.config.js (circom.ptau) the location of your ptau file"
);
}
const defaultInputBasePath = path.join(root, "circuits");
const defaultOutputBasePath = path.join(root, "circuits");
const normalizedInputBasePath = normalize(root, inputBasePath) ?? defaultInputBasePath;
const normalizedOutputBasePath = normalize(root, outputBasePath) ?? defaultOutputBasePath;
const normalizedPtauPath = path.resolve(normalizedInputBasePath, ptau);
config.circom = {
inputBasePath: normalizedInputBasePath,
outputBasePath: normalizedOutputBasePath,
ptau: normalizedPtauPath,
circuits: [],
};
for (const { name, version, protocol, beacon, circuit, input, wasm, r1cs, zkey, vkey } of circuits) {
if (!name) {
throw new HardhatPluginError(
PLUGIN_NAME,
"Missing required name field in circuits list, please provide via hardhat.config.js (circom.circuits.name)"
);
}
const circuitPath = path.resolve(normalizedInputBasePath, circuit ?? `${name}.circom`);
const inputPath = path.resolve(normalizedInputBasePath, input ?? `${name}.json`);
const wasmPath = path.resolve(normalizedOutputBasePath, wasm ?? `${name}.wasm`);
const r1csPath = path.resolve(normalizedOutputBasePath, r1cs ?? `${name}.r1cs`);
const zkeyPath = path.resolve(normalizedOutputBasePath, zkey ?? `${name}.zkey`);
const vkeyPath = path.resolve(normalizedOutputBasePath, vkey ?? `${name}.vkey.json`);
config.circom.circuits.push({
name: name,
version: version !== 1 ? 2 : 1,
protocol: protocol !== "plonk" ? "groth16" : "plonk",
beacon: beacon != null ? beacon : "0000000000000000000000000000000000000000000000000000000000000000",
circuit: circuitPath,
input: inputPath,
wasm: wasmPath,
r1cs: r1csPath,
zkey: zkeyPath,
vkey: vkeyPath,
});
}
});
Example #12
Source File: hardhat.config.ts From solidity-starter with MIT License | 5 votes |
config: HardhatUserConfig = {
paths: {
sources: './contracts',
tests: './test',
artifacts: './build/contracts',
},
solidity: {
compilers: [
{
version: '0.8.7',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
outputSelection: {
'*': {
'*': ['storageLayout'],
},
},
},
},
],
},
defaultNetwork: 'hardhat',
networks: {
hardhat: {
chainId: 1337,
loggingEnabled: false,
gas: 12000000,
gasPrice: 'auto',
blockGasLimit: 12000000,
accounts: {
mnemonic: 'myth like bonus scare over problem client lizard pioneer submit female collect',
},
},
ganache: {
chainId: 1337,
url: 'http://localhost:8545',
},
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
},
gasReporter: {
enabled: process.env.REPORT_GAS ? true : false,
showTimeSpent: true,
currency: 'USD',
outputFile: 'reports/gas-report.log',
},
typechain: {
outDir: 'build/types',
target: 'ethers-v5',
},
abiExporter: {
path: './build/abis',
clear: false,
flat: true,
},
tenderly: {
project: process.env.TENDERLY_PROJECT,
username: process.env.TENDERLY_USERNAME,
},
contractSizer: {
alphaSort: true,
runOnCompile: false,
disambiguatePaths: true,
},
}
Example #13
Source File: hardhat.config.ts From hypervisor with The Unlicense | 5 votes |
config: HardhatUserConfig = {
networks: {
hardhat: {
allowUnlimitedContractSize: false,
},
mainnet: {
url: `https://eth-mainnet.alchemyapi.io/v2/${process.env.ALCHEMY_API_KEY}`,
accounts: [process.env.MAINNET_PRIVATE_KEY as string],
},
},
watcher: {
compilation: {
tasks: ["compile"],
}
},
solidity: {
compilers: [
{
version: '0.7.6',
settings: {
optimizer: {
enabled: true,
runs: 800,
},
metadata: {
// do not include the metadata hash, since this is machine dependent
// and we want all generated code to be deterministic
// https://docs.soliditylang.org/en/v0.7.6/metadata.html
bytecodeHash: 'none',
},
},
},
{
version: '0.6.11'
}
],
},
etherscan: {
apiKey: process.env.ETHERSCAN_APIKEY,
},
mocha: {
timeout: 2000000
}
}
Example #14
Source File: hardhat.config.ts From safe-tasks with GNU Lesser General Public License v3.0 | 5 votes |
userConfig: HardhatUserConfig = {
paths: {
artifacts: "build/artifacts",
cache: "build/cache",
sources: "contracts",
},
solidity: {
compilers: [
{ version: primarySolidityVersion, settings: soliditySettings },
{ version: "0.6.12" },
{ version: "0.5.17" },
]
},
networks: {
hardhat: {
allowUnlimitedContractSize: true,
blockGasLimit: 100000000,
gas: 100000000
},
mainnet: {
...sharedNetworkConfig,
url: `https://mainnet.infura.io/v3/${INFURA_KEY}`,
},
xdai: {
...sharedNetworkConfig,
url: "https://xdai.poanetwork.dev",
},
ewc: {
...sharedNetworkConfig,
url: `https://rpc.energyweb.org`,
},
rinkeby: {
...sharedNetworkConfig,
url: `https://rinkeby.infura.io/v3/${INFURA_KEY}`,
},
goerli: {
...sharedNetworkConfig,
url: `https://goerli.infura.io/v3/${INFURA_KEY}`,
},
kovan: {
...sharedNetworkConfig,
url: `https://kovan.infura.io/v3/${INFURA_KEY}`,
},
volta: {
...sharedNetworkConfig,
url: `https://volta-rpc.energyweb.org`,
},
bsc: {
...sharedNetworkConfig,
url: `https://bsc-dataseed.binance.org/`,
},
},
namedAccounts: {
deployer: 0,
},
mocha: {
timeout: 2000000,
},
}
Example #15
Source File: hardhat.config.ts From hardhat-deploy with MIT License | 5 votes |
config: HardhatUserConfig = {
solidity: {
version: '0.7.3',
},
defaultNetwork: 'hardhat',
}
Example #16
Source File: hardhat.config.ts From hardhat-deploy-ts-test with MIT License | 5 votes |
config: HardhatUserConfig = {
solidity: {
version: '0.6.5',
},
namedAccounts: {
deployer: 0,
proxyOwner: 1,
admin: '0x5B9d721f482E60efA99e555Cb59c7DBF4Df15Dc7',
},
networks: {
coverage: {
url: 'http://localhost:5458',
accounts,
},
hardhat: {
accounts,
},
localhost: {
url: 'http://localhost:8545',
accounts,
},
rinkeby: {
url: 'https://rinkeby.infura.io/v3/' + process.env.INFURA_TOKEN,
accounts,
},
42: {
url: 'https://kovan.infura.io/v3/' + process.env.INFURA_TOKEN,
accounts,
},
staging: {
url: 'https://goerli.infura.io/v3/' + process.env.INFURA_TOKEN,
accounts,
},
},
paths: {
sources: 'src',
},
external: {
contracts: [
{artifacts: 'node_modules/@cartesi/arbitration/artifacts'},
{artifacts: 'node_modules/@cartesi/util/artifacts'},
],
deployments: {
rinkeby: ['node_modules/@cartesi/arbitration/deployments/rinkeby'],
},
},
}
Example #17
Source File: hardhat.config.ts From kitty-contracts with MIT License | 4 votes |
config: HardhatUserConfig = {
abiExporter: {
path: './abi',
clear: false,
flat: true,
// only: [],
// except: []
},
defaultNetwork: 'avalanche',
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
},
gasReporter: {
coinmarketcap: process.env.COINMARKETCAP_API_KEY,
currency: 'USD',
enabled: process.env.REPORT_GAS === 'true',
excludeContracts: ['contracts/mocks/', 'contracts/libraries/'],
},
mocha: {
timeout: 20000,
},
namedAccounts: {
deployer: {
default: 0,
},
dev: {
default: '0x6DDf58a4B4CD517D874D10cddddb61d3dc895978',
},
},
networks: {
mainnet: {
url: `https://mainnet.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts,
gasPrice: 6 * 1000000000,
chainId: 1,
},
localhost: {
live: false,
accounts,
saveDeployments: true,
tags: ['local'],
},
hardhat: {
forking: {
enabled: process.env.FORKING === 'true',
url: `https://eth-mainnet.alchemyapi.io/v2/${process.env.ALCHEMY_API_KEY}`,
},
live: false,
saveDeployments: true,
tags: ['test', 'local'],
},
ropsten: {
url: `https://ropsten.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts,
chainId: 3,
live: true,
saveDeployments: true,
tags: ['staging'],
gasPrice: 5000000000,
},
rinkeby: {
url: `https://rinkeby.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts,
chainId: 4,
live: true,
saveDeployments: true,
tags: ['staging'],
gasPrice: 5000000000,
},
coinnet: {
url: `https://data.1coin.network`,
accounts,
chainId: 85,
live: true,
saveDeployments: true,
gasPrice: 1 * 1000000000,
},
goerli: {
url: `https://goerli.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts,
chainId: 5,
live: true,
saveDeployments: true,
tags: ['staging'],
gasPrice: 5000000000,
gasMultiplier: 2,
},
kovan: {
url: `https://kovan.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts,
chainId: 42,
live: true,
saveDeployments: true,
tags: ['staging'],
gasPrice: 20000000000,
gasMultiplier: 2,
},
moonbase: {
url: 'https://rpc.testnet.moonbeam.network',
accounts,
chainId: 1287,
live: true,
saveDeployments: true,
tags: ['staging'],
gas: 5198000,
gasMultiplier: 2,
},
fantom: {
url: 'https://rpcapi.fantom.network',
accounts,
chainId: 250,
live: true,
saveDeployments: true,
},
'fantom-testnet': {
url: 'https://rpc.testnet.fantom.network',
accounts,
chainId: 4002,
live: true,
saveDeployments: true,
tags: ['staging'],
gasMultiplier: 2,
},
matic: {
url: 'https://rpc-mainnet.maticvigil.com',
accounts,
chainId: 137,
live: true,
saveDeployments: true,
},
mumbai: {
url: 'https://rpc-mumbai.maticvigil.com/',
accounts,
chainId: 80001,
live: true,
saveDeployments: true,
tags: ['staging'],
gasMultiplier: 2,
},
xdai: {
url: 'https://rpc.xdaichain.com',
accounts,
chainId: 100,
live: true,
saveDeployments: true,
},
bsc: {
url: 'https://bsc-dataseed.binance.org',
accounts,
chainId: 56,
live: true,
gasPrice: 5 * 1000000000,
saveDeployments: true,
},
'bsc-testnet': {
url: 'https://data-seed-prebsc-1-s1.binance.org:8545',
accounts,
chainId: 97,
live: true,
saveDeployments: true,
tags: ['staging'],
// gasPrice: 10 * 1000000000,
gasMultiplier: 2,
},
heco: {
url: 'https://http-mainnet.hecochain.com',
accounts,
chainId: 128,
live: true,
saveDeployments: true,
},
'heco-testnet': {
url: 'https://http-testnet.hecochain.com',
accounts,
chainId: 256,
live: true,
saveDeployments: true,
tags: ['staging'],
gasMultiplier: 2,
},
avalanche: {
url: 'https://api.avax.network/ext/bc/C/rpc',
accounts,
chainId: 43114,
live: true,
saveDeployments: true,
gasPrice: 25000000000,
},
fuji: {
url: 'https://api.avax-test.network/ext/bc/C/rpc',
accounts,
chainId: 43113,
live: true,
saveDeployments: true,
tags: ['staging'],
gasMultiplier: 2,
},
harmony: {
url: 'https://api.s0.t.hmny.io',
accounts,
chainId: 1666600000,
live: true,
saveDeployments: true,
},
'harmony-testnet': {
url: 'https://api.s0.b.hmny.io',
accounts,
chainId: 1666700000,
live: true,
saveDeployments: true,
tags: ['staging'],
gasMultiplier: 2,
},
okex: {
url: 'https://exchainrpc.okex.org',
accounts,
chainId: 66,
live: true,
saveDeployments: true,
},
'okex-testnet': {
url: 'https://exchaintestrpc.okex.org',
accounts,
chainId: 65,
live: true,
saveDeployments: true,
tags: ['staging'],
gasMultiplier: 2,
},
arbitrum: {
url: 'https://arb1.arbitrum.io/rpc',
accounts,
chainId: 42161,
live: true,
saveDeployments: true,
blockGasLimit: 700000,
},
'arbitrum-testnet': {
url: 'https://kovan3.arbitrum.io/rpc',
accounts,
chainId: 79377087078960,
live: true,
saveDeployments: true,
tags: ['staging'],
gasMultiplier: 2,
},
},
paths: {
artifacts: 'artifacts',
cache: 'cache',
deploy: 'deploy',
deployments: 'deployments',
imports: 'imports',
sources: 'contracts',
tests: 'test',
},
preprocess: {
eachLine: removeConsoleLog((bre) => bre.network.name !== 'hardhat' && bre.network.name !== 'localhost'),
},
solidity: {
compilers: [
{
version: '0.6.12',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
],
},
spdxLicenseIdentifier: {
overwrite: false,
runOnCompile: true,
},
tenderly: {
project: process.env.TENDERLY_PROJECT!,
username: process.env.TENDERLY_USERNAME!,
},
typechain: {
outDir: 'types',
target: 'ethers-v5',
},
watcher: {
compile: {
tasks: ['compile'],
files: ['./contracts'],
verbose: true,
},
},
}
Example #18
Source File: hardhat.config.ts From swap.kiwi with GNU General Public License v3.0 | 4 votes |
config: HardhatUserConfig = {
defaultNetwork: "hardhat",
solidity: {
version: "0.8.1",
settings: {
optimizer: {
enabled: true,
runs: 200
}
}
},
paths: {
sources: "./contracts",
artifacts: "./artifacts",
deploy: "./scripts",
},
networks: {
hardhat: {
loggingEnabled: false,
live: false,
accounts: accounts
},
coverage: {
url: 'http://127.0.0.1:5458'
},
localhost: {
url: 'http://127.0.0.1:8545',
live: true,
loggingEnabled: true
},
goerli: {
url: `https://goerli.infura.io/v3/${process.env.INFURA_PROJECT_ID}`,
accounts: {
mnemonic: `${process.env.GOERLI_MNEMONIC}`
},
chainId: 5,
loggingEnabled: true,
gas: "auto",
gasPrice: "auto",
gasMultiplier: 1.5
},
rinkeby: {
url: `https://rinkeby.infura.io/v3/${process.env.INFURA_PROJECT_ID}`,
accounts: {
mnemonic: `${process.env.RINKEBY_MNEMONIC}`
},
chainId: 4,
loggingEnabled: true,
gas: "auto",
gasPrice: "auto",
gasMultiplier: 1.5
},
ropsten: {
url: `https://ropsten.infura.io/v3/${process.env.INFURA_PROJECT_ID}`,
accounts: {
mnemonic: `${process.env.ROPSTEN_MNEMONIC}`
},
chainId: 3,
loggingEnabled: true,
gas: "auto",
gasPrice: "auto",
gasMultiplier: 1.5
},
mainnet: {
url: `https://mainnet.infura.io/v3/${process.env.INFURA_PROJECT_ID}`,
accounts: {
mnemonic: `${process.env.MAINNET_MNEMONIC}`
},
}
},
gasReporter: {
coinmarketcap: process.env.COINMARKETCAP_API_KEY,
enabled: !!(process.env.REPORT_GAS && process.env.REPORT_GAS != "false"),
},
typechain: {
outDir: "typechain",
target: "ethers-v5"
},
namedAccounts: {
deployer: {
default: 0,
6: 0
}
}
}
Example #19
Source File: hardhat.config.ts From gateway-sol with GNU General Public License v3.0 | 4 votes |
config: HardhatUserConfig = {
solidity: {
version: "0.8.7",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
namedAccounts: {
deployer: 0,
},
networks: {
hardhat: {
initialBaseFeePerGas: 0, // to fix : https://github.com/sc-forks/solidity-coverage/issues/652, see https://github.com/sc-forks/solidity-coverage/issues/652#issuecomment-896330136
// process.env.HARDHAT_FORK will specify the network that the fork is made from.
// this line ensure the use of the corresponding accounts
accounts: accounts(process.env.HARDHAT_FORK),
forking: process.env.HARDHAT_FORK
? {
// TODO once PR merged : network: process.env.HARDHAT_FORK,
url: node_url(process.env.HARDHAT_FORK),
blockNumber: process.env.HARDHAT_FORK_NUMBER
? parseInt(process.env.HARDHAT_FORK_NUMBER)
: undefined,
}
: undefined,
// allowUnlimitedContractSize: true,
},
ethereumMainnet: {
url: `https://mainnet.infura.io/v3/${INFURA_KEY}`,
accounts: {
mnemonic: MNEMONIC_MAINNET,
},
},
ethereumTestnet: {
url: `https://kovan.infura.io/v3/${INFURA_KEY}`,
accounts: {
mnemonic: MNEMONIC_TESTNET,
},
gasPrice: 2.5 * 1e9,
},
ethereumDevnet: {
url: `https://kovan.infura.io/v3/${INFURA_KEY}`,
accounts: {
mnemonic: MNEMONIC_DEVNET,
},
},
bscTestnet: {
url: `https://data-seed-prebsc-1-s1.binance.org:8545`,
accounts: {
mnemonic: MNEMONIC_TESTNET,
},
},
bscMainnet: {
url: `https://bsc-dataseed1.binance.org/`,
accounts: {
mnemonic: MNEMONIC_MAINNET,
},
// gasPrice: 10 * 1e9,
},
polygonTestnet: {
url: `https://rpc-mumbai.maticvigil.com/`,
accounts: {
mnemonic: MNEMONIC_TESTNET,
},
},
polygonMainnet: {
url: `https://rpc-mainnet.maticvigil.com`,
accounts: {
mnemonic: MNEMONIC_MAINNET,
},
},
fantomTestnet: {
url: `https://rpc.testnet.fantom.network/`,
accounts: {
mnemonic: MNEMONIC_TESTNET,
},
},
fantomMainnet: {
url: "https://rpc.ftm.tools",
accounts: {
mnemonic: MNEMONIC_MAINNET,
},
},
avalancheTestnet: {
url: `https://api.avax-test.network/ext/bc/C/rpc`,
accounts: {
mnemonic: MNEMONIC_TESTNET,
},
},
avalancheMainnet: {
url: `https://api.avax.network/ext/bc/C/rpc`,
accounts: {
mnemonic: MNEMONIC_MAINNET,
},
},
arbitrumTestnet: {
url: `https://rinkeby.arbitrum.io/rpc`,
accounts: {
mnemonic: MNEMONIC_TESTNET,
},
// gasPrice: 0, // https://developer.offchainlabs.com/docs/contract_deployment
// gas: 80000000,
},
arbitrumMainnet: {
url: `https://arb1.arbitrum.io/rpc`,
accounts: {
mnemonic: MNEMONIC_MAINNET,
},
// gasPrice: 0,
// gas: 80000000,
},
goerliTestnet: {
url: `https://goerli.infura.io/v3/${INFURA_KEY}`,
accounts: {
mnemonic: MNEMONIC_TESTNET,
},
gasPrice: 2000000000,
},
},
deterministicDeployment: (network: string) => {
// Skip on hardhat's local network.
if (network === "31337") {
return undefined;
}
return {
factory: "0x2222229fb3318a6375fa78fd299a9a42ac6a8fbf",
deployer: "0x90899d3cc800c0a9196aec83da43e46582cb7435",
// Must be deployed manually. Required funding may be more on
// certain chains (e.g. Ethereum mainnet).
funding: "10000000000000000",
signedTx: "0x00",
};
},
paths: {
sources: "src",
},
gasReporter: {
currency: "USD",
gasPrice: 100,
enabled: process.env.REPORT_GAS ? true : false,
coinmarketcap: process.env.COINMARKETCAP_API_KEY,
maxMethodDiff: 10,
},
typechain: {
outDir: "typechain",
target: "ethers-v5",
},
mocha: {
timeout: 0,
},
etherscan: {
// Your API key for Etherscan
// Obtain one at https://etherscan.io/
apiKey: process.env.BSCSCAN_KEY,
},
}
Example #20
Source File: index.ts From hardhat-deploy with MIT License | 4 votes |
extendConfig(
(config: HardhatConfig, userConfig: Readonly<HardhatUserConfig>) => {
config.paths.deployments = normalizePath(
config,
userConfig.paths?.deployments,
'deployments'
);
config.paths.imports = normalizePath(
config,
userConfig.paths?.imports,
'imports'
);
if (userConfig.paths?.deploy) {
let deployPaths = [];
if (typeof userConfig.paths.deploy === 'string') {
deployPaths = [userConfig.paths.deploy];
} else {
deployPaths = userConfig.paths.deploy;
}
config.paths.deploy = deployPaths.map((p) =>
normalizePath(config, p, 'deploy')
);
} else {
config.paths.deploy = [normalizePath(config, undefined, 'deploy')];
}
if (userConfig.namedAccounts) {
config.namedAccounts = userConfig.namedAccounts;
} else {
config.namedAccounts = {};
}
config.deterministicDeployment = userConfig.deterministicDeployment;
if (userConfig.external) {
if (!config.external) {
config.external = {};
}
if (userConfig.external.contracts) {
const externalContracts: {artifacts: string[]; deploy?: string}[] = [];
config.external.contracts = externalContracts;
for (const userDefinedExternalContracts of userConfig.external
.contracts) {
const userArtifacts =
typeof userDefinedExternalContracts.artifacts === 'string'
? [userDefinedExternalContracts.artifacts]
: userDefinedExternalContracts.artifacts;
externalContracts.push({
artifacts: userArtifacts.map((v) => normalizePath(config, v, v)),
deploy: userDefinedExternalContracts.deploy
? normalizePath(
config,
userDefinedExternalContracts.deploy,
userDefinedExternalContracts.deploy
)
: undefined,
});
}
}
if (userConfig.external.deployments) {
config.external.deployments = {};
for (const key of Object.keys(userConfig.external.deployments)) {
config.external.deployments[key] = normalizePathArray(
config,
userConfig.external.deployments[key]
);
}
}
}
for (const compiler of config.solidity.compilers) {
setupExtraSolcSettings(compiler.settings);
}
const defaultConfig = {};
if (userConfig.verify !== undefined) {
const customConfig = userConfig.verify;
config.verify = {...defaultConfig, ...customConfig};
} else {
config.verify = defaultConfig;
// backward compatibility for runtime (js)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if ((userConfig as any).etherscan) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
config.verify.etherscan = (userConfig as any).etherscan;
}
}
}
);