-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCitadelToken.sol
47 lines (40 loc) · 1.28 KB
/
CitadelToken.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
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {ERC20Upgradeable} from "openzeppelin-contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "./lib/GlobalAccessControlManaged.sol";
contract CitadelToken is GlobalAccessControlManaged, ERC20Upgradeable {
bytes32 public constant CITADEL_MINTER_ROLE =
keccak256("CITADEL_MINTER_ROLE");
/// =======================
/// ===== Initializer =====
/// =======================
/**
* @notice Initializer
* @param _name Token name
* @param _symbol Token symbol
* @param _gac Global access control to allow permissioned calls by role
*/
function initialize(
string memory _name,
string memory _symbol,
address _gac
) public initializer {
__ERC20_init(_name, _symbol);
__GlobalAccessControlManaged_init(_gac);
}
/// ==========================
/// ===== Minter actions =====
/// ==========================
/**
* @dev Mints new tokens.
* @param dest The address to mint the new tokens to.
* @param amount The quantity of tokens to mint.
*/
function mint(address dest, uint256 amount)
external
onlyRole(CITADEL_MINTER_ROLE)
gacPausable
{
_mint(dest, amount);
}
}