/
IScrollERC20.sol
38 lines (31 loc) · 1.54 KB
/
IScrollERC20.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC20Permit} from "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol";
// The recommended ERC20 implementation for bridge token.
// deployed in L2 when original token is on L1
// deployed in L1 when original token is on L2
interface IScrollERC20 is IERC20, IERC20Permit {
/// @notice Return the address of Gateway the token belongs to.
function gateway() external view returns (address);
/// @notice Return the address of counterpart token.
function counterpart() external view returns (address);
/// @dev ERC677 Standard, see https://github.com/ethereum/EIPs/issues/677
/// Defi can use this method to transfer L1/L2 token to L2/L1,
/// and deposit to L2/L1 contract in one transaction
function transferAndCall(
address receiver,
uint256 amount,
bytes calldata data
) external returns (bool success);
/// @notice Mint some token to recipient's account.
/// @dev Gateway Utilities, only gateway contract can call
/// @param _to The address of recipient.
/// @param _amount The amount of token to mint.
function mint(address _to, uint256 _amount) external;
/// @notice Mint some token from account.
/// @dev Gateway Utilities, only gateway contract can call
/// @param _from The address of account to burn token.
/// @param _amount The amount of token to mint.
function burn(address _from, uint256 _amount) external;
}