I have deployed a contract in private blockchain using mist wallet. When I try to call the function in the smart contract using web3 api it through the below error

return !!name.match(/address(\[([0-9]*)\])?/);
TypeError: Cannot read property 'match' of undefined
 at SolidityTypeAddress.isType 

My code:

var Web3 = require('web3');
var web3 = new Web3(new 

var abi = [ Contract ABI];

var myContract = web3.eth.contract(abi);
var myContractInstance = myContract.at("0x1AAFef75Fd4349F1747F051819B0E6DDb9903826");
var result = myContractInstance.balanceOf("0x7F0991e4c4613fbD4B84bb3B3f195f104936ABe7");

1 Answer 1


It seems that name is undefined. Try logging out variable name right before you call it to see what the problem might be.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.