DeFiHardhatFoundry
250,000 USDC
View results
Submission Details
Severity: low
Valid

Block time is hardcoded to 2 seconds which is wrong for different L2s

Summary

Block time is hardcoded to 2 seconds. It's true for Optimism stack, but wrong for Arbitrum for example or Polygon zkEVM. On Arbitrum there are 3-4 blocks per second.

Vulnerability Details

It uses block time to calculate morning temperature and as a result always overestimates delta on Arbitrum:

function morningTemperature() internal view returns (uint256) {
AppStorage storage s = LibAppStorage.diamondStorage();
uint256 delta = block.number.sub(s.sys.season.sunriseBlock).mul(L2_BLOCK_TIME).div(
L1_BLOCK_TIME
);
...
}

Impact

Temperature is incorrectly calculated on L2s with different block time.

Tools Used

Manual Review

Recommendations

Set to storage upon deployment instead of hardcoding such value.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Design choice
Assigned finding tags:

L2_BLOCK_TIME hardcoded to 2 seconds is not right for most L2's

Appeal created

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

L2_BLOCK_TIME hardcoded to 2 seconds is not right for most L2's

Support

FAQs

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