Skip to content

Commit

Permalink
feat: require player name in contract
Browse files Browse the repository at this point in the history
  • Loading branch information
rsproule committed Jan 3, 2024
1 parent 6c52279 commit c0d304e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions contracts/src/libraries/Join.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ library JoinLib {
require(players[params.joiner] == 0, "already joined");
require(playersCount < settings.playerCount, "game is full");
require(msg.value >= settings.buyInMinimum, "insufficient buy in");
require(params.playerName.length > 0, "must provide name");
bytes32 leaf = keccak256(bytes.concat(keccak256(abi.encode(params.joiner, params.playerName))));
require(settings.root == bytes32(0) || MerkleProof.verify(params.proof, settings.root, leaf), "invalid proof");
}
Expand Down

0 comments on commit c0d304e

Please sign in to comment.