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
Rank: 81/173
Findings: 2
Award: $24.25
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: RaymondFam
Also found by: 0xMirce, AkshaySrivastav, AlexCzm, Aymen0909, BClabs, CodingNameKiki, ElKu, HollaDieWaldfee, Josiah, KIntern_NA, MiniGlome, StErMi, adriro, bin2chen, cccz, chaduke, csanuragjain, gzeon, hihen, holme, libratus, minhquanym, omis, peakbolt, peanuts, rbserver, rvierdiiev, timongty, ubermensch, usmannk, wait, zaskoh
7.046 USDC - $7.05
https://github.com/rabbitholegg/quest-protocol/blob/8c4c1f71221570b14a0479c216583342bd652d8d/contracts/Quest.sol#L150 https://github.com/rabbitholegg/quest-protocol/blob/8c4c1f71221570b14a0479c216583342bd652d8d/contracts/Quest.sol#L57-L59 https://github.com/rabbitholegg/quest-protocol/blob/8c4c1f71221570b14a0479c216583342bd652d8d/contracts/Quest.sol#L96-L118
Quest owner could take all the rewards for himself even if users successfully finished the quest and received the RHReceipt.
function start() public virtual onlyOwner { isPaused = false; hasStarted = true; }
modifier onlyQuestActive() { if (!hasStarted) revert NotStarted(); if (block.timestamp < startTime) revert ClaimWindowNotStarted(); _; }
function pause() public onlyOwner onlyStarted { isPaused = true; }
if (isPaused) revert QuestPaused();
function withdrawRemainingTokens(address to_) public virtual onlyOwner onlyAdminWithdrawAfterEnd {}
Manual review
Dissalow contract pausing or set startTime to when contract is deployed, so that users can imidiatelly claim their rewards.
#0 - c4-judge
2023-02-06T08:59:39Z
kirk-baird marked the issue as duplicate of #42
#1 - c4-judge
2023-02-10T05:03:11Z
kirk-baird changed the severity to QA (Quality Assurance)
#2 - c4-judge
2023-02-10T05:12:15Z
This previously downgraded issue has been upgraded by kirk-baird
#3 - c4-judge
2023-02-14T09:27:50Z
kirk-baird marked the issue as satisfactory
#4 - c4-judge
2023-02-23T23:49:21Z
kirk-baird changed the severity to 2 (Med Risk)
🌟 Selected for report: CodingNameKiki
Also found by: 0x1f8b, 0x4non, 0x5rings, 0xAgro, 0xMirce, 0xRobocop, 0xSmartContract, 0xackermann, AkshaySrivastav, ArmedGoose, Aymen0909, BClabs, Breeje, Dewaxindo, Diana, HollaDieWaldfee, IceBear, IllIllI, Iurii3, Josiah, Krayt, PaludoX0, Phenomana, PrasadLak, RaymondFam, Rolezn, SaeedAlipoor01988, SaharDevep, SleepingBugs, adriro, arialblack14, bin2chen, brevis, btk, carlitox477, carrotsmuggler, catellatech, chaduke, chrisdior4, cryptonue, cryptostellar5, csanuragjain, ddimitrov22, fellows, glcanvas, halden, hl_, horsefacts, jat, joestakey, kenta, libratus, lukris02, luxartvinsec, manikantanynala97, martin, matrix_0wl, nadin, nicobevi, oberon, peanuts, prestoncodes, rbserver, sakshamguruji, sashik_eth, sayan, seeu, thekmj, tnevler, trustindistrust, tsvetanovv, xAriextz, zadaru13, zaskoh
17.196 USDC - $17.20
When setting royaltyFee, there is no limitation for admin to set it to any amount even greater than 10_000 bps, which would result in marketplaces not being able to send royalties.
Since the quest is holding ERC20 or ERC1155 tokens, what could happen is that the project would send out the tokens, which would get stuck in the contract, since there is no function to sweep them.
QuestOwner can only set the reward for ERC1155 quest to be 1 unit.
To mitigate this, do not allow signer changes or use it with caution.
The counter should start with 1, otherwise, it is misleading since the user can assume there has been 1 quest deployed at the beginning.
Texts in SVG are overlapping since y is set to 40% in both lines in generateSVG Should be:
x="50%" y="40%" x="50%" y="50%"
If quest id's string is too long, then the NFT will seem broken. For example "MMMMMMMMMMMMMMMMMMMMM" will overflow. It is difficult to calculate text size since every char has its own size, so monospaced font should be used and limit the text length, so it fits the rect element.
https://github.com/rabbitholegg/quest-protocol/blob/8c4c1f71221570b14a0479c216583342bd652d8d/contracts/ReceiptRenderer.sol#L106 https://github.com/rabbitholegg/quest-protocol/blob/8c4c1f71221570b14a0479c216583342bd652d8d/contracts/TicketRenderer.sol#L22
https://github.com/rabbitholegg/quest-protocol/blob/8c4c1f71221570b14a0479c216583342bd652d8d/contracts/TicketRenderer.sol#L42 https://github.com/rabbitholegg/quest-protocol/blob/8c4c1f71221570b14a0479c216583342bd652d8d/contracts/ReceiptRenderer.sol#L109
This can cause aggregators to show false data since they could assume that an NFT exists even if it hasn't been minted yet.
#0 - c4-judge
2023-02-06T09:08:25Z
kirk-baird marked the issue as grade-a
#1 - kirk-baird
2023-02-06T09:08:55Z
Note 12. is a valid high issue however it has not been described in sufficient detail to justify the duplication.
#2 - c4-sponsor
2023-02-07T23:20:19Z
waynehoover marked the issue as sponsor confirmed
#3 - c4-judge
2023-02-21T07:16:26Z
kirk-baird marked the issue as grade-b