The function collectFee()
transfers WETH tokens to the collector using .transfer()
. However, transfer does not handle all ERC20 token implementations safely, which may lead to unexpected failures when interacting with certain tokens that implement non-standard behavior.
Likelihood:
Occurs whenever the contract attempts to send tokens using transfer()
.
Impact:
Potential of transaction silently fails.
Interruption of fee collection, preventing proper execution.
When collectFee()
is called, it attempts to transfer WETH tokens.
If the collector’s balance does not increase despite the transfer executing, it indicates the potential failure of .transfer()
.
Replacing it with .safeTransfer()
ensures correct token transfer handling, mitigating these risks.
Replace .transfer()
with .safeTransfer()
from OpenZeppelin’s SafeERC20 library, ensuring proper handling of token transfers, even for non-standard implementations:
This prevents issues related to unexpected token behaviors, improving compatibility and reliability.
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.