-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMod3.sol
More file actions
25 lines (20 loc) · 914 Bytes
/
Mod3.sol
File metadata and controls
25 lines (20 loc) · 914 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts@4.9.0/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts@4.9.0/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts@4.9.0/access/Ownable.sol";
contract myToken is ERC20, ERC20Burnable, Ownable {
constructor(string memory name, string memory symbol, uint256 initialSupply) ERC20(name, symbol) {
_mint(msg.sender, initialSupply);
}
function mint(address account, uint256 amount) public onlyOwner {
_mint(account, amount);
}
function burnFrom(address account, uint256 amount) public override {
_burn(account, amount); // Using _burn directly
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
}