Closed code423n4 closed 2 years ago
Dravee
Increased gas cost (1 MSTORE and 1 MLOAD)
File: DelegatorPool.sol 71: uint256 currTotalStake = pendingStake(); 72: uint256 owedStake = (currTotalStake * _stake) / 73: (initialStake - claimedInitialStake);
VS Code
As there aren't any gain (one can argue: not even in readability) in having this variable: use pendingStake() directly in the calculation:
pendingStake()
uint256 owedStake = (pendingStake() * _stake) / (initialStake - claimedInitialStake);
Duplicate of https://github.com/code-423n4/2022-01-livepeer-findings/issues/131
Handle
Dravee
Vulnerability details
Impact
Increased gas cost (1 MSTORE and 1 MLOAD)
Proof of Concept
Tools Used
VS Code
Recommended Mitigation Steps
As there aren't any gain (one can argue: not even in readability) in having this variable: use
pendingStake()
directly in the calculation: