def METHOD_NAME(self) -> _Web3:
    # a web3 instance connected to the mainnet
    if self.isConnected() and CONFIG.active_network["id"] == "mainnet":
        return self
    try:
        mainnet = CONFIG.networks["mainnet"]
    except KeyError:
        raise MainnetUndefined("No 'mainnet' network defined") from None
    if not self._mainnet_w3:
        uri = _expand_environment_vars(mainnet["host"])
        self._mainnet_w3 = _Web3(HTTPProvider(uri))
        self._mainnet_w3.enable_unstable_package_management_api()
    return self._mainnet_w3