The function enterRaffle() takes array of address as players to enter the raffle with as many address as he can since the logic checks for entering with atleast 4 and can go up to maximum which has a logic to check for duplicate address as,
This logic compares an address inside the array with each address inside it which is an gas intensive process and if an attacker enter the raffle with maximum number of address, the contract will run out of gas leads to denial of service.
This logic which checks for duplicate is inefficient, since it will take more gas as the size of the array increases which cause the contract to denial of service.
Let's say an attacker enters with 50 elements and the logic will compare 0 with each element up to 49 which cause denial of service.
foundry
The efficient way of checking duplicates would be,
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.