Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: low
Valid

Wrong data emitted in events of `LoveToken`

Summary

The initVault function in the LoveToken contract emits both the AirdropInitialized and StakingInitialized events with incorrect data. The event data indicates that the parameters passed should be airdropContract and stakingContract, respectively. Still, the function emits both events with the parameter managerContract, resulting in inaccurate event logs.

Vulnerability Details

Both the AirdropInitialized and StakingInitialized events are expected to log the addresses of the corresponding contracts (airdropContract and stakingContract). However, the initVault function incorrectly emits both events with the parameter managerContract, leading to a discrepancy between the event's data and the actual initialized contracts.

Impact

The incorrect event data poses a challenge for developers and external systems relying on event logs, as the information provided does not accurately reflect the initialized contracts. This discrepancy may result in confusion and hinder proper tracking of contract initialization events.

Tools Used

Manual review.

Recommendations

Correct Event Data: Update the initVault function to emit both the AirdropInitialized and StakingInitialized events with the correct parameters, reflecting the addresses of the corresponding contracts (airdropContract and stakingContract).

Updates

Lead Judging Commences

0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-initVault-event-wrong-emit

Low severity, inconsistencies in event emission Sidenote: Separating all event findings given root causes are different with different functions involved. There could be alot of debate on whether wrong emit events consitute low severity, but I believe, - There are direct inconsistencies in the code logic - Codehawks [low severity categorization guidelines](https://docs.codehawks.com/hawks-auditors/how-to-evaluate-a-finding-severity#low-severity-findings) supports its severity as seen below, especially noting the term `Minimal to no impact` > - Minimal to no impact on the funds or the protocol's main functionality.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.