Wenwin contest - fatherOfBlocks's results

The next generation of chance-based gaming.

General Information

Platform: Code4rena

Start Date: 06/03/2023

Pot Size: $36,500 USDC

Total HM: 8

Participants: 93

Period: 3 days

Judge: cccz

Total Solo HM: 3

Id: 218

League: ETH

Wenwin

Findings Distribution

Researcher Performance

Rank: 53/93

Findings: 1

Award: $21.70

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

21.7018 USDC - $21.70

Labels

bug
grade-b
QA (Quality Assurance)
sponsor disputed
Q-50

External Links

src/interfaces/ILotterySetup.sol

  • L6 - ITicket is imported, but it is never used, therefore it should be removed.

src/interfaces/IReferralSystem.sol

  • L5 - ILotteryToken is imported, but it is never used, so it should be removed.

src/interfaces/IReferralSystemDynamic.sol

  • L30 - The IReferralSystemDynamic interface is never used by any contract, therefore it should be removed.

  • L24 - The MinimumReferralsRequirement struct is never used by any contract, therefore it should be removed.

  • L6/9/14 - The errors created are never used by any contract, therefore they should be eliminated. Same as the ReferralRequirementFactorType enum.

src/LotterySetup.sol

  • L10 - Ticket is imported, but it is never used, therefore it should be deleted.

src/Lottery.sol

  • L6 - Math is imported, but never used, so it should be removed.

src/LotteryMath.sol

  • L84 - A division is performed by the operation (ticketsSold * expectedPayout) and it is validated that ticketsSold > 0, but it is not validated that expectedPayout > 0. So if expectedPayout == 0, that would raise an unhandled exception. This should be checked and the exception handled.

src/staking/Staking.sol

  • The path src/staking/Staking.sol is somewhat confusing, since staking/staking remains, therefore the staking folder should have another name that contains the staking.sol inside.

  • L67/73 - In the stake() function a stakingToken transfer is made, but the check effect interact pattern is not respected. It would be advisable to follow this pattern.

src/staking/StakedTokenLock.sol

  • L3 - Pragma float This contracts in scope are floating the pragma version.

src/LotteryToken.sol

  • L7 - LotteryMath is imported, but it is never used, so it should be removed.

src/VRFv2RNSource.sol

  • L3 - Pragma float This contracts in scope are floating the pragma version.

#0 - thereksfour

2023-03-12T12:42:14Z

DOWN: 2 L

#1 - c4-judge

2023-03-12T12:42:17Z

thereksfour marked the issue as grade-b

#2 - c4-sponsor

2023-03-14T11:37:25Z

0xluckydev marked the issue as sponsor disputed

#3 - 0xluckydev

2023-03-14T11:37:31Z

Irrelevant

#4 - thereksfour

2023-03-17T13:00:15Z

2L B

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter