According to the natspec of updateReferrerInfo()
the function is not supposed to be called by the referrer
, so it means the person referred has to call it and save the referral information for their corresponding address.
However this is not how the code is saving the information!
Code snippet:
https://github.com/Cyfrin/2024-08-tadle/blob/main/src/core/SystemConfig.sol#L69-L72
The fact that referralinformation needs to be saved for message sender, can further be concluded from the fact that
in PreMarkets::createTaker()
we have
The user who was referred and had been given authorityRate
by the referrer will not be able to take advantage of it to earn back referral fees.
As the ReferralInfo memory referralInfo = systemConfig.getReferralInfo(msgSender)
will most likely return empty struct, the referral address will be 0, thus the platform fee will not be refunded to the user or the referrer
in _updateReferralBonus we have
Valid high severity. There are two impacts here due to the wrong setting of the `refferalInfoMap` mapping. 1. Wrong refferal info is always set, so the refferal will always be delegated to the refferer address instead of the caller 2. Anybody can arbitrarily change the referrer and referrer rate of any user, resulting in gaming of the refferal system I prefer #1500 description the most, be cause it seems to be the only issue although without a poc to fully describe all of the possible impacts
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.