second-state/smart-contract-search-engine

Provide check for wallet's network setting

tpmccallum opened this issue · 1 comments

Provide an alert if the user is on a search engine configured for the mainnet but their Chrome browser extension is connected to the testnet etc.

This has now been added. Simply this ...

function checkNetwork() {
    if (this.searchEngineNetwork != this.currentNetwork) {
        alert("Please select the correct network in your Venus Chrome extension!");
    }
}

When the following are set

web3.version.getNetwork((err, theNetwork) => {
    this.currentNetwork = theNetwork
});
var searchEngineNetwork = "19"; // CyberMiles TestNet
//var searchEngineNetwork = "18"; // CyberMiles MainNet