ERC-1155 function
balanceOfBatch(address[],uint256[])
Reads several ERC-1155 account-and-token balances in one call.
- Selector
- 0x4e1273f4
- Mutability
- view
Generate balanceOfBatch calldata
Edit the example inputs to rebuild the bytes instantly in your browser. Nothing is sent and no transaction is submitted.
calldata260 bytes
sel0x4e1273f4
balanceOfBatch(address[],uint256[])
0x000000000000000000000000000000000000000000000000000000000000000040
→ accounts, points to0x40
0x2000000000000000000000000000000000000000000000000000000000000000a0
→ ids, points to0xa0
0x400000000000000000000000000000000000000000000000000000000000000002
accounts · length =2 elements
0x600000000000000000000000001111111111111111111111111111111111111111
accounts[0] · address =0x11111111…111111
0x800000000000000000000000002222222222222222222222222222222222222222
accounts[1] · address =0x22222222…222222
0xa00000000000000000000000000000000000000000000000000000000000000002
ids · length =2 elements
0xc0000000000000000000000000000000000000000000000000000000000000002a
ids[0] · uint256 =42
0xe00000000000000000000000000000000000000000000000000000000000000063
ids[1] · uint256 =99
How balanceOfBatch works
The arrays are paired by index: accounts[0] is queried with ids[0], accounts[1] with ids[1], and so on.
Parameters
| Name | Solidity type | Meaning |
|---|---|---|
| accounts | address[] | Accounts to query, in positional order. |
| ids | uint256[] | Token IDs paired with the accounts at the same indexes. |
Return value
An array of balances in the same order as the input pairs.
uint256[] resultReturn data comes back after execution and is not included in the calldata above.