I run into the uncaught error: new BigNumber() not a base 16 number. It's been discussed here and might occur due to a bug in web3.js
Maybe it's just my code that causes this error. Here it is:
pragma solidity ^0.4.8; contract Test { struct Addresses{ string id; string[] fname; string[] lname; string[] streetaddress; string[] zip; } mapping(string => Addresses) UserProfile; //Set Variables function setData(string uid,string firstname,string lastname,string street,string zipVal) { UserProfile[uid].id = uid; UserProfile[uid].fname.push(firstname); UserProfile[uid].lname.push(lastname); UserProfile[uid].streetaddress.push(street); UserProfile[uid].zip.push(zipVal); } //Return Variables function getFirstname(string uid, uint8 pos) constant returns (string) { return UserProfile[uid].fname[pos]; } function getLastname(string uid, uint8 pos) constant returns (string) { return UserProfile[uid].lname[pos]; } function getGender(string uid, uint8 pos) constant returns (string) { return UserProfile[uid].streetaddress[pos]; } function getDOB(string uid, uint8 pos) constant returns (string) { return UserProfile[uid].zip[pos]; } }
and here is my Javascript:
function getUserProfile() { var struid = document.getElementById('uid').value; var iPos = parseInt("0"); returnFirstname = UserProfile.getFirstname(struid, iPos); returnLastname = UserProfile.getLastname(struid, iPos); //OUTPUT TO CONSOLE console.log("-----------------"); console.log("GET DATA FUNCTION"); console.log("UID: "+struid); console.log("Pos: "+iPos); //OUTPUT TO HTML document.getElementById('firstname').innerHTML = returnFirstname; document.getElementById('lastname').innerHTML = returnLastname; }
Maybe it's the combination of strings and integers that is throwing this error.
Any pointer would help! Thanks
console.log(iPos);
?