Sablier

Sablier
DeFiFoundry
53,440 USDC
View results
Submission Details
Severity: low
Invalid

Revert on Large Approvals & Transfers

Summary

Some tokens (e.g. UNI, COMP) revert if the value passed to approve or transfer is larger than uint96.

Vulnerability Details

In the function _approve(address sablierContract, IERC20 asset, uint256 amount), if the contract's allowance is insufficient, the contract forcefully approves Sablier to spend the exact amount set to the maximum value of uint256 using the forceApprove() function to ensure the stream operation can proceed.

`/// @dev Helper function to approve a Sablier contract to spend funds from the batchLockup. If the current allowance
/// is insufficient, this function approves Sablier to spend the exact `amount`.
/// The {SafeERC20.forceApprove} function is used to handle special ERC-20 assets (e.g. USDT) that require the
/// current allowance to be zero before setting it to a non-zero value.
function _approve(address sablierContract, IERC20 asset, uint256 amount) internal {
    uint256 allowance = asset.allowance({ owner: address(this), spender: sablierContract });
    if (allowance < amount) {
        asset.forceApprove({ spender: sablierContract, value: amount });
    }
}`

However, Some tokens (e.g., UNI, COMP) revert if the value passed to approve or transfer is larger than uint96.

Impact

Revert on large approvals

Tools Used

Manual Review

Recommendations

Recommend handling tokens of this type.

Updates

Lead Judging Commences

inallhonesty Lead Judge
over 1 year ago
inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
Assigned finding tags:

ERC20 UNI and COMP Revert on Large Approvals

Support

FAQs

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