BriVault

First Flight #52
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Impact: low
Likelihood: low
Invalid

Missing getter function for usersAddress array length

Root + Impact

Description

The usersAddress array stores all participants who called joinEvent() and is used in _getWinnerShares() to calculate total winner shares. However, there's no external function to query the array's length, making it difficult for external contracts, frontends, or tests to determine the number of participants.

Risks:

  • Lack of Transparency: External contracts and users cannot determine how many participants joined without trial-and-error or off-chain tracking

  • Testing Difficulty: As you discovered, it makes testing harder and requires modifying the contract to verify behavior

  • Integration Issues: Any external contract trying to interact with BriVault (e.g., a frontend, analytics contract, or aggregator) cannot easily query participant count

Recommended Mitigation:

we should include this function inside the contract to ensure simplicity of testing and to determine the number of participants.

function getUsersAddressLength() external view returns (uint256) {
return usersAddress.length;
}
Updates

Appeal created

bube Lead Judge 19 days ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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

Give us feedback!