ETH Price: $3,153.10 (+0.31%)

Contract

0xBA1a5cA51097C890d0E595C9c5C290985034ddCB

Overview

ETH Balance

0 ETH

ETH Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

1 Internal Transaction found.

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
87796612025-08-18 13:07:5288 days ago1755522472  Contract Creation0 ETH

Cross-Chain Transactions
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xBA1a5cA5...85034ddCB in Polygon Mainnet
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
BalanceScanner

Compiler Version
v0.8.29+commit.ab55807c

Optimization Enabled:
Yes with 200 runs

Other Settings:
shanghai EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

// SPDX-License-Identifier: MIT

pragma solidity 0.8.29;

/**
 * @title An Ether or token balance scanner
 * @author Maarten Zuidhoorn
 * @author Luit Hollander
 */
contract BalanceScanner {
    struct Result {
        bool success;
        bytes data;
    }

    /**
     * @notice Get the Ether balance for all addresses specified
     * @param addresses The addresses to get the Ether balance for
     * @return results The Ether balance for all addresses in the same order as specified
     */
    function etherBalances(address[] calldata addresses) external view returns (Result[] memory results) {
        results = new Result[](addresses.length);

        for (uint256 i = 0; i < addresses.length; i++) {
            results[i] = Result(true, abi.encode(addresses[i].balance));
        }
    }

    /**
     * @notice Get the ERC-20 token balance of `token` for all addresses specified
     * @dev This does not check if the `token` address specified is actually an ERC-20 token
     * @param addresses The addresses to get the token balance for
     * @param token The address of the ERC-20 token contract
     * @return results The token balance for all addresses in the same order as specified
     */
    function tokenBalances(address[] calldata addresses, address token)
        external
        view
        returns (Result[] memory results)
    {
        results = new Result[](addresses.length);

        for (uint256 i = 0; i < addresses.length; i++) {
            bytes memory data = abi.encodeWithSignature("balanceOf(address)", addresses[i]);
            results[i] = staticCall(token, data, 20000);
        }
    }

    /**
     * @notice Get the ERC-20 token balance from multiple contracts for a single owner
     * @param owner The address of the token owner
     * @param contracts The addresses of the ERC-20 token contracts
     * @return results The token balances in the same order as the addresses specified
     */
    function tokensBalance(address owner, address[] calldata contracts)
        external
        view
        returns (Result[] memory results)
    {
        results = new Result[](contracts.length);

        bytes memory data = abi.encodeWithSignature("balanceOf(address)", owner);
        for (uint256 i = 0; i < contracts.length; i++) {
            results[i] = staticCall(contracts[i], data, 20000);
        }
    }

    /**
     * @notice Call multiple contracts with the provided arbitrary data
     * @param contracts The contracts to call
     * @param data The data to call the contracts with
     * @return results The raw result of the contract calls
     */
    function call(address[] calldata contracts, bytes[] calldata data)
        external
        view
        returns (Result[] memory results)
    {
        return call(contracts, data, gasleft());
    }

    /**
     * @notice Call multiple contracts with the provided arbitrary data
     * @param contracts The contracts to call
     * @param data The data to call the contracts with
     * @param gas The amount of gas to call the contracts with
     * @return results The raw result of the contract calls
     */
    function call(address[] calldata contracts, bytes[] calldata data, uint256 gas)
        public
        view
        returns (Result[] memory results)
    {
        require(contracts.length == data.length, "Length must be equal");
        results = new Result[](contracts.length);

        for (uint256 i = 0; i < contracts.length; i++) {
            results[i] = staticCall(contracts[i], data[i], gas);
        }
    }

    /**
     * @notice Static call a contract with the provided data
     * @param target The address of the contract to call
     * @param data The data to call the contract with
     * @param gas The amount of gas to forward to the call
     * @return result The result of the contract call
     */
    function staticCall(address target, bytes memory data, uint256 gas) private view returns (Result memory) {
        uint256 size = codeSize(target);

        if (size > 0) {
            (bool success, bytes memory result) = target.staticcall{gas: gas}(data);
            if (success) {
                return Result(success, result);
            }
        }

        return Result(false, "");
    }

    /**
     * @notice Get code size of address
     * @param _address The address to get code size from
     * @return size Unsigned 256-bits integer
     */
    function codeSize(address _address) private view returns (uint256 size) {
        // solhint-disable-next-line no-inline-assembly
        assembly {
            size := extcodesize(_address)
        }
    }
}

