code-423n4 / 2021-11-nested-findings

1 stars 1 forks source link

Unchecked operations #214

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

pauliax

Vulnerability details

Impact

Using the unchecked keyword to avoid redundant arithmetic underflow/overflow checks to save gas when an underflow/overflow cannot happen, e.g. the unchecked keyword can be applied in the following lines of code:

  if (_amountToSpent - _amountSpent > 0) {
    ...
    feeSplitter.sendFees(_token, _amountToSpent - _amountSpent); //unchecked
  }
  if (_inputTokenAmounts[i] - amountSpent > 0) {
    _transferFeeWithRoyalty(_inputTokenAmounts[i] - amountSpent, _inputToken, _nftId); //unchecked
  }
maximebrugel commented 2 years ago

Duplicated : #46