Skip to content

Instantly share code, notes, and snippets.

@yurenju
Last active May 3, 2018 23:10
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 yurenju/8598564c516facd734834a51df3fc191 to your computer and use it in GitHub Desktop.
Save yurenju/8598564c516facd734834a51df3fc191 to your computer and use it in GitHub Desktop.
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