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

removeBeneficiary() is not considered an owner interaction, so the inheritance deadline doesn't update when this function is called

Summary

When the function removeBeneficiary() is called by the owner of the inheritance manager contract the inheritance deadline doesn't update to the new time(block.timestamp+timeLock). The deadline should update for every transaction the owner does with this contract by design of the inheritance manager contract.

Vulnerability Details

When owner calls removeBeneficiary() deadline is not updated, because _setDeadline() is not called.

This can lead to unwanted behaviour of the inheritance manager contract, to false expectations regarding the actual time deadline. Beneficiries can call inherit() earlier than expected.

function removeBeneficiary(address \_beneficiary) external onlyOwner
{
uint256 indexToRemove = \_getBeneficiaryIndex(\_beneficiary);
delete beneficiaries\[indexToRemove];
}

Impact

Beneficiries can redeem funds at an earlier time than expected, resulting in inconsistent contract behaviour.

Tools Used

Manual review

Recommendations

Include a call to the _setDeadline() function to update the inheritance deadline when removeBeneficiary() is called.

```

function removeBeneficiary(address _beneficiary) external onlyOwner

function removeBeneficiary(address \_beneficiary) external onlyOwner
{
uint256 indexToRemove = \_getBeneficiaryIndex(\_beneficiary);
delete beneficiaries\[indexToRemove];
_setDeadline(); // update deadline
}

Same as above for createEstateNFT() and contractInteractions() which are also called by the owner and do not update the deadline when called.

Side note:

I am uploading from my mobile, because I am away from my laptop for a couple of weeks, hope the markdown works well.

Updates

Lead Judging Commences

0xtimefliez Lead Judge 6 months ago
Submission Judgement Published
Validated
Assigned finding tags:

functions do not reset the deadline

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.