The "PuppyRaffle" contract has high gas consumption due to the iteration over the players array in multiple functions. This PoC demonstrates the issue and provides recommendations to reduce gas consumption.
The vulnerability lies in the excessive gas consumption caused by iterating over the players array. This issue is prevalent in functions such as enterRaffle, refund, and _isActivePlayer.
High gas consumption affects the usability of the contract, making it more costly for participants to interact with it. Additionally, it may cause transactions to fail if they exceed the block gas limit. This could make the contract vulnerable to DoS attacks.
VSCode
Foundry
Use Mappings for Player Data: Replace the array with a mapping where player addresses are keys, and their status can be efficiently checked.
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.