Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at
pragma solidity ^0.4.0;
contract Commitment {
enum CommitmentState { OPEN, CLOSED }
mapping (address => bool) attendeesRegistered;
mapping (address => bool) attendeesRefunded;
uint totalDeposited;
uint totalGuests;
uint public depositAmount;
CommitmentState public currentState;
function Commitment(uint _depositAmount) {
depositAmount = _depositAmount;
currentState = CommitmentState.OPEN;
function addAttendee() payable {
require(msg.value >= depositAmount);
require(currentState == CommitmentState.OPEN);
totalDeposited += msg.value;
totalGuests += 1;
attendeesRegistered[msg.sender] = true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment