"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
require("module-alias/register");
require("@nomicfoundation/hardhat-chai-matchers");
require("@nomiclabs/hardhat-etherscan");
require("@openzeppelin/hardhat-upgrades");
require("@typechain/hardhat");
const dotenv = __importStar(require("dotenv"));
require("hardhat-deploy");
require("hardhat-gas-reporter");
const config_1 = require("hardhat/config");
require("solidity-coverage");
require("solidity-docgen");
dotenv.config();
(0, config_1.extendConfig)((config) => {
    if (process.env.EXPORT !== "true") {
        config.external = Object.assign(Object.assign({}, config.external), { deployments: {} });
    }
});
function isFork() {
    return process.env.FORK === "true"
        ? {
            allowUnlimitedContractSize: false,
            loggingEnabled: false,
            forking: {
                url: process.env[`ARCHIVE_NODE_${process.env.FORKED_NETWORK}`] ||
                    "https://data-seed-prebsc-1-s1.binance.org:8545",
            },
            accounts: {
                accountsBalance: "1000000000000000000",
            },
            live: false,
        }
        : {
            allowUnlimitedContractSize: true,
            loggingEnabled: false,
            live: false,
        };
}
const config = {
    solidity: {
        compilers: [
            {
                version: "0.8.13",
                settings: {
                    optimizer: {
                        enabled: true,
                        details: {
                            yul: !process.env.CI,
                        },
                    },
                    outputSelection: {
                        "*": {
                            "*": ["storageLayout"],
                        },
                    },
                },
            },
            {
                version: "0.6.6",
                settings: {
                    optimizer: {
                        enabled: true,
                        details: {
                            yul: !process.env.CI,
                        },
                    },
                    outputSelection: {
                        "*": {
                            "*": ["storageLayout"],
                        },
                    },
                },
            },
        ],
    },
    networks: {
        hardhat: isFork(),
        development: {
            url: "http://127.0.0.1:8545/",
            chainId: 31337,
            live: false,
        },
        bsctestnet: {
            url: process.env.ARCHIVE_NODE_bsctestnet || "https://data-seed-prebsc-1-s1.binance.org:8545",
            chainId: 97,
            live: true,
            gasPrice: 20000000000,
            accounts: process.env.DEPLOYER_PRIVATE_KEY ? [`0x${process.env.DEPLOYER_PRIVATE_KEY}`] : [],
        },
        bscmainnet: {
            url: process.env.ARCHIVE_NODE_bscmainnet || "https://bsc-dataseed.binance.org/",
            chainId: 56,
            live: true,
            timeout: 1200000,
        },
        sepolia: {
            url: process.env.ARCHIVE_NODE_sepolia || "https://ethereum-sepolia.blockpi.network/v1/rpc/public",
            chainId: 11155111,
            live: true,
            accounts: process.env.DEPLOYER_PRIVATE_KEY ? [`0x${process.env.DEPLOYER_PRIVATE_KEY}`] : [],
        },
        ethereum: {
            url: process.env.ARCHIVE_NODE_ethereum || "https://ethereum.blockpi.network/v1/rpc/public",
            chainId: 1,
            accounts: process.env.DEPLOYER_PRIVATE_KEY ? [`0x${process.env.DEPLOYER_PRIVATE_KEY}`] : [],
        },
        opbnbtestnet: {
            url: process.env.ARCHIVE_NODE_opbnbtestnet || "https://opbnb-testnet-rpc.bnbchain.org",
            chainId: 5611,
            live: true,
            accounts: process.env.DEPLOYER_PRIVATE_KEY ? [`0x${process.env.DEPLOYER_PRIVATE_KEY}`] : [],
        },
        opbnbmainnet: {
            url: process.env.ARCHIVE_NODE_opbnbmainnet || "https://opbnb-mainnet-rpc.bnbchain.org",
            chainId: 204,
            live: true,
            accounts: process.env.DEPLOYER_PRIVATE_KEY ? [`0x${process.env.DEPLOYER_PRIVATE_KEY}`] : [],
        },
    },
    gasReporter: {
        enabled: process.env.REPORT_GAS !== undefined,
        currency: "USD",
    },
    etherscan: {
        apiKey: {
            bscmainnet: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
            bsctestnet: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
            sepolia: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
            ethereum: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
            opbnbtestnet: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
            opbnbmainnet: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
        },
        customChains: [
            {
                network: "bscmainnet",
                chainId: 56,
                urls: {
                    apiURL: "https://api.bscscan.com/api",
                    browserURL: "https://bscscan.com",
                },
            },
            {
                network: "bsctestnet",
                chainId: 97,
                urls: {
                    apiURL: "https://api-testnet.bscscan.com/api",
                    browserURL: "https://testnet.bscscan.com",
                },
            },
            {
                network: "sepolia",
                chainId: 11155111,
                urls: {
                    apiURL: "https://api-sepolia.etherscan.io/api",
                    browserURL: "https://sepolia.etherscan.io",
                },
            },
            {
                network: "ethereum",
                chainId: 1,
                urls: {
                    apiURL: "https://api.etherscan.io/api",
                    browserURL: "https://etherscan.io",
                },
            },
            {
                network: "opbnbtestnet",
                chainId: 5611,
                urls: {
                    apiURL: `https://open-platform.nodereal.io/${process.env.ETHERSCAN_API_KEY}/op-bnb-testnet/contract/`,
                    browserURL: "https://testnet.opbnbscan.com/",
                },
            },
            {
                network: "opbnbmainnet",
                chainId: 204,
                urls: {
                    apiURL: `https://open-platform.nodereal.io/${process.env.ETHERSCAN_API_KEY}/op-bnb-mainnet/contract/`,
                    browserURL: "https://opbnbscan.com/",
                },
            },
        ],
    },
    paths: {
        tests: "./test",
    },
    namedAccounts: {
        deployer: 0,
    },
    docgen: {
        outputDir: "./docs",
        pages: "files",
        templates: "./docgen-templates",
    },
};
exports.default = config;
//# sourceMappingURL=hardhat.config.js.map