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

Lack of receive() Function Prevents Ether Deposits

Summary

The InheritanceManager contract lacks a receive() function, preventing it from accepting native Ether deposits. Consequently, the sendETH() functionality becomes unusable as the contract cannot hold Ether. This limits the contract's utility to managing only ERC20 tokens.

Vulnerability Details

The absence of a receive() function in the InheritanceManager contract means that any attempt to send Ether directly to the contract address will revert. This is demonstrated by the following Foundry test:

function test_canNotReceiveEther() public {
vm.deal(user1, 10 ether);
vm.prank(user1);
vm.expectRevert();
(bool success,) = payable(address(im)).call{value: 1 ether}("");
}

Impact

The contract's inability to receive Ether renders the sendETH() function ineffective. This significantly restricts the contract's functionality, limiting its ability to manage and distribute Ether as part of the inheritance process. Users can only utilize the contract for managing ERC20 tokens, which reduces its overall utility and deviates from its potential scope.

Tools Used

Manual review and foundry test

Recommendations

Implement a receive() function within the InheritanceManager contract to enable it to receive Ether.

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.