// SPDX-License-Identifier: Unlicense pragma solidity 0.8.10; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract MockNoInfiniteAllowanceERC20 is ERC20 { constructor( string memory name, string memory symbol, uint256 initialSupply ) ERC20(name, symbol) { _mint(_msgSender(), initialSupply); } function mint(address to, uint256 amount) external { _mint(to, amount); } function _spendAllowance( address owner, address spender, uint256 amount ) internal override { uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } }