RabbitHole Quest Protocol contest - sayan's results

A protocol to distribute token rewards for completing on-chain tasks.

General Information

Platform: Code4rena

Start Date: 25/01/2023

Pot Size: $36,500 USDC

Total HM: 11

Participants: 173

Period: 5 days

Judge: kirk-baird

Total Solo HM: 1

Id: 208

League: ETH

RabbitHole

Findings Distribution

Researcher Performance

Rank: 112/173

Findings: 1

Award: $17.20

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

1. USE safeTransferOwnership INSTEAD OF transferOwnership

Affected Code: File: QuestFactory.sol line 100,131 Description: transferOwnership function is used to change Ownership from Owned.sol.

Use a 2 structure transferOwnership which is safer. safeTransferOwnership, use it is more secure due to 2-stage ownership transfer.

Recommendation: Use Ownable2Step.sol

2.LOCK PRAGMAS TO SPECIFIC COMPILER VERSION

Affected Code: QuestFactory.sol line 2 RabbitHoleReceipt.sol line 2 RabbitHoleTickets.sol line 2 RecieptRenderer.sol line 2 Quest.sol line 2 IQuest.sol line 2 IQuestFactory.sol line 2
Description: Pragma statements can be allowed to float when a contract is intended for consumption by other developers, as in the case with contracts in a library or EthPM package. Otherwise, the developer would need to manually update the pragma in order to compile locally. https://swcregistry.io/docs/SWC-103

Recommendation: Ethereum Smart Contract Best Practices - Lock pragmas to specific compiler version. solidity-specific/locking-pragmas

3.Long lines are not suitable for the Solidity Style Guide

Affected Code: RabbitHoleReceipt.sol #L158-160, #L192 QuestFactory.sol #L210, #L219 RabbitHoleTickets.sol #L83,#L102 Erc20Quest.sol #L74 Description:It is generally recommended that lines in the source code should not exceed 80-120 characters. Today’s screens are much larger, so in some cases it makes sense to expand that. The lines above should be split when they reach that length, as the files will most likely be on GitHub and GitHub always uses a scrollbar when the length is more than 164 characters.

See why-is-80-characters-the-standard-limit-for-code-width

Recommendation:

Multiline output parameters and return statements should follow the same style recommended for wrapping long lines found in the Maximum Line Length section.

https://docs.soliditylang.org/en/v0.8.17/style-guide.html#introduction

thisFunctionCallIsReallyLong( longArgument1, longArgument2, longArgument3 );

4. Missing Event for critical parameters init and change

Affected Code: Quest.sol#L38-L43 Erc20Quest.sol#L38-L39 Description: Events help non-contract tools to track changes, and events prevent users from being surprised by changes

Recommendation: Add Event-Emit.

#0 - c4-sponsor

2023-02-07T21:50:48Z

waynehoover marked the issue as sponsor acknowledged

#1 - c4-judge

2023-02-14T09:29:38Z

kirk-baird marked the issue as grade-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