Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: high
Valid

[H-4] Missing receive() Function Prevents Direct ETH Transfers to Contract

Summary

The InheritanceManager contract lacks a receive() function, which prevents the owner from sending ETH directly to the contract. This limitation reduces usability.

Vulnerability Details

The contract is designed to handle ETH as part of its inheritance functionality, as evidenced by the sendETH and withdrawInheritedFunds functions that transfer ETH. However, it lacks a receive() or fallback() function that would allow it to accept direct ETH transfers:

// Missing from the contract:
receive() external payable {
// Logic to handle direct ETH transfers
}

Without a receive function:

  1. Direct ETH transfers to the contract will revert

  2. ETH cannot be sent to the contract via .send() or .transfer()

This is particularly problematic for a wallet-like contract meant to store and manage assets as part of an inheritance system.

Impact

This vulnerability impacts usability and interoperability:

  1. Owner or users attempting to send ETH directly to the contract address will have their transactions fail

The severity is high because it renders one of the main purposes of the contract inusable.

Tools Used

Manual code review

Recommended Mitigation

Implement a receive() function to allow the contract to accept direct ETH transfers:

receive() external payable {
}
Updates

Lead Judging Commences

0xtimefliez Lead Judge 4 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Missing receive() or fallback() function

0xtimefliez Lead Judge 4 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Missing receive() or fallback() function

Support

FAQs

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