Settings
{
  "remappings": [
    "forge-std/=lib/forge-std/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "shanghai",
  "viaIR": false
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address[]","name":"contracts","type":"address[]"},{"internalType":"bytes[]","name":"data","type":"bytes[]"},{"internalType":"uint256","name":"gas","type":"uint256"}],"name":"call","outputs":[{"components":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct BalanceScanner.Result[]","name":"results","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"contracts","type":"address[]"},{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"call","outputs":[{"components":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct BalanceScanner.Result[]","name":"results","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"addresses","type":"address[]"}],"name":"etherBalances","outputs":[{"components":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct BalanceScanner.Result[]","name":"results","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"address","name":"token","type":"address"}],"name":"tokenBalances","outputs":[{"components":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct BalanceScanner.Result[]","name":"results","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address[]","name":"contracts","type":"address[]"}],"name":"tokensBalance","outputs":[{"components":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct BalanceScanner.Result[]","name":"results","type":"tuple[]"}],"stateMutability":"view","type":"function"}]

0x6080604052348015600e575f5ffd5b506109ea8061001c5f395ff3fe608060405234801561000f575f5ffd5b5060043610610055575f3560e01c80633673837414610059578063458b3a7c14610082578063aad3309114610095578063dbdbb51b146100a8578063e5da1b68146100bb575b5f5ffd5b61006c61006736600461068e565b6100ce565b6040516100799190610721565b60405180910390f35b61006c6100903660046107b6565b61023c565b61006c6100a336600461083b565b610254565b61006c6100b636600461088a565b610365565b61006c6100c93660046108c8565b610466565b606084831461011a5760405162461bcd60e51b815260206004820152601460248201527313195b99dd1a081b5d5cdd08189948195c5d585b60621b604482015260640160405180910390fd5b846001600160401b0381111561013257610132610916565b60405190808252806020026020018201604052801561017757816020015b604080518082019091525f8152606060208201528152602001906001900390816101505790505b5090505f5b858110156102325761020d8787838181106101995761019961092a565b90506020020160208101906101ae919061093e565b8686848181106101c0576101c061092a565b90506020028101906101d29190610957565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250889250610577915050565b82828151811061021f5761021f61092a565b602090810291909101015260010161017c565b5095945050505050565b606061024b858585855a6100ce565b95945050505050565b6060826001600160401b0381111561026e5761026e610916565b6040519080825280602002602001820160405280156102b357816020015b604080518082019091525f81526060602082015281526020019060019003908161028c5790505b5090505f5b8381101561035d575f8585838181106102d3576102d361092a565b90506020020160208101906102e8919061093e565b6040516001600160a01b03909116602482015260440160408051601f198184030181529190526020810180516001600160e01b03166370a0823160e01b17905290506103378482614e20610577565b8383815181106103495761034961092a565b6020908102919091010152506001016102b8565b509392505050565b6060816001600160401b0381111561037f5761037f610916565b6040519080825280602002602001820160405280156103c457816020015b604080518082019091525f81526060602082015281526020019060019003908161039d5790505b5090505f5b8281101561045f5760405180604001604052806001151581526020018585848181106103f7576103f761092a565b905060200201602081019061040c919061093e565b6001600160a01b03163160405160200161042891815260200190565b60405160208183030381529060405281525082828151811061044c5761044c61092a565b60209081029190910101526001016103c9565b5092915050565b6060816001600160401b0381111561048057610480610916565b6040519080825280602002602001820160405280156104c557816020015b604080518082019091525f81526060602082015281526020019060019003908161049e5790505b506040516001600160a01b03861660248201529091505f9060440160408051601f198184030181529190526020810180516001600160e01b03166370a0823160e01b17905290505f5b8381101561056e5761054985858381811061052b5761052b61092a565b9050602002016020810190610540919061093e565b83614e20610577565b83828151811061055b5761055b61092a565b602090810291909101015260010161050e565b50509392505050565b604080518082019091525f815260606020820152833b8015610617575f5f866001600160a01b031685876040516105ae9190610999565b5f604051808303818686fa925050503d805f81146105e7576040519150601f19603f3d011682016040523d82523d5f602084013e6105ec565b606091505b5091509150811561061457604080518082019091529115158252602082015291506106409050565b50505b60405180604001604052805f1515815260200160405180602001604052805f8152508152509150505b9392505050565b5f5f83601f840112610657575f5ffd5b5081356001600160401b0381111561066d575f5ffd5b6020830191508360208260051b8501011115610687575f5ffd5b9250929050565b5f5f5f5f5f606086880312156106a2575f5ffd5b85356001600160401b038111156106b7575f5ffd5b6106c388828901610647565b90965094505060208601356001600160401b038111156106e1575f5ffd5b6106ed88828901610647565b96999598509660400135949350505050565b5f5b83811015610719578181015183820152602001610701565b50505f910152565b5f602082016020835280845180835260408501915060408160051b8601019250602086015f5b828110156107aa57603f198786030184528151805115158652602081015190506040602087015280518060408801526107878160608901602085016106ff565b601f01601f19169590950160600194506020938401939190910190600101610747565b50929695505050505050565b5f5f5f5f604085870312156107c9575f5ffd5b84356001600160401b038111156107de575f5ffd5b6107ea87828801610647565b90955093505060208501356001600160401b03811115610808575f5ffd5b61081487828801610647565b95989497509550505050565b80356001600160a01b0381168114610836575f5ffd5b919050565b5f5f5f6040848603121561084d575f5ffd5b83356001600160401b03811115610862575f5ffd5b61086e86828701610647565b9094509250610881905060208501610820565b90509250925092565b5f5f6020838503121561089b575f5ffd5b82356001600160401b038111156108b0575f5ffd5b6108bc85828601610647565b90969095509350505050565b5f5f5f604084860312156108da575f5ffd5b6108e384610820565b925060208401356001600160401b038111156108fd575f5ffd5b61090986828701610647565b9497909650939450505050565b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b5f6020828403121561094e575f5ffd5b61064082610820565b5f5f8335601e1984360301811261096c575f5ffd5b8301803591506001600160401b03821115610985575f5ffd5b602001915036819003821315610687575f5ffd5b5f82516109aa8184602087016106ff565b919091019291505056fea26469706673582212202df2b44b589b0df9b64d6ad3e7bd18c445e9534fabde2a18580dd1060e3182a964736f6c634300081d0033

Deployed Bytecode

0x608060405234801561000f575f5ffd5b5060043610610055575f3560e01c80633673837414610059578063458b3a7c14610082578063aad3309114610095578063dbdbb51b146100a8578063e5da1b68146100bb575b5f5ffd5b61006c61006736600461068e565b6100ce565b6040516100799190610721565b60405180910390f35b61006c6100903660046107b6565b61023c565b61006c6100a336600461083b565b610254565b61006c6100b636600461088a565b610365565b61006c6100c93660046108c8565b610466565b606084831461011a5760405162461bcd60e51b815260206004820152601460248201527313195b99dd1a081b5d5cdd08189948195c5d585b60621b604482015260640160405180910390fd5b846001600160401b0381111561013257610132610916565b60405190808252806020026020018201604052801561017757816020015b604080518082019091525f8152606060208201528152602001906001900390816101505790505b5090505f5b858110156102325761020d8787838181106101995761019961092a565b90506020020160208101906101ae919061093e565b8686848181106101c0576101c061092a565b90506020028101906101d29190610957565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250889250610577915050565b82828151811061021f5761021f61092a565b602090810291909101015260010161017c565b5095945050505050565b606061024b858585855a6100ce565b95945050505050565b6060826001600160401b0381111561026e5761026e610916565b6040519080825280602002602001820160405280156102b357816020015b604080518082019091525f81526060602082015281526020019060019003908161028c5790505b5090505f5b8381101561035d575f8585838181106102d3576102d361092a565b90506020020160208101906102e8919061093e565b6040516001600160a01b03909116602482015260440160408051601f198184030181529190526020810180516001600160e01b03166370a0823160e01b17905290506103378482614e20610577565b8383815181106103495761034961092a565b6020908102919091010152506001016102b8565b509392505050565b6060816001600160401b0381111561037f5761037f610916565b6040519080825280602002602001820160405280156103c457816020015b604080518082019091525f81526060602082015281526020019060019003908161039d5790505b5090505f5b8281101561045f5760405180604001604052806001151581526020018585848181106103f7576103f761092a565b905060200201602081019061040c919061093e565b6001600160a01b03163160405160200161042891815260200190565b60405160208183030381529060405281525082828151811061044c5761044c61092a565b60209081029190910101526001016103c9565b5092915050565b6060816001600160401b0381111561048057610480610916565b6040519080825280602002602001820160405280156104c557816020015b604080518082019091525f81526060602082015281526020019060019003908161049e5790505b506040516001600160a01b03861660248201529091505f9060440160408051601f198184030181529190526020810180516001600160e01b03166370a0823160e01b17905290505f5b8381101561056e5761054985858381811061052b5761052b61092a565b9050602002016020810190610540919061093e565b83614e20610577565b83828151811061055b5761055b61092a565b602090810291909101015260010161050e565b50509392505050565b604080518082019091525f815260606020820152833b8015610617575f5f866001600160a01b031685876040516105ae9190610999565b5f604051808303818686fa925050503d805f81146105e7576040519150601f19603f3d011682016040523d82523d5f602084013e6105ec565b606091505b5091509150811561061457604080518082019091529115158252602082015291506106409050565b50505b60405180604001604052805f1515815260200160405180602001604052805f8152508152509150505b9392505050565b5f5f83601f840112610657575f5ffd5b5081356001600160401b0381111561066d575f5ffd5b6020830191508360208260051b8501011115610687575f5ffd5b9250929050565b5f5f5f5f5f606086880312156106a2575f5ffd5b85356001600160401b038111156106b7575f5ffd5b6106c388828901610647565b90965094505060208601356001600160401b038111156106e1575f5ffd5b6106ed88828901610647565b96999598509660400135949350505050565b5f5b83811015610719578181015183820152602001610701565b50505f910152565b5f602082016020835280845180835260408501915060408160051b8601019250602086015f5b828110156107aa57603f198786030184528151805115158652602081015190506040602087015280518060408801526107878160608901602085016106ff565b601f01601f19169590950160600194506020938401939190910190600101610747565b50929695505050505050565b5f5f5f5f604085870312156107c9575f5ffd5b84356001600160401b038111156107de575f5ffd5b6107ea87828801610647565b90955093505060208501356001600160401b03811115610808575f5ffd5b61081487828801610647565b95989497509550505050565b80356001600160a01b0381168114610836575f5ffd5b919050565b5f5f5f6040848603121561084d575f5ffd5b83356001600160401b03811115610862575f5ffd5b61086e86828701610647565b9094509250610881905060208501610820565b90509250925092565b5f5f6020838503121561089b575f5ffd5b82356001600160401b038111156108b0575f5ffd5b6108bc85828601610647565b90969095509350505050565b5f5f5f604084860312156108da575f5ffd5b6108e384610820565b925060208401356001600160401b038111156108fd575f5ffd5b61090986828701610647565b9497909650939450505050565b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b5f6020828403121561094e575f5ffd5b61064082610820565b5f5f8335601e1984360301811261096c575f5ffd5b8301803591506001600160401b03821115610985575f5ffd5b602001915036819003821315610687575f5ffd5b5f82516109aa8184602087016106ff565b919091019291505056fea26469706673582212202df2b44b589b0df9b64d6ad3e7bd18c445e9534fabde2a18580dd1060e3182a964736f6c634300081d0033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.