Skip to content

Instantly share code, notes, and snippets.

@bitcoinbrisbane
Created March 29, 2019 00:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bitcoinbrisbane/6f2c8befdb7fdc764746e2ec7bda0fe1 to your computer and use it in GitHub Desktop.
Save bitcoinbrisbane/6f2c8befdb7fdc764746e2ec7bda0fe1 to your computer and use it in GitHub Desktop.
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