This repository was archived by the owner on Dec 3, 2025. It is now read-only.
forked from ZTX-Foundation/tuxedo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathToken.sol
More file actions
43 lines (34 loc) · 1.45 KB
/
Token.sol
File metadata and controls
43 lines (34 loc) · 1.45 KB
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
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.18;
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {ERC20Permit} from "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol";
import {ERC20Votes} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol";
// 10 billion (10^10) tokens max supply with 10^18 decimals
uint256 constant MAX_SUPPLY = 10_000_000_000e18;
contract Token is ERC20Permit, ERC20Votes {
constructor(string memory name, string memory symbol) ERC20(name, symbol) ERC20Permit(name) {
_mint(msg.sender, MAX_SUPPLY);
}
function maxSupply() public pure returns (uint256) {
return MAX_SUPPLY;
}
/// required for ERC20Snapshot
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override(ERC20) {
super._beforeTokenTransfer(from, to, amount);
}
/// require for ERC20Votes
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual override(ERC20, ERC20Votes) {
super._afterTokenTransfer(from, to, amount);
_delegate(to, to);
}
function _burn(address account, uint256 amount) internal virtual override(ERC20, ERC20Votes) {
super._burn(account, amount);
}
function _mint(address account, uint256 amount) internal virtual override(ERC20, ERC20Votes) {
super._mint(account, amount);
}
}