Wide Bone Shetland
Medium
withdrawGraduatedMarketFunds and withdrawDonations functions should avoid using the whenNotPaused modifier
Using the whenNotPaused modifier will cause users to lose access to their funds when the contract is paused, as it prevents the withdrawGraduatedMarketFunds and withdrawDonations functions from being executed. This could leave users unable to withdraw their funds/donations during emergencies or unexpected pauses,
The root cause lies in the use of the whenNotPaused modifier in the withdrawDonations and withdrawGraduatedMarketFunds functions.
"withdrawDonations"
"withdrawGraduatedMarketFunds"
-
The contract must be paused, either by a malicious or a compromised owner, for the vulnerability path to occur.
-
The withdrawDonations and withdrawGraduatedMarketFunds functions includes the whenNotPaused modifier, preventing withdrawals while the contract is paused.
-
Users need to have funds available in the contract to attempt withdrawal.
-
The paused state must last long enough for users to try to withdraw funds, thereby triggering the blockage (whenNotPaused).
No response
No response
- The User Loses Access to Funds:
No response
Provide an emergencyWithdrawFunds and emergencyWithdrawDonations
method allowing users to withdraw their funds and donations when the protocol is paused or remove the whenNotPaused modifier from the affected functions. This change should be carefully reviewed and tested to ensure it does not introduce other security risks.