Skip to content

Instantly share code, notes, and snippets.

@WojcikMM
Last active Oct 6, 2021
Embed
What would you like to do?
SmartElectrum ERC-20 Token code
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.7.0 <0.9.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
/**
* @title Implementation of ERC20 interface
* @author Michal Wojcik
* @notice This is SmartElectrum project ERC20 token implementation
*/
contract SelectToken is ERC20, Ownable {
/**
* @dev Initializes the contract with correct parameters.
*/
constructor() ERC20("SmartElectrum", "SELECT") {
_mint(msg.sender, 100_000_000 * 10 ** decimals());
}
/**
* @notice Destroy given amount of tokens and reduce the total supply.
* Can be called ONLY by contract OWNER.
* @param amount amount of tokens to destroy
* @dev Emits a {Transfer} event with `to` set to the zero address.
*/
function burnTokens(uint amount) external onlyOwner() {
_burn(msg.sender, amount);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment