The divideNft
function in TokenDivider
contract overwrites the nftToErc20Info
mapping for each NFT address without checking if an ERC20 token already exists for that NFT, potentially causing users to lose access to their NFTs.
In the divideNft
function, the nftToErc20Info
mapping is overwritten without any checks:
If a user calls divideNft
multiple times for the same NFT address with different token IDs, the previous ERC20 token information will be lost, and users holding fractions of the previous ERC20 token will be unable to claim their NFT.
Proof-Of-Concept:
Users holding fractions of the original ERC20 token will lose their ability to claim the NFT
Loss of funds as the original ERC20 tokens become worthless
Manual code review
Performing formal verification with Quint
Modify the mapping to track both NFT address and token ID:
Add a check to prevent multiple divisions of the same NFT:
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.