add division-by-zero check for ERC1155 too

This commit is contained in:
Michael Zhu 2020-01-14 16:32:18 -08:00
parent 149f863951
commit 1dca378e03

View File

@ -100,6 +100,11 @@ contract LibAssetData {
uint256 length = tokenIds.length;
for (uint256 i = 0; i != length; i++) {
// Skip over the token if the corresponding value is 0.
if (tokenValues[i] == 0) {
continue;
}
// Encode data for `balanceOf(ownerAddress, tokenIds[i])
bytes memory balanceOfData = abi.encodeWithSelector(
IERC1155(address(0)).balanceOf.selector,