draft-IERC7802.sol 1.5 KB

12345678910111213141516171819202122232425262728293031
  1. // SPDX-License-Identifier: MIT
  2. // OpenZeppelin Contracts (last updated v5.4.0-rc.0) (interfaces/draft-IERC7802.sol)
  3. pragma solidity >=0.6.2;
  4. import {IERC165} from "./IERC165.sol";
  5. /// @title IERC7802
  6. /// @notice Defines the interface for crosschain ERC20 transfers.
  7. interface IERC7802 is IERC165 {
  8. /// @notice Emitted when a crosschain transfer mints tokens.
  9. /// @param to Address of the account tokens are being minted for.
  10. /// @param amount Amount of tokens minted.
  11. /// @param sender Address of the caller (msg.sender) who invoked crosschainMint.
  12. event CrosschainMint(address indexed to, uint256 amount, address indexed sender);
  13. /// @notice Emitted when a crosschain transfer burns tokens.
  14. /// @param from Address of the account tokens are being burned from.
  15. /// @param amount Amount of tokens burned.
  16. /// @param sender Address of the caller (msg.sender) who invoked crosschainBurn.
  17. event CrosschainBurn(address indexed from, uint256 amount, address indexed sender);
  18. /// @notice Mint tokens through a crosschain transfer.
  19. /// @param _to Address to mint tokens to.
  20. /// @param _amount Amount of tokens to mint.
  21. function crosschainMint(address _to, uint256 _amount) external;
  22. /// @notice Burn tokens through a crosschain transfer.
  23. /// @param _from Address to burn tokens from.
  24. /// @param _amount Amount of tokens to burn.
  25. function crosschainBurn(address _from, uint256 _amount) external;
  26. }