Skip to content

Instantly share code, notes, and snippets.

@MGF15
Created August 29, 2023 11:35
Show Gist options
  • Save MGF15/1d146b7845d210eb8b87a1c332530aeb to your computer and use it in GitHub Desktop.
Save MGF15/1d146b7845d210eb8b87a1c332530aeb to your computer and use it in GitHub Desktop.

M | Approval Race Protections

Description :-

Some tokens (e.g. USDT, KNC) do not allow approving an amount M > 0 when an existing amount N > 0 is already approved. This is to protect from an ERC20 attack vector describe here

Proof Of Concept

File:wemix-lending-contract-main/contracts/lending/TeamMinter.sol
61:        IERC20(underlyingTokenAddress).approve(cErc20Address, mintAmount);

Context:-

TeamMinter.sol#L61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment