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

ETH Deposit Mechanism Missing in InheritanceManager Contract

Summary

The InheritanceManager contract is intended to facilitate the management and distribution of inherited assets, including ETH, ERC20 tokens, and NFTs. However, a critical flaw exists: the contract lacks any mechanism for the owner to deposit ETH. This limitation prevents the contract from holding or distributing ETH as part of the inheritance process, undermining its core functionality and intended purpose.

Vulnerability Details

The InheritanceManager contract does not include any payable functions, a receive() function, or a fallback() function. As a result, the owner cannot send ETH to the contract, either through a direct transfer or a specific function call. This absence of ETH deposit mechanisms ensures that the contract cannot accumulate ETH for subsequent distribution to beneficiaries.

Impact

The inability to deposit ETH has significant consequences:

  • Functional Limitation: The contract cannot hold ETH, rendering features such as withdrawInheritedFunds ineffective for ETH distribution.

  • Mismatch with Purpose: The contract's stated goal of managing various asset types, including ETH, is unachievable, reducing its overall utility and effectiveness.

  • User Experience: Owners expecting to use the contract to manage all asset types, including ETH, will find it incomplete and unfit for their needs.

Tools Used

Manual Review

Recommendations

To remediate this flaw, the following changes are recommended:

  • Add a Payable Function
    Implement a depositETH() function marked as payable, restricted to the owner, to explicitly allow ETH deposits.

function depositETH() external payable onlyOwner {
// Optional: emit an event or update a state variable to track deposits
}
  • Implement a Receive Function
    Add a receive() function to handle direct ETH transfers to the contract address.

receive() external payable {
// Optional: emit an event or update a state variable to track deposits
}
Updates

Lead Judging Commences

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