From 60e06014f9d74eb4122c3f25052bbf4f654fae86 Mon Sep 17 00:00:00 2001 From: anoopghlot <129213044+anoopghlot@users.noreply.github.com> Date: Sat, 1 Apr 2023 02:48:58 +0530 Subject: [PATCH] Create solution-2.md --- solution-2.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 solution-2.md diff --git a/solution-2.md b/solution-2.md new file mode 100644 index 00000000..bdba1783 --- /dev/null +++ b/solution-2.md @@ -0,0 +1,30 @@ +// 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/ERC20Snapshot.sol"; +import "@openzeppelin/contracts@4.8.2/access/Ownable.sol"; +import "@openzeppelin/contracts@4.8.2/token/ERC20/extensions/ERC20FlashMint.sol"; + +contract AnoopGhlot is ERC20, ERC20Snapshot, Ownable, ERC20FlashMint { + constructor() ERC20("anoop ghlot", "ANOOP") { + _mint(msg.sender, 10000 * 10 ** decimals()); + } + + function snapshot() public onlyOwner { + _snapshot(); + } + + function mint(address to, uint256 amount) public onlyOwner { + _mint(to, amount); + } + + // The following functions are overrides required by Solidity. + + function _beforeTokenTransfer(address from, address to, uint256 amount) + internal + override(ERC20, ERC20Snapshot) + { + super._beforeTokenTransfer(from, to, amount); + } +}