The vulnerability present in the code is a logical error due to the mismatch between the expected and actual data being stored in the variable blockTimestampDeposit
. Although the variable blockTimestampDeposit
is not used now, it can lead to unexpected side effects in future.
In UpliftOnlyExample
, the variable blockTimestampDeposit
in struct FeeData
is intended to store the timestamp of when liquidity was added, which should be represented by block.timestamp
:
However, later in the afterUpdate
function, the value of blockTimestampDeposit
is incorrectly reset to uint32(block.number)
, which is the current block number instead of the timestamp:
This logical inconsistency can lead to confusion regarding the actual time that liquidity was added and can cause issues in any functionality dependent on blockTimestampDeposit
.
In conclusion, the logical error of resetting blockTimestampDeposit
to uint32(block.number)
not only misrepresents the time of liquidity addition but can have far-reaching implications affecting contract functionality and usage, resulting in exploitable vulnerabilities in dependent logic.
The impact is LOW, the likelihood is HIGH, so the severity is MEDIUM.
Manual Review
Consider following fix:
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.
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.