diff --git a/hardhat/contracts/ERC20Votes.sol b/hardhat/contracts/ERC20Votes.sol index f6d5e10..f085f12 100644 --- a/hardhat/contracts/ERC20Votes.sol +++ b/hardhat/contracts/ERC20Votes.sol @@ -1,15 +1,15 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.7.0 <0.9.0; +// SPDX-License-Identifier: GPL-3.0 +pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; -import "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol"; -import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol"; -contract MyToken is ERC20, AccessControl, ERC20Permit, ERC20Votes { +contract LotteryToken is ERC20, ERC20Burnable, AccessControl { bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); - constructor() ERC20("MyToken", "MTK") ERC20Permit("MyToken") { + constructor(string memory name, string memory symbol) ERC20(name, symbol) { + // constructor() ERC20("MyToken", "TKN") { _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); _grantRole(MINTER_ROLE, msg.sender); } @@ -17,27 +17,4 @@ contract MyToken is ERC20, AccessControl, ERC20Permit, ERC20Votes { function mint(address to, uint256 amount) public onlyRole(MINTER_ROLE) { _mint(to, amount); } - - // The following functions are overrides required by Solidity. - - 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); - } }