Incorrect function modifier used leading to incorrect return data
This function is marked as pure
, but it's actually reading from storage. Here are the issues:
pure
Function Modifier: The pure
modifier is used for functions that don't read from or modify the contract's state. However, this function is clearly reading from storage by calling Referral.load(user)
.
Inconsistency with Storage Access: The Referral.load(user)
function is accessing storage to retrieve the referral data for the given user. This operation cannot be performed in a pure
function.
Potential for Misleading Behavior: Because the function is marked as pure
, it will compile and deploy without errors, but it won't actually return the correct data. Instead, it will likely return default values (empty bytes for referralCode
and false
for isCustomReferralCode
) regardless of the actual stored data.
The function is marked as pure
, it will compile and deploy without errors, but it won't actually return the correct data. Instead, it will likely return default values (empty bytes for referralCode
and false
for isCustomReferralCode
) regardless of the actual stored data.
Manual Review
Change the function modifier from pure to view
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.