Skip to content

Commit

Permalink
Use call instead of transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
enriquefynn committed Jan 4, 2024
1 parent 8f95f93 commit 45442bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/FeeRewardsManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ library CalculateAndSendRewards {
);
// This can be used to call this contract again (reentrancy)
// but since all funds from this contract are used for the owner
payable(owner).transfer(ownerAmount);
(bool ownerSent, ) = payable(owner).call{value: ownerAmount}("");
require(ownerSent, "Failed to send Ether back to owner contract");
(bool sent, ) = payable(withdrawalCredential).call{
value: returnedAmount
}("");
Expand Down

0 comments on commit 45442bf

Please sign in to comment.