Hunt prep
Before you test Wenwin contest
What 8 disclosed reports say about Wenwin contest: what was found and paid, what was fixed, and where it may be worth looking next.
- with a public bounty
- 0
- median public bounty
- –
- highest public bounty
- –
Gaps worth testing
Not written yet for this program. The numbers below are up to date.
What was found and what it paid
Public bounties only; many reports disclose without the amount.
| Class | Reports | Paid | Median | Highest | In all |
|---|---|---|---|---|---|
| Business logic lesson | 4 | 0 | – | – | $0 |
| DoS lesson | 1 | 0 | – | – | $0 |
| Race condition lesson | 1 | 0 | – | – | $0 |
| Smart contracts lesson | 1 | 0 | – | – | $0 |
What was fixed
All reportsThe newest fixes, in our words. A fixed bug is not worth re-reporting, but a sibling feature, an older API version or a regression may be.
-
LotteryMath.calculateNewProfit returns wrong profit when there is no jackpot winner
Use PercentageMath to apply the multiplier to the total payout instead of multiplying directly.
Disclosed
-
Unsafe casting from uint256 to uint16 could cause ticket prizes to become much smaller than intended
The prize amounts should be stored in a mapping rather than packed with bitwise arithmetic, or the cast should be checked with a safe-cast helper that reverts on overflow.
Disclosed
-
Insolvency: The Lottery may incorrectly consider a year old jackpot ticket as unclaimed and increase currentNetProfit by its prize while it was actually claimed
The claimable function should use a strict less-than comparison for the deadline to prevent the overlap.
Disclosed
-
Undermining the fairness of the protocol in swapSource() and possibilities for stealing a jackpot
The retry() function should use failedAttempts >= maxFailedAttempts instead of strict equality, and the try/catch in requestRandomNumberFromSource() should be refactored.
Disclosed
-
Locking rewards tokens in Staking contract when there are no stakes
The contract should be changed so that rewards sent while total supply is zero are either redirected or made withdrawable, rather than left locked.
Disclosed