code-423n4 / 2021-09-wildcredit-findings

0 stars 0 forks source link

Gas: Unnecessary `_maxAmount` parameter in `repayAllETH` #49

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

cmichel

Vulnerability details

The LendingPair.repayAllETH function takes a _maxAmount parameter.

However, this parameter is not necessary as the caller's msg.value already has the same behavior of a _maxAmount.

Recommendation

Remove the _maxAmount parameter to save gas. Users should use msg.value as a max amount.