I'm new to Ethereum and javascript so hope someone can help me with this as none of the other answers on BigNumber help me understand why this won't work for me. I've tried converting the number to a bignumber using BigNumber.js but then it tells me its no longer a number?!

The CreateNewProject function works fine (except it calls metamask twice but that's a seperate issue (feel free to answer that one as well). The main issue at the moment is with bigNumber and the getProject Function

BigNumber Error: new BigNumber() not a base 16 number:
at T (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:289033)
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:294599
at new r (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:286552)
at i.formatOutputString [as _outputFormatter] (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:171979)
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:176324
at i.decode (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:176346)
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:169300
at Array.map (<anonymous>)
at d.decodeParams (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:169273)
at u.unpackOutput (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:199674)

So basically the first error tells me the number i am passing is not base 16 and when i change it to base 16 it tells me its no longer a number!! (no shit its now hex as requested)!!! Someone please help me understand this before i lose my mind?

As i've said if i create a new project on my browser this is created fine and i can run getProject from Remix to display the project i created through the web3 function but i cannot return the project. Please Help!!!

1 Answer
1

I'm not sure and I can not test but if I were you I would try to do a result.toNumber()

Edit: And for the two Metamask I would advise to remove the web3.eth.sendTransaction
When you call the contract function, the use of web3 is encapsulated. I would say you are trying to send a transaction of a contract function call. Just call the contract function.

Edit2: You call the contract function with a callback so it's asynchronous. The result is in the callback, not in the return.
You can either go into callback hell or use async/await syntax like :
var b = await ProjectContractInstance.getProject(1);