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

Missing Deadline Reset in Owner Functions

Description:
Multiple owner-controlled functions fail to reset the inactivity timer (_setDeadline()), which is intended to prevent premature inheritance claims. This timer should be reset whenever the owner interacts with the contract to indicate they are still active. However, the following functions are missing this crucial call:

  • contractInteractions()

  • removeBeneficiary()

  • createEstateNFT()

Impact:
If the owner primarily uses these functions for contract interaction while neglecting other functions that do reset the timer, the contract may enter the inherited state prematurely, allowing beneficiaries to claim assets even though the owner is still active. This directly undermines the core security mechanism of the contract.

Code Location:

function contractInteractions(address _target, bytes calldata _payload, uint256 _value, bool _storeTarget)
external
nonReentrant
onlyOwner
{
(bool success, bytes memory data) = _target.call{value: _value}(_payload);
require(success, "interaction failed");
if (_storeTarget) {
interactions[_target] = data;
}
// Missing _setDeadline() call
}
function removeBeneficiary(address _beneficiary) external onlyOwner {
uint256 indexToRemove = _getBeneficiaryIndex(_beneficiary);
delete beneficiaries[indexToRemove];
// Missing _setDeadline() call
}
function createEstateNFT(string memory _description, uint256 _value, address _asset) external onlyOwner {
uint256 nftID = nft.createEstate(_description);
nftValue[nftID] = _value;
assetToPay = _asset;
// Missing _setDeadline() call
}

Recommendation:
Add the _setDeadline() function call at the end of each owner-controlled function to reset the inactivity timer:

function contractInteractions(address _target, bytes calldata _payload, uint256 _value, bool _storeTarget)
external
nonReentrant
onlyOwner
{
(bool success, bytes memory data) = _target.call{value: _value}(_payload);
require(success, "interaction failed");
if (_storeTarget) {
interactions[_target] = data;
}
_setDeadline(); // Add this line
}
function removeBeneficiary(address _beneficiary) external onlyOwner {
uint256 indexToRemove = _getBeneficiaryIndex(_beneficiary);
delete beneficiaries[indexToRemove];
_setDeadline(); // Add this line
}
function createEstateNFT(string memory _description, uint256 _value, address _asset) external onlyOwner {
uint256 nftID = nft.createEstate(_description);
nftValue[nftID] = _value;
assetToPay = _asset;
_setDeadline(); // Add this line
}
```ww
## Tools Used
- Foundry Testing Framework
- Manual Code Review
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.