-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathZendToken.sol
31 lines (23 loc) · 1009 Bytes
/
ZendToken.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
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity =0.8.21;
import "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
contract ZendToken is ERC20Upgradeable, Ownable2StepUpgradeable {
uint256 private constant TOTAL_SUPPLY = 100000000e18;
bool private v2_initialized;
function __ZendToken_init(address genesis_holder) public initializer {
__ERC20_init("zkLend Token", "ZEND");
_mint(genesis_holder, TOTAL_SUPPLY);
}
function __ZendToken_upgrade_v2(address initial_owner) public {
require(!v2_initialized, "ZendToken: v2 already initialized");
v2_initialized = true;
_transferOwnership(initial_owner);
}
function mint(address account, uint256 amount) external onlyOwner {
_mint(account, amount);
}
function burn(address account, uint256 amount) external onlyOwner {
_burn(account, amount);
}
}