Skip to content

Latest commit

 

History

History
59 lines (35 loc) · 1.45 KB

043.md

File metadata and controls

59 lines (35 loc) · 1.45 KB

Handsome Pineapple Mustang

Medium

Use SafeTransfer Instead Of Transfer

Summary

The return value of the transfer is not checked so it is possible that the transfer fails silently (returning a false ) and the rest of the function executes normally . In that case token balances and fees would be updated without any transfer taking place.

Root Cause

https://github.com/sherlock-audit/2024-11-debita-finance-v3/blob/main/Debita-V3-Contracts/contracts/DebitaIncentives.sol#L203 uint amountToClaim = (lentIncentive * porcentageLent) / 10000; amountToClaim += (borrowIncentive * porcentageBorrow) / 10000;

            IERC20(token).transfer(msg.sender, amountToClaim);

            emit ClaimedIncentives(
                msg.sender,
                principle,
                token,
                amountToClaim,
                epoch

https://github.com/sherlock-audit/2024-11-debita-finance-v3/blob/main/Debita-V3-Contracts/contracts/DebitaIncentives.sol#L269 // transfer the tokens IERC20(incentivizeToken).transferFrom( msg.sender, address(this), amount );

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

No response

Impact

transfer of tokens will not happen.

PoC

No response

Mitigation

Use safeTransfer or check the return value of the transfer