Skip to content

Instantly share code, notes, and snippets.

@alexroan
Created May 27, 2020 08:07
Show Gist options
  • Save alexroan/c796d1cd07a37a4c6314d5c92375a53d to your computer and use it in GitHub Desktop.
Save alexroan/c796d1cd07a37a4c6314d5c92375a53d to your computer and use it in GitHub Desktop.
lottery/submitNumber.sol
function submitNumber(uint _number) public payable isState(LotteryState.Open) {
require(msg.value >= entryFee, "Minimum entry fee required");
require(entries[_number].add(msg.sender), "Cannot submit the same number more than once");
numbers.push(_number);
numberOfEntries++;
payable(owner()).transfer(ownerCut);
emit NewEntry(msg.sender, _number);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment