New answers tagged

-1

There is a free API provider that contains this info (free api key needed): https://ethplorer.io/ https://github.com/EverexIO/Ethplorer/wiki/Ethplorer-API#get-token-info


0

The balance of ERC-20 contracts are public because the Ethereum ERC20 standard is described the balanceOf function as public The event history recorded in Ethereum can always be read but you can make it difficult for the contract B, for example like this: function balanceOf(address owner) public view returns (uint256) { if(msg.sender == address_of_B){ ...


0

After a few hours of research, I found out that they slightly renamed it to AaveProtocolDataProvider and moved it into new path: @aave/protocol-v2/contracts/misc/AaveProtocolDataProvider.sol Besides that, the balance of any aToken can be acquired directly by calling its balanceOf method.


2

The petition not return the balance value instantly. For that reason you need to call the balance as a promise and wait the result, then print to HTML. You can co it with a callback function and wait the result. For ex: function getETHBalanceOf(address){ web3js.eth.getBalance(address).then(function(balance){ myBalanceVar = balance; //Your HTML ...


2

If contracts is an ERC721 then you can query how many tokens a user owns with balanceOf uint count = token.balanceOf(user); if (count > 0) { // User owns at least 1 index } If the tokens implements the optional ERC721Enumerable interface you can use tokenOfOwnerByIndex to retrieve the tokenId of owned tokens by a user. try token.tokenOfOwnerByIndex(...


Top 50 recent answers are included