Closed code423n4 closed 2 years ago
pauliax
_amount.add(feeAmount) is re-evaluated again and again inside the loop:
for (uint256 i; i < bs.tokens.length; i++) { ... uint256 tokenAmount = balance(address(token)).mul(_amount.add(feeAmount)).div( totalSupply ); ... }
These values do not change so consider extracting outside the loop to reduce gas costs.
Duplicate of #205
Handle
pauliax
Vulnerability details
Impact
_amount.add(feeAmount) is re-evaluated again and again inside the loop:
These values do not change so consider extracting outside the loop to reduce gas costs.