anyone know an easy way to get the name, symbol and decimals of any erc20 token (by address) with web3js?

Oct 16, 2020, 6:17 PM
I'm not sure how easy you think this is, but you can just check it with web3.eth.call
Oct 16, 2020, 6:27 PM
I don't see name or decimals among the functions in standard erc20 interface: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v2.5.0/contracts/token/ERC20/IERC20.sol
Oct 16, 2020, 6:30 PM
they're not part of the standard. but many contracts implement those. of course if the contract doesn't have such information then you can't get it
Oct 16, 2020, 6:32 PM

© 2024 Draquery.com All rights reserved.