Last active
May 3, 2018 23:10
-
-
Save yurenju/8598564c516facd734834a51df3fc191 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; | |
contract MeetupEvent { | |
string public title; | |
uint public limit; | |
uint userAmount; | |
mapping (address => uint256) public attendees; | |
constructor(string _title, uint _limit) public { | |
title = _title; | |
limit = _limit; | |
userAmount = 0; | |
} | |
function register() public { | |
require(userAmount <= limit); | |
userAmount ++; | |
attendees[msg.sender] = userAmount; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment