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

InheritanceManager lacks receive/fallback functions making ETH functionality unusable

Description:

The InheritanceManager contract includes explicit functionality for handling ETH, but does not implement any mechanism to receive ETH, making these features unusable. Specifically, the contract has:

A sendETH() function for the owner to send ETH out of the contract:

function sendETH(uint256 _amount, address payable _to) external nonReentrant onlyOwner {
if (address(this).balance < _amount) {
revert InsufficientBalance();
}
(bool success,) = _to.call{value: _amount}("");
require(success, "ETH transfer failed");
_setDeadline();
}

ETH distribution functionality in withdrawInheritedFunds():

function withdrawInheritedFunds(address _asset) external {
// ...
if (_asset == address(0)) {
uint256 ethAmountAvailable = address(this).balance;
uint256 amountPerBeneficiary = ethAmountAvailable / divisor;
for (uint256 i = 0; i < divisor; i++) {
address payable beneficiary = payable(beneficiaries[i]);
(bool success,) = beneficiary.call{value: amountPerBeneficiary}("");
require(success, "something went wrong");
}
}
// ...
}

However, the contract does not include any of the following mechanisms that would allow it to receive ETH:

  • No receive() function

  • No fallback() function

  • No functions marked as payable

Without these mechanisms, it is impossible for the contract to receive ETH through normal transactions, making the ETH handling functionality effectively useless.

Impact:

A central purpose of this contract appears to be the management and inheritance of ETH, which is unusable as designed. The contract suggests to users it can handle ETH inheritance through its functions, but this functionality is inaccessible.

Recommended Mitigation:

Add a receive() function to the contract to allow it to receive ETH

Updates

Lead Judging Commences

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