code-423n4 / 2021-12-defiprotocol-findings

0 stars 0 forks source link

Check for tokenAmount > 0 is missing in pushUnderlying function [basket.sol] #165

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

rishabh

Vulnerability details

Impact

In pushUnderlying function, there are no checks for tokenAmount being greater than zero. This will lead to the execution of safeTransfer function even when tokenAmount is zero and will cost extra gas for nothing.

Details

L281

Tools Used

Manual Code Review

frank-beard commented 2 years ago

would consider this a gas optimization rather than an issue

0xleastwood commented 2 years ago

Agree this is a gas optimisation.