Created
March 29, 2019 00:33
-
-
Save bitcoinbrisbane/6f2c8befdb7fdc764746e2ec7bda0fe1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
pragma solidity ^0.5.2; | |
contract TheTimes { | |
uint256 public TotalSupply; | |
uint256 public MaxSupply = 21000; | |
uint256 public Price; | |
address[] public Hodlers; | |
constructor() public { | |
Price = 1000 finney; | |
TotalSupply = 0; | |
} | |
function buy() public payable returns (uint256) { | |
require(msg.value == Price, "Incorrect price"); | |
require(TotalSupply < MaxSupply, "All sold out"); | |
Hodlers.push(msg.sender); | |
TotalSupply += 1; | |
Price += 1000 finney; | |
return Hodlers.length; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment