-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathEqbExternalToken.sol
54 lines (42 loc) · 1.25 KB
/
EqbExternalToken.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
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "./Interfaces/IEqbExternalToken.sol";
contract EqbExternalToken is
IEqbExternalToken,
ERC20Upgradeable,
OwnableUpgradeable
{
address public operator;
// --- Events ---
event OperatorUpdated(address _operator);
modifier onlyOperator() {
require(msg.sender == operator, "!auth");
_;
}
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}
function initialize(
string memory _name,
string memory _symbol,
address _operator
) public initializer {
__Ownable_init();
__ERC20_init_unchained(_name, _symbol);
operator = _operator;
emit OperatorUpdated(_operator);
}
function mint(address _to, uint256 _amount) external override onlyOperator {
_mint(_to, _amount);
}
function burn(
address _from,
uint256 _amount
) external override onlyOperator {
_burn(_from, _amount);
}
}