Description
The TwentyOne::startGame function in L::95 allows the players to send more than 1 ether to start the game, but the contract doesn't implement a refund process when extra ETH is sent.
Impact
Players by confusion or mistake may send more than 1 ETH when calling the TwentyOne::startGame function, causing the loss of this extra ETH since the contract doesn't have a refund logic. This would happen either if the player wins or losses the game, the excess ETH is never sent back.
Proof of Concepts
Add the following test in TwentyOne.t.sol.
Recommended mitigation
Restrict the msg.value to be equal to 1 ether or add a refund logic inside the TwentyOne::engGame function once the player had won or lost.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.