Closed code423n4 closed 2 years ago
Funen
Using i++ instead ++i for all the loops, the variable i is incremented using i++. It is known that implementation by using ++i costs less gas per iteration than i++.
by seen the disscussion here : https://github.com/ethereum/solidity/issues/10695
contracts/ConvexStakingWrapper.sol/L115: contracts/ConvexStakingWrapper.sol/L287: contracts/ConvexStakingWrapper.sol/L271: contracts/ConvexStakingWrapper.sol/L315: contracts/ConvexYieldWrapper.sol/L63: contracts/ConvexYieldWrapper.sol/L80: contracts/ConvexYieldWrapper.sol/L111:
Duplicate of #14
Handle
Funen
Vulnerability details
Impact
Using i++ instead ++i for all the loops, the variable i is incremented using i++. It is known that implementation by using ++i costs less gas per iteration than i++.
POC
by seen the disscussion here : https://github.com/ethereum/solidity/issues/10695
Occurance
contracts/ConvexStakingWrapper.sol/L115:
contracts/ConvexStakingWrapper.sol/L287:
contracts/ConvexStakingWrapper.sol/L271:
contracts/ConvexStakingWrapper.sol/L315:
contracts/ConvexYieldWrapper.sol/L63:
contracts/ConvexYieldWrapper.sol/L80: contracts/ConvexYieldWrapper.sol/L111: