// SPDX-License-Identifier: MIT pragma solidity ^0.8.19; import "@openzeppelin/contracts@4.9.3/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts@4.9.3/token/ERC20/extensions/ERC20Burnable.sol"; import "@openzeppelin/contracts@4.9.3/token/ERC20/extensions/ERC20Pausable.sol"; import "@openzeppelin/contracts@4.9.3/access/AccessControl.sol"; import "@openzeppelin/contracts@4.9.3/token/ERC20/extensions/ERC20Votes.sol"; import "@openzeppelin/contracts@4.9.3/token/ERC20/extensions/draft-ERC20Permit.sol"; contract TravelNetworkWorldToken is ERC20, ERC20Burnable, ERC20Pausable, AccessControl, ERC20Permit, ERC20Votes { bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE"); uint256 private constant TOTAL_SUPPLY = 100_000_000 * 10 ** 18; address private constant OWNER_ADDRESS = 0x5bD25Ea6e56b3C1a39Fc00d2cC344B9d3a6C4FB1; constructor() ERC20("TravelNetworkWorldToken", "TNWT") ERC20Permit("TravelNetworkWorldToken") { _setupRole(DEFAULT_ADMIN_ROLE, OWNER_ADDRESS); _setupRole(ADMIN_ROLE, OWNER_ADDRESS); _mint(address(this), TOTAL_SUPPLY); _allocateTokens(); } function _allocateTokens() internal { _transfer(address(this), OWNER_ADDRESS, 20_000_000 * 10 ** 18); _transfer(address(this), OWNER_ADDRESS, 5_000_000 * 10 ** 18); _transfer(address(this), OWNER_ADDRESS, 15_000_000 * 10 ** 18); _transfer(address(this), OWNER_ADDRESS, 20_000_000 * 10 ** 18); _transfer(address(this), OWNER_ADDRESS, 25_000_000 * 10 ** 18); _transfer(address(this), OWNER_ADDRESS, 10_000_000 * 10 ** 18); _transfer(address(this), OWNER_ADDRESS, 5_000_000 * 10 ** 18); } function pause() public onlyRole(ADMIN_ROLE) { _pause(); } function unpause() public onlyRole(ADMIN_ROLE) { _unpause(); } function mint(address to, uint256 amount) public onlyRole(ADMIN_ROLE) { _mint(to, amount); } function _beforeTokenTransfer(address from, address to, uint256 amount) internal override(ERC20, ERC20Pausable) { super._beforeTokenTransfer(from, to, amount); } function _afterTokenTransfer(address from, address to, uint256 amount) internal override(ERC20, ERC20Votes) { super._afterTokenTransfer(from, to, amount); } function _mint(address to, uint256 amount) internal override(ERC20, ERC20Votes) { super._mint(to, amount); } function _burn(address account, uint256 amount) internal override(ERC20, ERC20Votes) { super._burn(account, amount); } }