You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both as a gas optimization and general readability/usability concern: you should make use of the more general functions "atEpoch" to calculate the less general function. For example:
totalSupply() can be rewritten simply as totalSupplyatEpoch( currenctEpoch() ).
If the more general function is already coded, why not use it? It will also save gas.
Handle
tensors
Vulnerability details
Impact
Both as a gas optimization and general readability/usability concern: you should make use of the more general functions "atEpoch" to calculate the less general function. For example:
totalSupply() can be rewritten simply as totalSupplyatEpoch( currenctEpoch() ).
If the more general function is already coded, why not use it? It will also save gas.
Proof of Concept
https://github.com/code-423n4/2021-09-bvecvx/blob/1d64bd58c7a4224cc330cef283561e90ae6a3cf5/veCVX/contracts/locker/CvxLocker.sol#L416
Recommended Mitigation Steps
Implement above change.
The text was updated successfully, but these errors were encountered: