code-423n4 / 2021-04-maple-findings

0 stars 0 forks source link

FundsWithdrawn event emitted when amount withdrawn is 0 #107

Closed code423n4 closed 3 years ago

code423n4 commented 3 years ago

Handle

janbro

Vulnerability details

Summary

_prepareWithdraw emits a FundsWithdrawn event even when the amount withdrawn is 0. This is contradictory to the comment @dev It emits a FundsWithdrawn event if the amount of withdrawn ether is greater than 0.

Risk Rating

Low

Vulnerability Details

BasicFDT.sol Line 60: emit FundsWithdrawn(msg.sender, _withdrawableDividend, withdrawnFunds[msg.sender]); prepareWithdraw

Impact

Congestion of events

Tools Used

Manual code review

Recommended Mitigation Steps

Wrap line 60 in BasicFDT.sol in an if statement requiring the withdrawn funds to be greater than 0 e.g. if(_withdrawableDividend > 0) emit FundsWithdrawn(msg.sender, _withdrawableDividend, withdrawnFunds[msg.sender]);

lucas-manuel commented 3 years ago

Duplicate of #96