The payable functions addLiquidityProportional and removeLiquidityProportional fail to process Ether payments. The root cause is the absence of a receive() or fallback() function, which are required to accept Ether sent to the contract.
Affected Functions
https://github.com/Cyfrin/2024-12-quantamm/blob/a775db4273eb36e7b4536c5b60207c9f17541b92/pkg/pool-hooks/contracts/hooks-quantamm/UpliftOnlyExample.sol#L219-L286
Issue
These functions are declared as payable but do not have an associated receive() or fallback() function at the contract level. In Solidity, any Ether sent to a contract without these functions will revert the transaction. Consequently, attempts to use these functions with Ether will always fail.
Vulnerable Code
Transactions involving Ether sent to addLiquidityProportional or removeLiquidityProportional will revert, preventing intended liquidity operations.
Manual code review.
Add the receive function to resolve this lack of fallback issue.
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.