Description:
Smart contract deployed on Ethereum with Factory features.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
{{
"language": "Solidity",
"sources": {
"Multichain.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
interface IERC20 {
function balanceOf(address account) external view returns (uint256);
}
contract MulticallBalances {
struct BalanceResult {
address token;
uint256 balance;
}
function getBalances(address wallet, address[] calldata tokens)
external
view
returns (BalanceResult[] memory results)
{
uint256 len = tokens.length;
results = new BalanceResult[](len);
for (uint256 i = 0; i < len; i++) {
uint256 bal;
address token = tokens[i];
// try/catch protects from non-standard ERC20
try IERC20(token).balanceOf(wallet) returns (uint256 b) {
bal = b;
} catch {
bal = 0;
}
results[i] = BalanceResult({token: token, balance: bal});
}
}
}"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"remappings": []
}
}}
Submitted on: 2025-10-31 11:18:42
Comments
Log in to comment.
No comments yet.