ERC1363ForceApproveMock.sol 532 B

12345678910111213
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.20;
  3. import {ERC1363} from "../../token/ERC20/extensions/ERC1363.sol";
  4. // contract that replicate USDT approval behavior in approveAndCall
  5. abstract contract ERC1363ForceApproveMock is ERC1363 {
  6. function approveAndCall(address spender, uint256 amount, bytes memory data) public virtual override returns (bool) {
  7. require(amount == 0 || allowance(msg.sender, spender) == 0, "USDT approval failure");
  8. return super.approveAndCall(spender, amount, data);
  9. }
  10. }