Closed code423n4 closed 2 years ago
pauliax
Here the FeesSwept event will always emit 0 amount as this.balance is already transferred an nothing left in the contract: feeRecipient.transfer(address(this).balance); emit FeesSwept(address(0), address(this).balance, feeRecipient);
uint balance = address(this).balance; feeRecipient.transfer(balance); emit FeesSwept(address(0), balance, feeRecipient);
Duplicate of #21.
Handle
pauliax
Vulnerability details
Impact
Here the FeesSwept event will always emit 0 amount as this.balance is already transferred an nothing left in the contract: feeRecipient.transfer(address(this).balance); emit FeesSwept(address(0), address(this).balance, feeRecipient);
Recommended Mitigation Steps
uint balance = address(this).balance; feeRecipient.transfer(balance); emit FeesSwept(address(0), balance, feeRecipient);