I am trying to read a mapping inside my smart contract that looks like this:
mapping(address => User) public users;
My web3js code looks like this. I am trying to read mapping users inside the smart contract:
var contractAddress='0x3aacc70dced50f8c6c1951f27d505d2ad165b373';
var contractInstance = new web3.eth.Contract(abi,contractAddress);
contractInstance.users.call(web3.eth.accounts[0], function(err, result){
if(!err){
alert(result)
}
});
However I get the error like below:
TypeError: Cannot read property 'call' of undefined
Can someone help me resolve this