The UpliftOnlyExample
hook serves as a router and manages liquidity deposits, NFT minting, and BPT tokens. However, it lacks an initialize
function to properly initialize and deposit the first liquidity into a new pool. This omission can lead to scenarios where liquidity is initialized by an external router, creating issues for users attempting to withdraw liquidity due to the NFT check in onAfterRemoveLiquidity
.
The UpliftOnlyExample
hook does not include an initialize
function to handle the initialization and first liquidity deposit for a newly registered pool. In balancer a new pool has to be initialized using the router to mint the initial minimum BPT to start it's operation
This can be done by other routers but when a pool is initialized by another router, that user will not be able to withdraw their liquidity. The withdrawal process requires burning an NFT in onAfterRemoveLiquidity
function. Since that user never got any NFT, he can never withdraw his funds.
Without an NFT, the user who initialized the pool cannot withdraw their funds, creating a locking scenario due to mismatched initialization mechanisms.
The user who initializes the pool through another router will have their funds permanently locked.
Manual Code Review
Implement an initialize
function within the UpliftOnlyExample
hook similar to the initialize
of Router.sol
to handle initial liquidity deposit for new pools. Ensure this function incorporates the necessary NFT minting and checks.
Likelihood: High, no function to instantiate the vault and will need to deploy a brand new contract or another router with a dedicated function to initialize it. Impact: Low, unusable contract: cannot swap/addLiquidity until a new contract with that function is deployed and call it. So no funds will be sent and lost. An alternative could be to deploy another router and initialize that pool but it will lead to lost a dust amount.
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.