The emergencyWithdraw
function in BaseGauge.sol
does not validate the token address or amount before transferring funds. This could lead to:
Invalid token addresses being used, causing transaction failures.
Zero or excessive amounts being withdrawn, leading to unintended behavior.
The emergencyWithdraw
function currently allows the DEFAULT_ADMIN_ROLE to withdraw any token and amount from the contract:
No Check for Valid Token Address
If an invalid token address (address(0)) is passed, the function could fail silently or cause unexpected behavior.
No Check for Valid Amount
If amount == 0
, it wastes gas with an unnecessary transaction.
If amount > contract balance
, the transaction will revert, potentially disrupting emergency operations.
Invalid token addresses can cause unexpected reverts or failures.
If a malformed transaction is executed in an emergency, it could disrupt fund recovery.
Allowing zero-value transactions leads to unnecessary gas costs.
Manual Review
Modify the emergencyWithdraw
function to validate inputs before execution.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.