Last active
October 24, 2022 18:35
-
-
Save GhostGuy9/0889de2ca589249e4b760f094cfccc16 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: AGPL-3.0-or-later | |
pragma solidity ^0.8.17; // Designate version of solidity | |
import '@openzeppelin/contracts/token/ERC20/ERC20.sol'; // ERC20 template | |
contract GhostCoinToken is ERC20 { // Create contract using ERC20 interface | |
constructor() ERC20('GhostCoin Token', 'GHST') { // Token Name and Ticker | |
_mint(msg.sender, 10000000); // Mint 10000000 tokens at beginning | |
} | |
function mint(address to, uint amount) external { | |
uint256 dayOfWeek = ((block.timestamp / 86400) + 4) % 7; // 0 = Sunday, 1 = Monday, etc | |
require(dayOfWeek != 5); // Require that today is not friday | |
_mint(to, amount); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment