Flow

Sablier
FoundryDeFi
20,000 USDC
View results
Submission Details
Severity: medium
Invalid

Token Transfer Safety and Approval Checks

location: /src/abstracts/SablierFlowBase.sol

Description: The recover function allows the admin to transfer surplus tokens but does not verify if the admin has the required approval to transfer tokens, especially if the token is an ERC20 contract.

  • Code Reference:

token.safeTransfer(to, surplus); // Potentially lacks approval check

Impact:

  • If the contract does not have enough balance or approval to make the transfer, it will fail, leading to failed transactions.

  • Recommendations:

    • Ensure that the contract holds enough tokens by checking the balance before the transfer, or add a mechanism to approve the contract for token transfers:

      require(token.balanceOf(address(this)) >= surplus, "Insufficient contract balance");
Updates

Lead Judging Commences

inallhonesty Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality
inallhonesty Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.