From 008f10ed851f9bbbb88d429b916cf9ad79038f72 Mon Sep 17 00:00:00 2001 From: MokshuJain <129554434+MokshuJain@users.noreply.github.com> Date: Sat, 1 Apr 2023 02:17:14 +0530 Subject: [PATCH] Create solution-2.md --- solution-2.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 solution-2.md diff --git a/solution-2.md b/solution-2.md new file mode 100644 index 00000000..218b20f7 --- /dev/null +++ b/solution-2.md @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.9; + +import "@openzeppelin/contracts@4.8.2/token/ERC20/ERC20.sol"; +import "@openzeppelin/contracts@4.8.2/token/ERC20/extensions/ERC20Burnable.sol"; +import "@openzeppelin/contracts@4.8.2/access/Ownable.sol"; +import "@openzeppelin/contracts@4.8.2/token/ERC20/extensions/draft-ERC20Permit.sol"; +import "@openzeppelin/contracts@4.8.2/token/ERC20/extensions/ERC20Votes.sol"; +import "@openzeppelin/contracts@4.8.2/token/ERC20/extensions/ERC20FlashMint.sol"; + +contract Mokshuu is ERC20, ERC20Burnable, Ownable, ERC20Permit, ERC20Votes, ERC20FlashMint { + constructor() ERC20("Mokshuu", "MOK") ERC20Permit("Mokshuu") { + _mint(msg.sender, 10000 * 10 ** decimals()); + } + + function mint(address to, uint256 amount) public onlyOwner { + _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); + } +}