ERC20MockUpgradeable.sol 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.0;
  3. import "../token/ERC20/ERC20Upgradeable.sol";
  4. import "../proxy/utils/Initializable.sol";
  5. // mock class using ERC20
  6. contract ERC20MockUpgradeable is Initializable, ERC20Upgradeable {
  7. function __ERC20Mock_init(
  8. string memory name,
  9. string memory symbol,
  10. address initialAccount,
  11. uint256 initialBalance
  12. ) internal onlyInitializing {
  13. __ERC20_init_unchained(name, symbol);
  14. __ERC20Mock_init_unchained(name, symbol, initialAccount, initialBalance);
  15. }
  16. function __ERC20Mock_init_unchained(
  17. string memory,
  18. string memory,
  19. address initialAccount,
  20. uint256 initialBalance
  21. ) internal onlyInitializing {
  22. _mint(initialAccount, initialBalance);
  23. }
  24. function mint(address account, uint256 amount) public {
  25. _mint(account, amount);
  26. }
  27. function burn(address account, uint256 amount) public {
  28. _burn(account, amount);
  29. }
  30. function transferInternal(
  31. address from,
  32. address to,
  33. uint256 value
  34. ) public {
  35. _transfer(from, to, value);
  36. }
  37. function approveInternal(
  38. address owner,
  39. address spender,
  40. uint256 value
  41. ) public {
  42. _approve(owner, spender, value);
  43. }
  44. /**
  45. * This empty reserved space is put in place to allow future versions to add new
  46. * variables without shifting down storage in the inheritance chain.
  47. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
  48. */
  49. uint256[50] private __gap;
  50. }