-
Notifications
You must be signed in to change notification settings - Fork 4
/
MOHToken.sol
44 lines (33 loc) · 1.14 KB
/
MOHToken.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
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
contract MOHToken is ERC20Burnable, Ownable {
using EnumerableSet for EnumerableSet.AddressSet;
EnumerableSet.AddressSet private minters;
constructor(
string memory _name,
string memory _symbol,
address _fundAddress,
uint256 _mintAmount
) ERC20(_name, _symbol) {
_mint(_fundAddress, _mintAmount * (10**decimals()));
}
function addMinter(address _minter) external onlyOwner {
minters.add(_minter);
}
function deletedMinter(address _minter) external onlyOwner {
minters.remove(_minter);
}
function isMinter(address _minter) public view returns (bool){
return minters.contains(_minter);
}
modifier onlyMinter() {
require(isMinter(_msgSender()), "not minter");
_;
}
function mint(address account, uint256 amount) external onlyMinter {
_mint(account, amount);
}
}