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

Missing receive or fallback functions prevents ether compatibility

Summary

The InheritanceManager contract is intended to be compatible with Ether and all ERC20 tokens, as stated in the ReadMe. However, the contract does not include a payable receive or fallback function, which are required to handle direct Ether transfers. Without these functions, any attempt to send Ether to the contract will result in a revert, breaking compatibility with Ether.

Vulnerability Details

POC

Place the test below in ./test/InheritanceManagerTest.t.sol file:

function test_no_ether_compatibility() external {
address payer = makeAddr("PAYER");
vm.deal(payer, 3 ether);
vm.prank(payer);
vm.expectRevert(); // Ether donation reverts
address(im).call{value: 2 ether}("");
assertEq(address(im).balance, 0);
}

Impact

The contract fails to meet its stated compatibility with Ether, limiting its functionality and usability.

Tools Used

  • Manual Review

  • Foundry

Recommendations

Add payable receive() and fallback() functions. fallback() for backward compatibility.

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.