QuantAMM

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

`block.number` is Used Instead of `block.timestamp` for `blockTimestampDeposit` in `UpliftOnlyExample::afterUpdate`

Summary

In the UpliftOnlyExample::afterUpdate function, when an NFT is transferred and the feeDataArray is updated, the code uses block.number for blockTimestampDeposit.

Vulnerability Details

The relevant code snippet shows the issue:

if (tokenIdIndexFound) {
if (_to != address(0)) {
feeDataArray[tokenIdIndex].lpTokenDepositValue = lpTokenDepositValueNow;
feeDataArray[tokenIdIndex].blockTimestampDeposit = uint32(block.number); // @audit block.number is used
}
}

Recommendations

Replace block.number with block.timestamp in the blockTimestampDeposit assignment:

feeDataArray[tokenIdIndex].blockTimestampDeposit = uint40(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.