mirror of
https://github.com/acid-info/Kurate.git
synced 2025-02-05 04:24:01 +00:00
657b850a4e
Co-authored-by: Philippe Schommers <philippe@schommers.be>
63 lines
1.6 KiB
TypeScript
63 lines
1.6 KiB
TypeScript
import "@nomiclabs/hardhat-ethers"
|
|
import "@nomicfoundation/hardhat-chai-matchers"
|
|
import "@semaphore-protocol/hardhat"
|
|
import "@typechain/hardhat"
|
|
import { config as dotenvConfig } from "dotenv"
|
|
import "hardhat-gas-reporter"
|
|
import { HardhatUserConfig } from "hardhat/config"
|
|
import { NetworksUserConfig } from "hardhat/types"
|
|
import { resolve } from "path"
|
|
import "solidity-coverage"
|
|
import { config } from "./package.json"
|
|
import "./tasks/deploy"
|
|
|
|
dotenvConfig({ path: resolve(__dirname, "../../.env") })
|
|
|
|
function getNetworks(): NetworksUserConfig {
|
|
if (process.env.ETHEREUM_URL && process.env.ETHEREUM_PRIVATE_KEY) {
|
|
const accounts = [`0x${process.env.ETHEREUM_PRIVATE_KEY}`]
|
|
|
|
return {
|
|
goerli: {
|
|
url: process.env.ETHEREUM_URL,
|
|
chainId: 5,
|
|
accounts
|
|
},
|
|
sepolia: {
|
|
url: process.env.ETHEREUM_URL,
|
|
chainId: 11155111,
|
|
accounts
|
|
}
|
|
}
|
|
}
|
|
|
|
return {}
|
|
}
|
|
|
|
const hardhatConfig: HardhatUserConfig = {
|
|
solidity: config.solidity,
|
|
paths: {
|
|
sources: config.paths.contracts,
|
|
tests: config.paths.tests,
|
|
cache: config.paths.cache,
|
|
artifacts: config.paths.build.contracts
|
|
},
|
|
networks: {
|
|
hardhat: {
|
|
chainId: 1337
|
|
},
|
|
...getNetworks()
|
|
},
|
|
gasReporter: {
|
|
currency: "USD",
|
|
enabled: process.env.REPORT_GAS === "true",
|
|
coinmarketcap: process.env.COINMARKETCAP_API_KEY
|
|
},
|
|
typechain: {
|
|
outDir: config.paths.build.typechain,
|
|
target: "ethers-v5"
|
|
}
|
|
}
|
|
|
|
export default hardhatConfig
|