-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathL2ERC20Token.sol
More file actions
37 lines (31 loc) · 911 Bytes
/
L2ERC20Token.sol
File metadata and controls
37 lines (31 loc) · 911 Bytes
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
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "./interfaces/IArbToken.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract L2ERC20Token is ERC20, IArbToken {
address public l2GatewayAddress;
address public override l1Address;
modifier onlyL2Gateway() {
require(msg.sender == l2GatewayAddress, "NOT_GATEWAY");
_;
}
constructor(
address _l2GatewayAddress,
address _l1TokenAddress
) ERC20("L2DummyToken", "L2DT") {
l2GatewayAddress = _l2GatewayAddress;
l1Address = _l1TokenAddress;
}
function bridgeMint(
address _account,
uint256 _amount
) external override onlyL2Gateway {
_mint(_account, _amount);
}
function bridgeBurn(
address _account,
uint256 _amount
) external override onlyL2Gateway {
_burn(_account, _amount);
}
}