"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
require("module-alias/register");
require("@nomicfoundation/hardhat-chai-matchers");
require("@nomicfoundation/hardhat-verify");
require("@openzeppelin/hardhat-upgrades");
require("@typechain/hardhat");
require("hardhat-dependency-compiler");
require("hardhat-deploy");
const config_1 = require("hardhat/config");
require("solidity-coverage");
require("solidity-docgen");
require("dotenv").config();
const DEPLOYER_PRIVATE_KEY = process.env.DEPLOYER_PRIVATE_KEY;
(0, config_1.extendConfig)((config) => {
    if (process.env.EXPORT !== "true") {
        config.external = Object.assign(Object.assign({}, config.external), { deployments: {
                bsctestnet: [
                    "node_modules/@venusprotocol/governance-contracts/deployments/bsctestnet",
                    "node_modules/@venusprotocol/venus-protocol/deployments/bsctestnet",
                ],
                bscmainnet: [
                    "node_modules/@venusprotocol/governance-contracts/deployments/bscmainnet",
                    "node_modules/@venusprotocol/venus-protocol/deployments/bscmainnet",
                ],
                sepolia: ["node_modules/@venusprotocol/governance-contracts/deployments/sepolia"],
                ethereum: ["node_modules/@venusprotocol/governance-contracts/deployments/ethereum"],
            } });
    }
});
(0, config_1.task)("accounts", "Prints the list of accounts", (taskArgs, hre) => __awaiter(void 0, void 0, void 0, function* () {
    const accounts = yield hre.ethers.getSigners();
    for (const account of accounts) {
        console.log(account.address);
    }
}));
const config = {
    defaultNetwork: "hardhat",
    solidity: {
        compilers: [
            {
                version: "0.5.16",
                settings: {
                    optimizer: {
                        enabled: true,
                        runs: 200,
                    },
                    outputSelection: {
                        "*": {
                            "*": ["storageLayout"],
                        },
                    },
                },
            },
            {
                version: "0.8.25",
                settings: {
                    optimizer: {
                        enabled: true,
                        runs: 10000,
                    },
                    evmVersion: "paris",
                    outputSelection: {
                        "*": {
                            "*": ["storageLayout"],
                        },
                    },
                },
            },
        ],
    },
    networks: {
        hardhat: isFork(),
        bsctestnet: {
            url: process.env.ARCHIVE_NODE_bsctestnet || "https://data-seed-prebsc-1-s1.binance.org:8545",
            chainId: 97,
            accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
            gasPrice: 10000000000,
            gasMultiplier: 10,
            timeout: 12000000,
        },
        bscmainnet: {
            url: process.env.ARCHIVE_NODE_bscmainnet || "https://bsc-dataseed.binance.org/",
            accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
        },
        sepolia: {
            url: process.env.ARCHIVE_NODE_sepolia || "https://ethereum-sepolia.blockpi.network/v1/rpc/public",
            chainId: 11155111,
            live: true,
            gasPrice: 25000000000,
            accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
        },
        ethereum: {
            url: process.env.ARCHIVE_NODE_ethereum || "https://ethereum.blockpi.network/v1/rpc/public",
            chainId: 1,
            live: true,
            timeout: 1200000,
            accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
        },
        opbnbtestnet: {
            url: process.env.ARCHIVE_NODE_opbnbtestnet || "https://opbnb-testnet-rpc.bnbchain.org",
            chainId: 5611,
            live: true,
            accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
        },
        opbnbmainnet: {
            url: process.env.ARCHIVE_NODE_opbnbmainnet || "https://opbnb-mainnet-rpc.bnbchain.org",
            chainId: 204,
            live: true,
            gasPrice: 10000000000,
            accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
        },
        arbitrumsepolia: {
            url: process.env.ARCHIVE_NODE_arbitrumsepolia || "https://sepolia-rollup.arbitrum.io/rpc",
            chainId: 421614,
            live: true,
            accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
        },
        arbitrumone: {
            url: process.env.ARCHIVE_NODE_arbitrumone || "https://arb1.arbitrum.io/rpc",
            chainId: 42161,
            live: true,
            accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
        },
        opsepolia: {
            url: process.env.ARCHIVE_NODE_opsepolia || "https://sepolia.optimism.io",
            chainId: 11155420,
            live: true,
            accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
        },
        opmainnet: {
            url: process.env.ARCHIVE_NODE_opmainnet || "https://mainnet.optimism.io",
            chainId: 10,
            live: true,
            accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
        },
        basesepolia: {
            url: process.env.ARCHIVE_NODE_basesepolia || "https://sepolia.base.org",
            chainId: 84532,
            live: true,
            accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
        },
        basemainnet: {
            url: process.env.ARCHIVE_NODE_basemainnet || "https://mainnet.base.org",
            chainId: 8453,
            live: true,
            accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
        },
        unichainsepolia: {
            url: process.env.ARCHIVE_NODE_unichainsepolia || "https://sepolia.unichain.org",
            chainId: 1301,
            live: true,
            accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
        },
        unichainmainnet: {
            url: process.env.ARCHIVE_NODE_unichainmainnet || "https://mainnet.unichain.org",
            chainId: 130,
            live: true,
            accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
        },
    },
    etherscan: {
        apiKey: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
        customChains: [
            {
                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: "opsepolia",
                chainId: 11155420,
                urls: {
                    apiURL: "https://api-sepolia-optimistic.etherscan.io/api/",
                    browserURL: "https://sepolia-optimistic.etherscan.io/",
                },
            },
            {
                network: "unichainsepolia",
                chainId: 1301,
                urls: {
                    apiURL: "https://api-sepolia.uniscan.xyz/api/",
                    browserURL: "https://sepolia.uniscan.xyz/",
                },
            },
            {
                network: "unichainmainnet",
                chainId: 130,
                urls: {
                    apiURL: "https://api.uniscan.xyz/api/",
                    browserURL: "https://uniscan.xyz/",
                },
            },
        ],
    },
    paths: {
        sources: "./contracts",
        tests: "./tests",
        cache: "./cache",
        artifacts: "./artifacts",
    },
    mocha: {
        timeout: 200000000,
    },
    typechain: {
        outDir: "typechain",
        target: "ethers-v5",
    },
    namedAccounts: {
        deployer: {
            default: 0,
        },
    },
    dependencyCompiler: {
        paths: [
            "@venusprotocol/venus-protocol/contracts/XVSVault/XVSStore.sol",
            "@venusprotocol/venus-protocol/contracts/XVSVault/XVSVaultErrorReporter.sol",
            "@venusprotocol/venus-protocol/contracts/XVSVault/XVSVaultProxy.sol",
            "@venusprotocol/venus-protocol/contracts/XVSVault/XVSVaultStorage.sol",
            "@venusprotocol/venus-protocol/contracts/Tokens/XVS/XVS.sol",
            "hardhat-deploy/solc_0.8/proxy/OptimizedTransparentUpgradeableProxy.sol",
            "hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol",
        ],
    },
    external: {
        contracts: [
            {
                artifacts: "./node_modules/@venusprotocol/venus-protocol/artifacts",
            },
        ],
        deployments: {},
    },
    docgen: {
        outputDir: "./docs",
        pages: "files",
        templates: "docgen-templates",
    },
};
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",
                blockNumber: 21068448,
            },
            accounts: {
                accountsBalance: "1000000000000000000",
            },
            live: false,
        }
        : {
            allowUnlimitedContractSize: true,
            loggingEnabled: false,
            live: false,
        };
}
exports.default = config;
//# sourceMappingURL=hardhat.config.js.map