Description:
The ERC721 standard specifies that when an NFT is transferred to a smart contract via the safeTransfer function, the receiver contract should implement the onERC721Received function, which will have to return its own selector. For this reason, the return value should be the exact selector of the function defined in the standard. TokenDivider::onERC721Received returns this.onERC721Received.selector, which refers to the implementation of the function, and not to the original function defined in IERC721Receiver.
Impact:
Since the TokenDivider contract inherits from IERC721Receiver, the implementation for the function TokenDivider::onERC721Received is equal to the function defined in the standard. To avoid potential compability issues, it is recommended to follow the best practices and return the exact value expected by the safeTransfer function, hence IERC721Receiver.onERC721Received.selector.
Tools Used:
Manual review
Recommended Mitigation:
It is recommended to return the exact selector for onERC721Received function defined in IERC721Receiver.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.