Bitcoin Forum
June 15, 2024, 05:08:01 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: I Call SmartContract Token ERC20, Why Show Hashing Output ? (Web3 + Metamask)  (Read 140 times)
zororaka (OP)
Copper Member
Member
**
Offline Offline

Activity: 84
Merit: 57

Blockchain Enthusiast & AI Enthusiast


View Profile WWW
September 02, 2019, 05:44:48 PM
 #1

I do not know why with this, even though in the previous version (web3 + Metamask) can issue real data. But now used as hashing (output). I took the example in the code and output below (to get the TotalSupply on the ERC20 Token) :

Quote
const contractInstance = web3.eth.contract(contractAbi).at(contractAddress);
const total_supply = contractInstance.totalSupply.getData();
console.log(total_supply);

Output : 0x18160ddd (this is my problem)

How to showing real data ? In a sense it doesn't come out hashing. Thanks

*Image Removed*
nc50lc
Legendary
*
Offline Offline

Activity: 2450
Merit: 5714


Self-proclaimed Genius


View Profile
September 03, 2019, 03:57:37 AM
 #2

I think you mistook "Ethereum" for "Electrum" :)

This isn't the right board for technical discussion about ETH.
Use the move topic button below (lower-left) to move this to Altcoin Discussion.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
zororaka (OP)
Copper Member
Member
**
Offline Offline

Activity: 84
Merit: 57

Blockchain Enthusiast & AI Enthusiast


View Profile WWW
September 03, 2019, 04:06:39 AM
 #3

I think you mistook "Ethereum" for "Electrum" Smiley

This isn't the right board for technical discussion about ETH.
Use the move topic button below (lower-left) to move this to Altcoin Discussion.
ok thanks, i'm wrong place for discussion.

*Image Removed*
nc50lc
Legendary
*
Offline Offline

Activity: 2450
Merit: 5714


Self-proclaimed Genius


View Profile
September 03, 2019, 04:12:32 AM
 #4

By the way, "0x18160ddd" is the signature of the function totalsupply().
but I can't tell why the value wasn't there.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
zororaka (OP)
Copper Member
Member
**
Offline Offline

Activity: 84
Merit: 57

Blockchain Enthusiast & AI Enthusiast


View Profile WWW
September 03, 2019, 04:33:43 AM
Merited by nc50lc (1)
 #5

By the way, "0x18160ddd" is the signature of the function totalsupply().
but I can't tell why the value wasn't there.
I think that is the Hex function on web3, from some other people's thinking it's because I'm using a new version. But somehow, I'm a little confused with this new one. Even though I used the previous version, it can come out real data. I tried changing HextoASCII (web3 function) too, but it didn't come out.

In the Metamask (Developer) document that I read, they recommend using a new one to make it safer (they said). So I want to try this new Smiley

*Image Removed*
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!