From c0d304ea1214e39289b4a2b8a016b588ed61e274 Mon Sep 17 00:00:00 2001 From: rsproule Date: Tue, 2 Jan 2024 22:07:55 -0500 Subject: [PATCH] feat: require player name in contract --- contracts/src/libraries/Join.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/contracts/src/libraries/Join.sol b/contracts/src/libraries/Join.sol index bc5d94e..dae6c84 100644 --- a/contracts/src/libraries/Join.sol +++ b/contracts/src/libraries/Join.sol @@ -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"); }