code-423n4 / 2021-12-vader-findings

0 stars 0 forks source link

++i is more gas efficient than i++ in loops forwarding #143

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

defsec

Vulnerability details

Impact

++i is more gas efficient than i++ in loops forwarding.

Proof of Concept

  1. Navigate to the following contracts.
https://github.com/code-423n4/2021-12-vader/blob/main/contracts/tokens/USDV.sol#L152

Tools Used

Code Review

Recommended Mitigation Steps

It is recommend to use unchecked{++i} and change i declaration to uint256.

jack-the-pug commented 2 years ago

Dup #123