IERC777Sender.sol 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. pragma solidity ^0.5.0;
  2. /**
  3. * @dev Interface of the ERC777TokensSender standard as defined in the EIP.
  4. *
  5. * {IERC777} Token holders can be notified of operations performed on their
  6. * tokens by having a contract implement this interface (contract holders can be
  7. * their own implementer) and registering it on the
  8. * https://eips.ethereum.org/EIPS/eip-1820[ERC1820 global registry].
  9. *
  10. * See {IERC1820Registry} and {ERC1820Implementer}.
  11. */
  12. interface IERC777Sender {
  13. /**
  14. * @dev Called by an {IERC777} token contract whenever a registered holder's
  15. * (`from`) tokens are about to be moved or destroyed. The type of operation
  16. * is conveyed by `to` being the zero address or not.
  17. *
  18. * This call occurs _before_ the token contract's state is updated, so
  19. * {IERC777-balanceOf}, etc., can be used to query the pre-operation state.
  20. *
  21. * This function may revert to prevent the operation from being executed.
  22. */
  23. function tokensToSend(
  24. address operator,
  25. address from,
  26. address to,
  27. uint256 amount,
  28. bytes calldata userData,
  29. bytes calldata operatorData
  30. ) external;
  31. }