You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
591 B
14 lines
591 B
// SPDX-License-Identifier: MIT
|
|
|
|
pragma solidity ^0.8.20;
|
|
|
|
import {IERC20} from "../../interfaces/IERC20.sol";
|
|
import {ERC20, ERC1363} from "../../token/ERC20/extensions/ERC1363.sol";
|
|
|
|
// contract that replicate USDT approval behavior in approveAndCall
|
|
abstract contract ERC1363ForceApproveMock is ERC1363 {
|
|
function approveAndCall(address spender, uint256 amount, bytes memory data) public virtual override returns (bool) {
|
|
require(amount == 0 || allowance(msg.sender, spender) == 0, "USDT approval failure");
|
|
return super.approveAndCall(spender, amount, data);
|
|
}
|
|
}
|
|
|