diff --git a/solution-2.md b/solution-2.md new file mode 100644 index 00000000..d25a6b8e --- /dev/null +++ b/solution-2.md @@ -0,0 +1,34 @@ +// 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/security/Pausable.sol"; +import "@openzeppelin/contracts@4.8.2/access/Ownable.sol"; +import "@openzeppelin/contracts@4.8.2/token/ERC20/extensions/draft-ERC20Permit.sol"; + +contract Agni is ERC20, ERC20Burnable, Pausable, Ownable, ERC20Permit { + constructor() ERC20("Agni", "AGN") ERC20Permit("Agni") { + _mint(msg.sender, 10000 * 10 ** decimals()); + } + + function pause() public onlyOwner { + _pause(); + } + + function unpause() public onlyOwner { + _unpause(); + } + + function mint(address to, uint256 amount) public onlyOwner { + _mint(to, amount); + } + + function _beforeTokenTransfer(address from, address to, uint256 amount) + internal + whenNotPaused + override + { + super._beforeTokenTransfer(from, to, amount); + } +}