In blackjack 21 is the highest score. in the hit
function we check for the hand as it is when the player calls the function. However, there is an unnecessary check for the score on the handBefore
https://github.com/Cyfrin/2024-11-TwentyOne/blob/a4429168302722d14a5e5996d25d6fc5be22a899/src/TwentyOne.sol#L110
The function checks to see if the score, as it stands, is up to 21 including. Which is true in the rules of the game. However, if it is indeed 21, any other card will make the player lose. Which means the check is right to check if the score is under 21, but if it is 21 the player lost already and can revert.
Manual Analysis
Change the check to less than:
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.