2022-06-23 15:36:10 +02:00
|
|
|
import * as dotenv from "dotenv";
|
|
|
|
|
|
|
|
import { HardhatUserConfig, task } from "hardhat/config";
|
|
|
|
import "@nomiclabs/hardhat-waffle";
|
|
|
|
import "hardhat-gas-reporter";
|
|
|
|
import "solidity-coverage";
|
2022-11-25 09:41:12 +05:30
|
|
|
import { NetworksUserConfig } from "hardhat/types";
|
2022-06-23 15:36:10 +02:00
|
|
|
|
|
|
|
dotenv.config();
|
2022-06-23 17:25:07 +02:00
|
|
|
const {GOERLI_URL,PRIVATE_KEY} = process.env;
|
|
|
|
|
2022-11-25 09:41:12 +05:30
|
|
|
const getNetworkConfig = (): NetworksUserConfig | undefined => {
|
|
|
|
if (GOERLI_URL && PRIVATE_KEY) {
|
|
|
|
return {
|
|
|
|
goerli: {
|
|
|
|
url: GOERLI_URL,
|
|
|
|
accounts: [PRIVATE_KEY],
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
return undefined;
|
|
|
|
}
|
2022-06-23 15:36:10 +02:00
|
|
|
|
|
|
|
// You need to export an object to set up your config
|
|
|
|
// Go to https://hardhat.org/config/ to learn more
|
|
|
|
|
|
|
|
const config: HardhatUserConfig = {
|
2022-11-24 12:09:44 +05:30
|
|
|
solidity: {
|
|
|
|
compilers: [{
|
|
|
|
version: "0.8.4",
|
|
|
|
}, {
|
|
|
|
version: "0.8.15"
|
|
|
|
}],
|
|
|
|
},
|
2022-11-25 09:41:12 +05:30
|
|
|
networks: getNetworkConfig()
|
2022-06-23 15:36:10 +02:00
|
|
|
};
|
|
|
|
|
2022-06-23 17:25:07 +02:00
|
|
|
export default config;
|