You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
infinite approval will always revert for some ERC20 compliant tokens
Summary
/** * @notice Approves `grantee` to spend infinite tokens from the caller * @dev Uses `approve` rather than `safeApprove` since the race condition * in safeApprove does not apply when going to an infinite approval * @param self Token to grant approval * @param self Token to grant approval * @param grantee Address to allow spending */
Quirks in the COMP token itself
The COMP token that the rewards contract distributes does not store balances as a uint256 like most ERC 20 tokens do, but rather as a uint96.
COMP token balances mapping
If you try to transfer or approve an amount greater than the uint96 maximum value, the transaction will revert.
sherlock-admin3
changed the title
Tame Punch Seal - infinite approval will always revert for some ERC20 compliant tokens
0xaliyah - infinite approval will always revert for some ERC20 compliant tokens
Sep 23, 2024
0xaliyah
Medium
infinite approval will always revert for some ERC20 compliant tokens
Summary
Vulnerability Detail
Impact
Code Snippet
Tool used
Manual Review
Recommendation
The text was updated successfully, but these errors were encountered: