Closed code423n4 closed 2 years ago
WatchPug
https://github.com/code-423n4/2021-09-wildcredit/blob/main/contracts/LendingPair.sol#L125-L136
function uniClaimDeposit() external { (uint amountA, uint amountB) = _uniCollectFees(msg.sender); _mintSupplyAmount(tokenA, msg.sender, amountA); _mintSupplyAmount(tokenB, msg.sender, amountB); } // claim & withdraw uniswap fees function uniClaimWithdraw() external { (uint amountA, uint amountB) = _uniCollectFees(msg.sender); _safeTransfer(tokenA, msg.sender, amountA); _safeTransfer(tokenB, msg.sender, amountB); }
amountA and amountB can be 0, Check if amount > 0 before _safeTransfer can save gas.
amountA
amountB
_safeTransfer
Duplicate #82
Handle
WatchPug
Vulnerability details
https://github.com/code-423n4/2021-09-wildcredit/blob/main/contracts/LendingPair.sol#L125-L136
amountA
andamountB
can be 0, Check if amount > 0 before_safeTransfer
can save gas.