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

Missing receive() and fallback() Functions in InheritanceManager

Summary

The InheritanceManager contract lacks both receive() and fallback() functions, preventing direct ETH transfers to the contract. This limitation creates a critical inconsistency with the contract's functionality, as several methods assume the contract can hold and distribute ETH.

Vulnerability Details

The InheritanceManager contract includes functions that explicitly handle ETH stored within the contract:

  1. sendETH() - Sends ETH from the contract to a specified address

  2. withdrawInheritedFunds(address(0)) - Distributes ETH equally to beneficiaries

Impact

When attempting to send ETH directly to the contract (e.g., via address(inheritanceManager).transfer(amount) or payable(address(inheritanceManager)).call{value: amount}("")), the transaction will revert.

The only viable way to add ETH to the contract is through the contractInteractions() function with a _value parameter, which is unnecessarily complicated for basic ETH deposits.

  1. Functionality Failure: The contract cannot fulfill its core purpose of distributing ETH to beneficiaries if it cannot receive ETH in the first place.

  2. Inconsistent UX: Users expect to be able to fund the contract directly, as implied by the existence of sendETH() and withdrawInheritedFunds(address(0)).

  3. Contract Integration Issues: Other contracts or applications that attempt to send ETH to this contract will fail.

Tools Used

In major audit frameworks:

  • Consensys Diligence: Would classify this as "High" as it's a "flaw that directly impacts a core function"

  • Trail of Bits: Would categorize as "High" as it "prevents the contract from functioning as intended"

Recommendations

add the missing functions

// Missing functions:
receive() external payable {}
fallback() external payable {}
Updates

Lead Judging Commences

0xtimefliez Lead Judge 9 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.

Give us feedback!