I keep getting Error: Invalid address when trying to run the application.
My current setup of web3 using infura node is
if (typeof web3 !== 'undefined') {
web3 = new Web3(web3.currentProvider);
} else {
const provider = new Web3.providers.HttpProvider('https://rinkeby.infura.io/doeL97MLPLVXBgAnRZRJ');
web3 = new Web3(provider);
}
web3.eth.defaultAccount = web3.eth.accounts[0];
web3.personal.unlockAccount(web3.eth.defaultAccount)
The instance of the contract is
const contract = web3.eth.contract(abi);
const instance = contract.at(address);
instance.web3.eth.defaultAccount=instance.web3.eth.coinbase;
when trying to do a call to the contract, the value returned is undefined
const count = await EmployeeStore.employeesCount().then(function(value) {
console.log(parseInt(value));
});
as shown in the picture below, web3 is injected correctly and able to retrieve the accounts.
