2022-06-23 13:36:10 +00:00
|
|
|
import * as dotenv from "dotenv";
|
|
|
|
|
2023-03-29 06:28:09 +00:00
|
|
|
import { HardhatUserConfig } from "hardhat/config";
|
|
|
|
import { NetworksUserConfig } from "hardhat/types";
|
|
|
|
|
2023-03-29 06:58:42 +00:00
|
|
|
import "@nomicfoundation/hardhat-foundry";
|
2023-03-29 06:28:09 +00:00
|
|
|
import "hardhat-deploy";
|
2023-03-29 06:58:42 +00:00
|
|
|
import "@nomiclabs/hardhat-etherscan";
|
2023-03-29 06:28:09 +00:00
|
|
|
import "@nomiclabs/hardhat-ethers";
|
2022-06-23 13:36:10 +00:00
|
|
|
import "@nomiclabs/hardhat-waffle";
|
|
|
|
import "hardhat-gas-reporter";
|
|
|
|
import "solidity-coverage";
|
|
|
|
|
|
|
|
dotenv.config();
|
2023-03-29 06:58:42 +00:00
|
|
|
const { SEPOLIA_URL, PRIVATE_KEY, ETHERSCAN_API_KEY } = process.env;
|
2023-03-29 06:28:09 +00:00
|
|
|
|
|
|
|
const getNetworkConfig = (): NetworksUserConfig | undefined => {
|
|
|
|
if (SEPOLIA_URL && PRIVATE_KEY) {
|
|
|
|
return {
|
2023-03-29 06:58:42 +00:00
|
|
|
sepolia: {
|
2023-03-29 06:28:09 +00:00
|
|
|
url: SEPOLIA_URL,
|
|
|
|
accounts: [PRIVATE_KEY],
|
|
|
|
forking: {
|
|
|
|
url: SEPOLIA_URL,
|
|
|
|
},
|
2023-03-29 06:58:42 +00:00
|
|
|
verify: {
|
|
|
|
etherscan: {
|
|
|
|
apiKey: ETHERSCAN_API_KEY,
|
|
|
|
}
|
|
|
|
}
|
2023-03-29 06:28:09 +00:00
|
|
|
},
|
|
|
|
localhost_integration: {
|
|
|
|
url: "http://localhost:8545",
|
|
|
|
},
|
|
|
|
};
|
2022-06-23 13:36:10 +00:00
|
|
|
}
|
2023-03-29 06:28:09 +00:00
|
|
|
return undefined;
|
|
|
|
};
|
2022-06-23 13:36:10 +00:00
|
|
|
|
|
|
|
// You need to export an object to set up your config
|
|
|
|
// Go to https://hardhat.org/config/ to learn more
|
|
|
|
|
|
|
|
const config: HardhatUserConfig = {
|
2023-03-29 06:28:09 +00:00
|
|
|
solidity: {
|
|
|
|
compilers: [
|
|
|
|
{
|
|
|
|
version: "0.8.15",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
networks: getNetworkConfig(),
|
2022-06-23 13:36:10 +00:00
|
|
|
};
|
|
|
|
|
2023-03-29 06:28:09 +00:00
|
|
|
export default config;
|