Sending an nft to a zero address will revert the selectWinner
function.
In the current implementation of the contract, whenever a player is refunded the player address is replaced with a zero addresss. Now as the players array contains this zero address and if the selectWinner
function selects this zero address as the winner then _safeMint(winner, tokenId);
this line would cause a revert.
The selectWinner
function would revert if the winner is a zero address.
VS code
Move the value of the last index to the refunded address refunded address to the last index and then use the pop method to remove the refunded address instead of setting it to a zero address.
Funds are locked to no one. If someone gets the refund issue, they also got this issue. IMPACT: High Likelihood: High
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.