Function spec and implementation difference / strict comparison #45
Labels
1 (Low Risk)
Assets are not at risk. State handling, function incorrect as to spec, issues with comments
bug
Something isn't working
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Handle
loop
Vulnerability details
The function
tokenOfOwnerByIndex
has a requirement for_index
to be0
. This is different from the specification, which states:It also seems to be a bit unnecessary as
_index
is not even used in the following callgetTokenIdFor(_keyOwner)
.Proof of Concept
Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other https://github.com/code-423n4/2021-11-unlock/blob/main/smart-contracts/contracts/mixins/MixinERC721Enumerable.sol#L44-L59
Recommended Mitigation Steps
Change require statement to something according to specification:
require(_index < balanceOf(_keyOwner) && _keyOwner != address(0));
The text was updated successfully, but these errors were encountered: