Created
May 27, 2020 08:07
-
-
Save alexroan/c796d1cd07a37a4c6314d5c92375a53d to your computer and use it in GitHub Desktop.
lottery/submitNumber.sol
This file contains hidden or 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
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