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);
}
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.