Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: high
Invalid

Player's array prevents scalability

Summary

In the code base we use an array to manage all players.
This will become a problem over time as we increase the amount of players.

Vulnerability Details

Using an array to store all players is not the viable option in the sense of scalability.
If a lot of people participate in the raffle, the usage of a array will become

Impact

High because it could lead to a denial of service.
It could potentially be elevated to a critical severity finding due to the nature of the bug.
When a lot of players enter the raffle the gas cost could become so high that it would be unsustainable to run this raffle.

Tools Used

Vs Code
Foundry

Recommendations

To prevent these kind of problems is it recommended to use a off-chain solution like a database to store data like players.
You should always aim to only store the most necessary information on the blockchain as it could become very costly to store a lot of data on the blockchain.
The blockchain should only store the logic needed to run the contract and not user data in any shape or form when possible

Updates

Lead Judging Commences

Hamiltonite Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: User experience and design improvement
Assigned finding tags:

weak-randomness

Root cause: bad RNG Impact: manipulate winner

Support

FAQs

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