mirror of
https://github.com/acid-info/Kurate.git
synced 2025-02-05 04:24:01 +00:00
3cf79d323d
Co-authored-by: Vojtech Simetka <vojtech@simetka.cz>
77 lines
2.0 KiB
TypeScript
77 lines
2.0 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
|
|
},
|
|
// arbitrum goerli
|
|
agor: {
|
|
url: 'https://goerli-rollup.arbitrum.io/rpc',
|
|
chainId: 421613,
|
|
accounts,
|
|
},
|
|
sepolia: {
|
|
url: process.env.ETHEREUM_URL,
|
|
chainId: 11155111,
|
|
accounts
|
|
},
|
|
localhost: {
|
|
url: 'http://127.0.0.1:7545',
|
|
chainId: 1337,
|
|
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"
|
|
},
|
|
mocha: {
|
|
timeout: 120000
|
|
}
|
|
}
|
|
|
|
export default hardhatConfig
|