DeFiHardhatOracleProxyUpdates
100,000 USDC
View results
Submission Details
Severity: low
Invalid

Unchecked transfer

Summary

The return value of an external transfer/transferFrom call is not checked

Vulnerability Details

File: contracts/libraries/Convert/LibWellConvert.sol
/// @audit ******************* Issue Detail *******************
LibWellConvert._wellAddLiquidityTowardsPeg(uint256,uint256,address) (contracts/libraries/Convert/LibWellConvert.sol#194-207) ignores return value by:
- C.bean().transfer(well,beansConverted) (contracts/libraries/Convert/LibWellConvert.sol#202)
/// @audit ************** Possible Issue Line(s) **************
L#202,
/// @audit ****************** Affected Code *******************
194: function _wellAddLiquidityTowardsPeg(
195: uint256 beans,
196: uint256 minLP,
197: address well
198: ) internal returns (uint256 lp, uint256 beansConverted) {
199: (uint256 maxBeans, ) = _beansToPeg(well);
200: require(maxBeans > 0, "Convert: P must be >= 1.");
201: beansConverted = beans > maxBeans ? maxBeans : beans;
202: C.bean().transfer(well, beansConverted);
203: lp = IWell(well).sync(
204: address(this),
205: minLP
206: );
207: }

Impact

Protocol always assume that transfer will be successful and does not handle the case for unsuccessful trasnfer.

Tools Used

Manual Aided Review

Recommendations

Use SafeERC20, or ensure that the transfer/transferFrom return value is checked.

Updates

Lead Judging Commences

giovannidisiena Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
Assigned finding tags:

Bean transfer return

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.