forked from scroll-tech/scroll-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
L2ERC20Gateway.sol
62 lines (51 loc) · 1.56 KB
/
L2ERC20Gateway.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {IL2ERC20Gateway} from "./IL2ERC20Gateway.sol";
import {ScrollGatewayBase} from "../../libraries/gateway/ScrollGatewayBase.sol";
abstract contract L2ERC20Gateway is ScrollGatewayBase, IL2ERC20Gateway {
/*************
* Variables *
*************/
/// @dev The storage slots for future usage.
uint256[50] private __gap;
/*****************************
* Public Mutating Functions *
*****************************/
/// @inheritdoc IL2ERC20Gateway
function withdrawERC20(
address _token,
uint256 _amount,
uint256 _gasLimit
) external payable override {
_withdraw(_token, _msgSender(), _amount, new bytes(0), _gasLimit);
}
/// @inheritdoc IL2ERC20Gateway
function withdrawERC20(
address _token,
address _to,
uint256 _amount,
uint256 _gasLimit
) external payable override {
_withdraw(_token, _to, _amount, new bytes(0), _gasLimit);
}
/// @inheritdoc IL2ERC20Gateway
function withdrawERC20AndCall(
address _token,
address _to,
uint256 _amount,
bytes calldata _data,
uint256 _gasLimit
) external payable override {
_withdraw(_token, _to, _amount, _data, _gasLimit);
}
/**********************
* Internal Functions *
**********************/
function _withdraw(
address _token,
address _to,
uint256 _amount,
bytes memory _data,
uint256 _gasLimit
) internal virtual;
}