Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: low
Invalid

Missing Event Emission for Trustee Appointment

Details:

In the InheritanceManager contract, the appointTrustee(address _trustee) function updates the trustee state variable without emitting any event. Events are crucial for off-chain monitoring and auditing, as they log state changes that external observers or indexing services rely on to track important actions. Without an event, stakeholders may miss or delay detecting the update of the trustee, complicating transparency and accountability.

Root Cause:

The root cause is the absence of event emission in the appointTrustee function. When updating the trustee variable, no logging mechanism (such as an event) is implemented, likely due to an oversight in adhering to best practices for smart contract event logging.

Impact:

While this omission does not directly enable an attacker to exploit the contract or steal funds, it reduces the transparency of state changes. This can lead to difficulties in auditing the contract’s behavior, delayed detection of unauthorized changes, and complications in off-chain analytics or monitoring systems that rely on event logs.

Recommendation:

Introduce an event to log the assignment of a new trustee. This ensures that every change to the trustee state is recorded and can be tracked by auditors and monitoring tools. For example:

event TrusteeAppointed(address indexed newTrustee);
function appointTrustee(address _trustee) external onlyBeneficiaryWithIsInherited {
trustee = _trustee;
emit TrusteeAppointed(_trustee);
}

Adding this event not only improves transparency but also aligns the contract with common best practices for state change notifications.

Proof of Concept:

  1. Deploy the contract and call the appointTrustee function with a new trustee address.

  2. Observe that, without the event, no log is generated.

  3. After implementing the event emission as recommended, calling the function will produce an event log (TrusteeAppointed), which can be verified using transaction logs on a blockchain explorer or via event listeners.

Updates

Lead Judging Commences

0xtimefliez Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
0xtimefliez Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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