20,000 USDC
View results
Submission Details
Severity: low
Valid

`block.timestamp` Can Be Manipulated By Miners

Summary

The smart contract relies on block.timestamp for calculating timeElapsed , which can be manipulated by miners, potentially leading to security vulnerabilities.

Vulnerability Details

The contract utilizes the block.timestamp variable to make decisions based on the current block's timestamp. However, miners have some control over the timestamp's value within a certain range, allowing them to manipulate the timestamp to a certain extent.

Code Snippet

File: Lender.sol
723: uint256 timeElapsed = block.timestamp - l.startTimestamp;

Impact

Miners' ability to influence the block.timestamp can introduce significant security risks to the contract.

Tools Used

Manual Review

Recommendations

Consider using block.number or other block-related variables, which are less susceptible to manipulation by miners, for any time-dependent functionalities or decision-making processes.

Support

FAQs

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

Give us feedback!