Skip to content

Instantly share code, notes, and snippets.

@franz101
Created April 7, 2022 12:49
Show Gist options
  • Save franz101/872af426560a3afe6d79bed18a19b0d2 to your computer and use it in GitHub Desktop.
Save franz101/872af426560a3afe6d79bed18a19b0d2 to your computer and use it in GitHub Desktop.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.5.0/contracts/token/ERC20/ERC20.sol";
contract NivCoin is ERC20 {
constructor(string memory name, string memory symbol, uint256 amount ) ERC20(name, symbol) {
// Mint 100 tokens to msg.sender
// Similar to how
// 1 dollar = 100 cents
// 1 token = 1 * (10 ** decimals)
_mint(msg.sender, amount);
}
function praiseNiv() public view virtual returns (string memory) {
return "Niv is the best";
}
function decimals() public view virtual override returns (uint8) {
return 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment