This repository has been archived by the owner on Jun 11, 2023. It is now read-only.
cccz - The Hats contract needs to override the ERC1155.balanceOfBatch function #85
Labels
Fix Approved
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
Hats.sol
Medium
A valid Medium severity issue
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
cccz
medium
The Hats contract needs to override the ERC1155.balanceOfBatch function
Summary
The Hats contract does not override the ERC1155.balanceOfBatch function
Vulnerability Detail
The Hats contract overrides the ERC1155.balanceOf function to return a balance of 0 when the hat is inactive or the wearer is ineligible.
But the Hats contract does not override the ERC1155.balanceOfBatch function, which causes balanceOfBatch to return the actual balance no matter what the circumstances.
Impact
This will make balanceOfBatch return a different result than balanceOf, which may cause errors when integrating with other projects
Code Snippet
https://github.com/Hats-Protocol/hats-protocol/blob/main/src/Hats.sol#L1149-L1162
https://github.com/Hats-Protocol/hats-protocol/blob/main/lib/ERC1155/ERC1155.sol#L118-L139
Tool used
Manual Review
Recommendation
Consider overriding the ERC1155.balanceOfBatch function in Hats contract to return 0 when the hat is inactive or the wearer is ineligible.
The text was updated successfully, but these errors were encountered: