Created
April 9, 2018 11:48
-
-
Save johngriffin/4cb1118ba0533ec918add9dff1745ddd 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
pragma solidity ^0.4.17; | |
import 'zeppelin-solidity/contracts/token/ERC721/ERC721Token.sol'; | |
import 'zeppelin-solidity/contracts/ownership/Ownable.sol'; | |
contract SubscriptionToken is ERC721Token, Ownable { | |
string public constant name_ = "SubscriptionToken"; | |
string public constant symbol_ = "SUB"; | |
uint256 private constant price = 0.1 ether; | |
function purchaseSubscription() public payable { | |
require(msg.value == price); | |
_mint(msg.sender, totalSupply()); | |
} | |
function hasValidSubscription(address _owner) public returns (bool) { | |
if (balanceOf(_owner) > 1) return true; | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment