sherlock-audit / 2024-08-saffron-finance-judging

6 stars 3 forks source link

bareli - Send ether with call instead of transfer #70

Open sherlock-admin2 opened 3 weeks ago

sherlock-admin2 commented 3 weeks ago

bareli

Medium

Send ether with call instead of transfer

Summary

Use call instead of transfer to send ether. And return value must be checked if sending ether is successful or not. Sending ether with the transfer is no longer recommended.

Vulnerability Detail

function withdrawAmountVariablePending() public { uint256 amount = variableToPendingWithdrawalAmount[msg.sender]; variableToPendingWithdrawalAmount[msg.sender] = 0; @>> payable(msg.sender).transfer(amount); }

Impact

Code Snippet

https://github.com/sherlock-audit/2024-08-saffron-finance/blob/main/lido-fiv/contracts/LidoVault.sol#L656

Tool used

Manual Review

Recommendation

use call instead of transfer.

c-plus-plus-equals-c-plus-one commented 3 weeks ago

Issues only outlining a recommendation and that don't point out the outcoming impacts are considered invalid, as per Sherlock docs.