'Trying to create an Ownable and Mintable ERC20 token
I am trying to create an Ownable and Mintable ERC20 token to later sell it with a liquidity pool in pancakeswap, I want to know if this code for the smart contract is enough or if I am missing something.
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.7.0 <0.9.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract Token is ERC20, Ownable {
constructor () ERC20("Try2", "CRL2") Ownable(){
mint(msg.sender, 300 * ( 10 ** uint256(decimals())));
}
function mint(address account, uint256 amount) public onlyOwner {
_mint(account, amount);
}
function burn(address account, uint256 amount) public onlyOwner {
_burn(account, amount);
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
