ERC20FlashMintMock.sol 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.0;
  3. import "../token/ERC20/extensions/ERC20FlashMint.sol";
  4. contract ERC20FlashMintMock is ERC20FlashMint {
  5. uint256 _flashFeeAmount;
  6. address _flashFeeReceiverAddress;
  7. constructor(
  8. string memory name,
  9. string memory symbol,
  10. address initialAccount,
  11. uint256 initialBalance
  12. ) ERC20(name, symbol) {
  13. _mint(initialAccount, initialBalance);
  14. }
  15. function mint(address account, uint256 amount) public {
  16. _mint(account, amount);
  17. }
  18. function setFlashFee(uint256 amount) public {
  19. _flashFeeAmount = amount;
  20. }
  21. function flashFee(address token, uint256 amount) public view virtual override returns (uint256) {
  22. super.flashFee(token, amount);
  23. return _flashFeeAmount;
  24. }
  25. function setFlashFeeReceiver(address receiver) public {
  26. _flashFeeReceiverAddress = receiver;
  27. }
  28. function flashFeeReceiver() public view returns (address) {
  29. return _flashFeeReceiver();
  30. }
  31. function _flashFeeReceiver() internal view override returns (address) {
  32. return _flashFeeReceiverAddress;
  33. }
  34. }