■ Description

Some tokens (e.g. OpenZeppelin) will revert if trying to approve the zero address to spend tokens (i.e. a call to approve(address(0), amt)).

Integrators may need to add special cases to handle this logic if working with such a token.

■ Example

function approve(address usr, uint wad) override public returns (bool) {
    require(usr != address(0), "no approval for the zero address");
    return super.approve(usr, wad);
}

■ How to protect against this attack?

If you use the approve to address(0), you have the risk of reverting transaction.

If you use the transfer to address(0), you have the risk of reverting transaction.

You need to check!

■ Resources

https://github.com/d-xo/weird-erc20#revert-on-transfer-to-the-zero-address