QuantAMM

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

Incorrect Use of block.number Instead of block.timestamp for blockTimestampDeposit in afterUpdate::UpliftOnlyExample.sol

Summary

In the afterUpdate function, the blockTimestampDeposit field of feeDataArray[tokenIdIndex] is assigned the value of block.number instead of block.timestamp.

This is incorrect because blockTimestampDeposit suggests it should store the current timestamp (in seconds since the Unix epoch), which represents the time of the block. However, block.number represents the block height, which is unrelated to time and is an incremental counter for the blockchain.

Vulnerability Details

Vulnerable Code Segment

feeDataArray[tokenIdIndex].blockTimestampDeposit = uint32(block.number); mp

The use of block.number here is a semantic mismatch with the intended purpose of the blockTimestampDeposit field.

Impact

incorrect data representation

Tools Used

Manual review

Recommendations

Replace block.number with block.timestamp to correctly assign the current block's timestamp:

feeDataArray[tokenIdIndex].blockTimestampDeposit = uint32(block.timestamp);
Updates

Lead Judging Commences

n0kto Lead Judge 7 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.