Category: Coding Mistakes
Unused InstantiationEvent
event
Informational Impact
Informational Severity
N/A Likelihood
Description
#[derive(ScryptoSbor, ScryptoEvent)]
pub struct InstantiationEvent {
pub local_domain: u32,
}
In mailbox.rs, an InstantiationEvent
is defined to be emitted when the Mailbox
component is instantiated. However, in the current version of the code, this event is not emitted within the instantiate
function.
Impact
Leaving unused events in the codebase reduces maintainability and may potentially lead to confusion for off-chain systems that expect the event.
Recommendations
Either remove the InstantiationEvent
, or ensure that it is emitted within the instantiate
function.
Remediation
This issue has been acknowledged by Hyperlane, and a fix was implemented in commit 4f989776↗.