github.com/status-im/status-go@v1.1.0/contracts/ethscan/ethscan.sol (about) 1 /** 2 *Submitted for verification at Etherscan.io on 2021-04-07 3 */ 4 5 // SPDX-License-Identifier: MIT 6 7 pragma solidity ^0.8.3; 8 9 /** 10 * @title An Ether or token balance scanner 11 * @author Maarten Zuidhoorn 12 * @author Luit Hollander 13 */ 14 abstract contract BalanceScanner { 15 struct Result { 16 bool success; 17 bytes data; 18 } 19 20 /** 21 * @notice Get the Ether balance for all addresses specified 22 * @param addresses The addresses to get the Ether balance for 23 * @return results The Ether balance for all addresses in the same order as specified 24 */ 25 function etherBalances(address[] calldata addresses) external virtual view returns (Result[] memory results); 26 27 /** 28 * @notice Get the ERC-20 token balance of `token` for all addresses specified 29 * @dev This does not check if the `token` address specified is actually an ERC-20 token 30 * @param addresses The addresses to get the token balance for 31 * @param token The address of the ERC-20 token contract 32 * @return results The token balance for all addresses in the same order as specified 33 */ 34 function tokenBalances(address[] calldata addresses, address token) external virtual view returns (Result[] memory results); 35 36 /** 37 * @notice Get the ERC-20 token balance from multiple contracts for a single owner 38 * @param owner The address of the token owner 39 * @param contracts The addresses of the ERC-20 token contracts 40 * @return results The token balances in the same order as the addresses specified 41 */ 42 function tokensBalance(address owner, address[] calldata contracts) external virtual view returns (Result[] memory results); 43 44 /** 45 * @notice Call multiple contracts with the provided arbitrary data 46 * @param contracts The contracts to call 47 * @param data The data to call the contracts with 48 * @return results The raw result of the contract calls 49 */ 50 function call(address[] calldata contracts, bytes[] calldata data) external virtual view returns (Result[] memory results); 51 52 /** 53 * @notice Call multiple contracts with the provided arbitrary data 54 * @param contracts The contracts to call 55 * @param data The data to call the contracts with 56 * @param gas The amount of gas to call the contracts with 57 * @return results The raw result of the contract calls 58 */ 59 function call( 60 address[] calldata contracts, 61 bytes[] calldata data, 62 uint256 gas 63 ) public view virtual returns (Result[] memory results); 64 }