68849 sc insight elapsed computed twice in withdraw code optimization
Description
Brief/Intro
Vulnerability Details
// src/Staking.sol#L317-L320
uint256 accruedAmount =
_getAccrued(userStake.amount, userStake.unlockDuration, block.timestamp - userStake.unlockTime);
uint256 accruedReward =
_getAccrued(userStake.reward, userStake.unlockDuration, block.timestamp - userStake.unlockTime);Impact Details
References
Recommendation
Proof of Concept
Previous69420 sc insight avoid the use of floating pragma to ensure same compiler version used for testing is also used for deploymentNext69390 sc low users cannot revoke migration permit at any time breaking documented guarantee
Was this helpful?