QuantAMM

QuantAMM
49,600 OP
View results
Submission Details
Severity: low
Invalid

Wrong error message in UpliftOnlyExample.sol

Summary

The error messages thrown by the function onRegister()says the opposite of the intended message, and this is misleading.

Vulnerability Details

The contract upliftOnlyExample.sol declares the series of error messages including the two thrown in onRegister()
here is the error messages

* @notice The pool does not support adding liquidity through donation.
* @dev There is an existing similar error (IVaultErrors.DoesNotSupportDonation), but hooks should not throw
* "Vault" errors.
*/
error PoolDoesNotSupportDonation();

This message is supposed to be thrown when the pool does not support donations. But the function checks if enableDonation is false, and it then throws PoolDoesNotSupportDonation. Since enableDonation has to be true, it means that pool supports donation and error messagge is actually misleading.

function onRegister(
address,
address pool,
TokenConfig[] memory,
LiquidityManagement calldata liquidityManagement
) public override onlyVault returns (bool) {
// This hook requires donation support to work (see above).
if (liquidityManagement.enableDonation == false) {
revert PoolDoesNotSupportDonation();
//more code....

Impact

error message does not correspond with the check. This can confuse users.

Tools Used

Manual review

Recommendations

Change the error message thus;

- error PoolDoesNotSupportDonation();
+ error PoolSupportDonation();
Updates

Lead Judging Commences

n0kto Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Appeal created

brazexyz Submitter
10 months ago
n0kto Lead Judge
10 months ago
n0kto Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!