QuantAMM

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

Incorrect state update in afterUpdate

Summary

FeeData.blockTimestampDeposit is meant to store the block.timestamp of the last time a deposit was made or updated. This variable is updated incorrectly in UpliftOnlyExample::afterUpdate.

Vulnerability Details

feeDataArray[tokenIdIndex].blockTimestampDeposit = uint32(block.number);
In UpliftOnlyExample: https://github.com/Cyfrin/2024-12-quantamm/blob/main/pkg/pool-hooks/contracts/hooks-quantamm/UpliftOnlyExample.sol#L610
blockTimestampDeposit is set to block.number, however according to the variable name, blockTimestampDeposit should store the block.timestamp of the last time when a deposit was made / updated.

Impact

Incorrect state may cause issues in the code if future updates use the blockTimestampDeposit variable for key logic.

Tools Used

Manual

Recommendations

Set blockTimestampDeposit to be block.timestamp, not block.number in afterUpdate.

Updates

Lead Judging Commences

n0kto Lead Judge 10 months ago
Submission Judgement Published
Validated
Assigned finding tags:

finding_afterUpdate_blockNumber_instead_of_timestamp

Likelihood: Medium/High, any NFT transfer will change this variable. Impact: Informational/Very Low. This variable is unused and won’t impact anything, but the array is public and its getter will return a variable with inconsistencies.

Support

FAQs

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

Give us feedback!