// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.17; import '@openzeppelin/contracts/token/ERC20/ERC20.sol'; contract MockERC20 is ERC20 { constructor (string memory name_, string memory symbol_, uint amountToMint) ERC20(name_, symbol_) { setBalance(msg.sender, amountToMint); } // sets the balance of the address // this mints/burns the amount depending on the current balance function setBalance(address to, uint amount) public { uint old = balanceOf(to); if (old < amount) { _mint(to, amount - old); } else if (old > amount) { _burn(to, old - amount); } } function mint(address to, uint amount) public { _mint(to, amount); } }