The TokenDivider
contract uses a balances
mapping to track users' ownership of fractionalized ERC20 tokens. However, this mapping becomes outdated if users transfer tokens off-protocol using the ERC20 transfer function. As a result, even if a user owns all fractional tokens of an NFT through off-protocol transactions, they will not be able to claim the NFT due to a mismatch between their actual token balance and the protocol's internal balances mapping.
In the TokenDivider::claimNFT
function verifies that a user has sufficient fractional tokens to claim the corresponding NFT. This verification relies on the balances mapping, as shown in the following code snippet:
at Github Link.The balances mapping is updated only through protocol-specific functions and does not account for off-protocol transfers of fractional tokens. If a user transfers tokens using the ERC20 transfer function or acquires all fractional tokens off-protocol, the balances mapping will not reflect these changes. Consequently, users who rightfully own all fractional tokens may be unable to claim the NFT due to the outdated balance check.
Inability to Claim NFTs : Denial of Service(DOS)
Users who transfer fractional tokens off-protocol or acquire all fractions off-protocol will not be able to claim the NFT, as the balances mapping does not reflect their actual ownership.
Protocol Limitations
The reliance on an internal balances mapping instead of real-time token ownership introduces a design limitation, making the protocol less flexible and prone to errors.
On-Chain Verification of Token Ownership
Use the ERC20 balanceOf function to directly verify a user's token ownership. This ensures the check is accurate and reflects the current state of the blockchain. Example implementation:
revert TokenDivider__InsufficientBalance();}
Educate Users
Clearly communicate the limitations of the current system to users, warning them about the consequences of transferring fractional tokens off-protocol. Include documentation on best practices to avoid potential issues.
Manual code review
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.