Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: low
Valid

wrong getActivePlayerIndex case

Summary

An incorrect player index is being returned, which could lead to unexpected behavior or results. It is crucial to investigate and resolve this issue to ensure the accuracy and integrity of the system's operations.

POC

function testGetIncorrectActivePlayerIndex() public playersEntered {
address invalidPlayer = makeAddr("INVALID_PLAYER");
uint256 playerOneIndex = puppyRaffle.getActivePlayerIndex(playerOne);
uint256 playerTwoIndex = puppyRaffle.getActivePlayerIndex(playerTwo);
uint256 invalidPlayerIndex = puppyRaffle.getActivePlayerIndex(
invalidPlayer
);
assert(playerTwoIndex == 1);
assert(playerOneIndex == invalidPlayerIndex);
}

Tools Used

Foundry

Updates

Lead Judging Commences

Hamiltonite Lead Judge almost 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

getActivePlayerIndex can say a player is both entered at slot 0 and inactive

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.