Platform: Code4rena
Start Date: 27/01/2022
Pot Size: $75,000 USDT
Total HM: 6
Participants: 29
Period: 7 days
Judge: leastwood
Total Solo HM: 6
Id: 72
League: ETH
Rank: 26/29
Findings: 1
Award: $6.26
🌟 Selected for report: 0
🚀 Solo Findings: 0
IllIllI
When the value of the post-loop increment/decrement is not stored or used in any calculations, the prefix increment/decrement operators (++i
/--i
) cost less gas PER LOOP than the postfix increment/decrement operators (i++
/i--
)
There are 27 instances of this issue in the repository:
for (uint i = 0; i < nonce.length; i++) {
for (uint i = 0; i < dexName.length; i++) {
for (uint i = 1; i < tokens.length; i++) {
for (uint i = 0; i < path.length; i++) {
for (uint i = 1; i < tokens.length; i++) {
for (uint i = 0; i < dexName.length; i++) {
for (uint i = 0; i < length; i++){
for (uint i = 0; i < length; i++) {
for (uint i = 0; i < length - 1; i++) {
for (uint i = 0; i < traders.length; i++) {
for (uint i = 0; i < traders.length; i++) {
for (uint i = 0; i < pools.length; i++) {
for (uint i = 0; i < _supportDexs.length; i++) {
for (uint i = 0; i < proposal.targets.length; i++) {
for (uint i = 0; i < proposal.targets.length; i++) {
for (uint i = 0; i < proposal.targets.length; i++) {
for (uint i = 0; i < support.length; i++) {
for (uint256 i = 0; i < _excluded.length; i++) {
for (uint256 i = 0; i < _excluded.length; i++) {
for (uint256 i = 0; i < stakeTokens.length; i++) {
for (uint256 i = 0; i < stakeTokens.length; ++i) {
for (uint256 i = 0; i < stakeTokens.length; i++) {
for (uint i = 0; i < lpools.length; i++) {
for (uint i = 0; i < marketIds.length; i++) {
for (uint256 i = 0; i < len; i ++) {
for (uint i = 0; i < beneficiaries.length; i++) {
for (uint i = 0; i < dexs.length; i++) {
Code inspection
Use ++i
rather than i++
in all places
#0 - ColaM12
2022-02-03T06:25:54Z
Duplicate to #13