Skip to content

Commit

Permalink
fix: Violation Of CEI Pattern In FeePayOut Allows For Reentrancy, 443
Browse files Browse the repository at this point in the history
  • Loading branch information
shaspitz committed Oct 24, 2024
1 parent ce3ce6f commit 117353e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contracts/contracts/utils/FeePayout.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ library FeePayout {
/// @param tracker The FeePayout.Tracker struct
function transferToRecipient(Tracker storage tracker) internal {
uint256 amountToPay = tracker.accumulatedAmount;
(bool success, ) = payable(tracker.recipient).call{value: amountToPay}("");
require(success, TransferToRecipientFailed());
tracker.accumulatedAmount = 0;
tracker.lastPayoutBlock = block.number;
(bool success, ) = payable(tracker.recipient).call{value: amountToPay}("");
require(success, TransferToRecipientFailed());
emit FeeTransfer(amountToPay, tracker.recipient);
}

Expand Down

0 comments on commit 117353e

Please sign in to comment.