ERC777Mock.sol 984 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity >=0.6.0 <0.8.0;
  3. import "../utils/Context.sol";
  4. import "../token/ERC777/ERC777.sol";
  5. contract ERC777Mock is Context, ERC777 {
  6. event BeforeTokenTransfer();
  7. constructor(
  8. address initialHolder,
  9. uint256 initialBalance,
  10. string memory name,
  11. string memory symbol,
  12. address[] memory defaultOperators
  13. ) public ERC777(name, symbol, defaultOperators) {
  14. _mint(initialHolder, initialBalance, "", "");
  15. }
  16. function mintInternal (
  17. address to,
  18. uint256 amount,
  19. bytes memory userData,
  20. bytes memory operatorData
  21. ) public {
  22. _mint(to, amount, userData, operatorData);
  23. }
  24. function approveInternal(address holder, address spender, uint256 value) public {
  25. _approve(holder, spender, value);
  26. }
  27. function _beforeTokenTransfer(address, address, address, uint256) internal override {
  28. emit BeforeTokenTransfer();
  29. }
  30. }