The LPNFT contract, which represents liquidity positions in the QuantAMM protocol, inherits from OpenZeppelin's ERC721
but does not enforce the use of safeTransferFrom
when transferring tokens to contract addresses. This could result in LP tokens becoming permanently locked if transferred to a contract that doesn't implement the ERC721Receiver
interface.
The LPNFT contract currently allows both transferFrom
and safeTransferFrom
methods for token transfers, as inherited from OpenZeppelin's ERC721
implementation. While it overrides the internal _update
function to handle vault balance updates, it doesn't add any safety checks for contract recipients:
LPNFT.sol#L49-L56
The vulnerability arises because:
The contract doesn't override the external transferFrom
function to prevent transfers to non-receiving contracts
Users can freely use transferFrom
instead of safeTransferFrom
The _update
function focuses on vault record updates but doesn't check if the recipient can handle ERC721
tokens
The contract represents valuable LP positions, making token recovery impossible if they get stuck
Permanent loss of LP tokens if transferred to non-receiving contracts
Manual Review
Modify the _update
function to include safety checks:
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelyhood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
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.