1

I want to konw how to get the balance of ERC20token with different contract address in solidity....(And i just run in the superblock,which is in my localhost)

Such as ERC20token smartcontract, just is the token balance of accounts, i want to make a smart contract to use token contract address and account address to find out the token balance of different accounts or different token

  • can u give an example. Cause i dont understand the question. Do you want to get the token balance of an adress like dai token from an adress? or you want to get the token supply balance of a contract address – haxerl Dec 19 '19 at 3:14
  • Such as ERC20token smartcontract, just is the token balance of accounts, i want to make a smart contract to use token contract address and account address to find out the token balance of different accounts or different token – 123 Dec 27 '19 at 2:47
  • I don't understand either. Can't you just use the classic way ? It seems to be exactly what you are looking for. – Florian Castelain Dec 27 '19 at 7:43
  • thanks your comment´╝îi have get my answer.import "./IERC20.sol"; contract Checker { function checkBal(address token, address holder) public view returns(uint) { IERC20 token = IERC20(token); return token.balanceOf(holder); } } from Rob Hitchens - B9lab – 123 Dec 30 '19 at 2:40

Browse other questions tagged or ask your own question.