[L-4] Duplicate Event Declaration
Description:
The Solidity compiler error indicates that the TransferAdmin event is declared twice with the same name and parameter types in different files: IAdminable.sol and Events.sol. This redundancy causes a compilation failure.
Impact:
The duplicate event declaration can lead to compilation errors, making the contract non-deployable and interrupting the development process.
Proof of Concept:
The error message during compilation:
Recommended Mitigation:
Remove the duplicate event declaration to resolve the compilation issue. Ensure the event is declared only in one appropriate location, typically within the main contract or its interface.
Mitigation Code:
Option 1: Remove the duplicate from IAdminable.sol if it's defined in a common utility file for test purposes:
Corrected Code in IAdminable.sol:
Ensure the event is declared only here if this is the primary contract or interface:
Corrected Code in Events.sol:
Remove the duplicate event declaration if it's redundant:
By ensuring the event is declared only once in the appropriate file, the compilation error will be resolved, allowing the project to build and deploy successfully.
https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity
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.