4

The output you receive is in hex format. You need to conver hex to an int. Here is the full code you need to use: const contractInstance = web3.eth.contract(contractAbi).at(contractAddress); const total_supply = parseInt(contractInstance.totalSupply.getData()); console.log(total_supply); I added parseInt() to convert your hex number into a human readable ...


2

In web3.js v0.x: The expression contractInstance.totalSupply.getData() would get you the encoded ABI data (byte-code) of a call to function totalSupply. In order to actually call the function and retrieve the return-value asynchronously, you should use: contractInstance.totalSupply.call().then(total_supply => { console.log(total_supply); }); In ...


1

without using any 3rd party extensions like Metamask, or IDEs like Remix This suggests a fundamental misunderstanding. I don't think things will make sense until this is resolved. IDEs like Remix Avoiding IDE is like saying I want to write a story without using an editor. Extension like MetaMask Avoiding user-side wallets is like saying I want to ...


1

Trying to build your own DApp without starting with MetaMask, Remix, or Truffle would be like trying to learn to drive a combine harvester when you've never driven a car. I spent a lot of time puzzling over the "DApp University" tutorial you link to, and my impression was it really overcomplicates things. I made a tutorial for beginners on solidity DApps. ...


1

You want to make it the hard way right ? well don't complicate things those tools called truffle suite are here to help you .. you only have to understand concepts behind them and don't look for other options. Even most experienced developers use them ..


Only top voted, non community-wiki answers of a minimum length are eligible