"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-dependency-compiler");
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 = {
            ...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,
            saveDeployments: false,
        }
        : {
            allowUnlimitedContractSize: true,
            loggingEnabled: false,
            live: false,
            saveDeployments: false,
        };
}
const config = {
    solidity: {
        compilers: [
            {
                version: "0.8.25",
                settings: {
                    optimizer: {
                        enabled: true,
                        details: {
                            yul: !process.env.CI,
                        },
                    },
                    evmVersion: "paris",
                    outputSelection: {
                        "*": {
                            "*": ["storageLayout"],
                        },
                    },
                },
            },
            {
                version: "0.6.6",
                settings: {
                    optimizer: {
                        enabled: true,
                        details: {
                            yul: !process.env.CI,
                        },
                    },
                    outputSelection: {
                        "*": {
                            "*": ["storageLayout"],
                        },
                    },
                },
            },
            {
                version: "0.5.16",
                settings: {
                    optimizer: {
                        enabled: true,
                        runs: 200,
                    },
                    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,
            live: true,
            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}`] : [],
        },
        arbitrumsepolia: {
            url: process.env.ARCHIVE_NODE_arbitrumsepolia || "https://sepolia-rollup.arbitrum.io/rpc",
            chainId: 421614,
            live: true,
            accounts: process.env.DEPLOYER_PRIVATE_KEY ? [`0x${process.env.DEPLOYER_PRIVATE_KEY}`] : [],
        },
        arbitrumone: {
            url: process.env.ARCHIVE_NODE_arbitrumone || "https://arb1.arbitrum.io/rpc",
            chainId: 42161,
            live: true,
            accounts: process.env.DEPLOYER_PRIVATE_KEY ? [`0x${process.env.DEPLOYER_PRIVATE_KEY}`] : [],
        },
        opsepolia: {
            url: process.env.ARCHIVE_NODE_opsepolia || "https://sepolia.optimism.io",
            chainId: 11155420,
            live: true,
            accounts: process.env.DEPLOYER_PRIVATE_KEY ? [`0x${process.env.DEPLOYER_PRIVATE_KEY}`] : [],
        },
        opmainnet: {
            url: process.env.ARCHIVE_NODE_opmainnet || "https://mainnet.optimism.io",
            chainId: 10,
            live: true,
            accounts: process.env.DEPLOYER_PRIVATE_KEY ? [`0x${process.env.DEPLOYER_PRIVATE_KEY}`] : [],
        },
        basesepolia: {
            url: process.env.ARCHIVE_NODE_basesepolia || "https://sepolia.base.org",
            chainId: 84532,
            live: true,
            accounts: process.env.DEPLOYER_PRIVATE_KEY ? [`0x${process.env.DEPLOYER_PRIVATE_KEY}`] : [],
        },
        basemainnet: {
            url: process.env.ARCHIVE_NODE_basemainnet || "https://mainnet.base.org",
            chainId: 8453,
            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",
            arbitrumsepolia: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
            arbitrumone: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
            opsepolia: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
            opmainnet: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
            basesepolia: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
            basemainnet: 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/",
                },
            },
            {
                network: "arbitrumsepolia",
                chainId: 421614,
                urls: {
                    apiURL: `https://api-sepolia.arbiscan.io/api`,
                    browserURL: "https://sepolia.arbiscan.io/",
                },
            },
            {
                network: "arbitrumone",
                chainId: 42161,
                urls: {
                    apiURL: `https://api.arbiscan.io/api/`,
                    browserURL: "https://arbiscan.io/",
                },
            },
            {
                network: "opsepolia",
                chainId: 11155420,
                urls: {
                    apiURL: "https://api-sepolia-optimistic.etherscan.io/api/",
                    browserURL: "https://sepolia-optimistic.etherscan.io/",
                },
            },
            {
                network: "opmainnet",
                chainId: 10,
                urls: {
                    apiURL: "https://api-optimistic.etherscan.io/api",
                    browserURL: "https://optimistic.etherscan.io/",
                },
            },
            {
                network: "basesepolia",
                chainId: 84532,
                urls: {
                    apiURL: "https://api-sepolia.basescan.org/api",
                    browserURL: "https://sepolia.basescan.org/",
                },
            },
            {
                network: "basemainnet",
                chainId: 8453,
                urls: {
                    apiURL: "https://api.basescan.org/api",
                    browserURL: "https://basescan.org/",
                },
            },
        ],
    },
    paths: {
        tests: "./test",
    },
    dependencyCompiler: {
        paths: [
            "@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol",
            "hardhat-deploy/solc_0.8/proxy/OptimizedTransparentUpgradeableProxy.sol",
            "hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol",
            "hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol:ProxyAdmin",
        ],
    },
    namedAccounts: {
        deployer: 0,
    },
    docgen: {
        outputDir: "./docs",
        pages: "files",
        templates: "./docgen-templates",
    },
    external: {
        contracts: [
            {
                artifacts: "node_modules/@venusprotocol/venus-protocol/artifacts",
            },
            {
                artifacts: "node_modules/@venusprotocol/governance-contracts/artifacts",
            },
        ],
    },
};
exports.default = config;
//# sourceMappingURL=hardhat.config.js.map