The address of a contract which is an initial caller of PoolManager::unlock is specified as a buyer and seller in the ReFiSwapRebateHook::ReFiBought and ReFiSwapRebateHook::ReFiSold events. However, the intended addresses should be the addresses of users that call swap on that contract.
Likelihood:
The issue occurs every swap because beforeSwap hook is called every swap.
Impact:
Wrong data is stored in logs. The events are useless since the seller's and buyer's addresses are equal and are an address of a contract.
As written in IHooks natspec, the sender is the initial msg.sender for the swap call and it is a contract since it should implement unlockCallback.
It should be implemented a way to retreive a user's address from a contract that calls swap. For instance, some getMsgSender() function may be implemented and this function may be called from ReFiSwapRebateHook to get the user which bought or sold tokens.
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.