The normal behavior of _getWinnerShares() is to calculate the total shares held by all participants who selected the winning country.
However, the current implementation does not reset totalWinnerShares before summing, which causes the value to accumulate repeatedly on multiple calls instead of reflecting the true total of winner shares.
This results in incorrect payout calculations during withdrawals since the contract will believe there are more winning shares than actually exist.
Likelihood:
Very likely — _getWinnerShares() is called from setWinner(), but it can also be called again internally or in future code updates.
Any subsequent call after the first will double-count user shares since the state variable totalWinnerShares keeps accumulating without being cleared.
Impact:
Incorrect reward distribution — winners will receive less assets than expected because the denominator (totalWinnerShares) becomes inflated.
Permanent corruption of vault accounting — since totalWinnerShares is a persistent state variable, wrong values will persist across function calls and affect all future reward logic.
Reset totalWinnerShares to zero before summing user shares.
Optionally, mark the function as view and compute totals on-demand if state persistence is not required.
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.