The addLiquidityProportional function in the UpliftOnlyExample contract performs state updates in an unsafe order that could lead to permanently locked LP positions. The function mints an NFT and updates related state mappings non-atomically:
The impact of this vulnerability centers on critical state inconsistencies in LP position tracking. If the transaction reverts after NFT minting but before setting nftPool[tokenID], the protocol enters a permanently broken state for that position.
This creates an NFT representing a position that becomes completely unusable. The NFT exists in ownership state but lacks critical protocol-level mappings required for all position management functions. The nftPool[tokenID] mapping, which serves as the core link between NFT positions and their underlying pool data, remains unset.
This broken state cascades through the protocol's key functionality. Any transfer attempt of the affected NFT will immediately revert in afterUpdate() due to the null pool mapping. The position becomes effectively locked, with no mechanism - even at the admin level - to reconnect the NFT to its intended pool data. Even more critically, the underlying BPT position associated with this NFT becomes permanently inaccessible.
The architectural impact extends beyond individual positions to affect core protocol operations. The presence of these "ghost" positions creates accounting inconsistencies in BTF position management, potentially impacting TFMM calculations and fee assessments. This undermines the protocol's ability to maintain accurate state across its liquidity management functions, directly affecting its primary value proposition of automated BTF management.
Reorder state updates to set critical mappings first:
Add an emergency recovery function (optional):
Consider implementing a more atomic deposit process by combining the NFT minting and state updates in a single operation.
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.