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

Deadline Not Updated After Certain Function Calls

Description : The deadline is not being updated correctly when calling functions like createEstateNFT, contractInteractions, and removeBeneficiary. The _setDeadline() function should update the deadline every time one of these actions is performed,

Impact : This could lead to inaccurate deadline tracking, causing issues when relying on the deadline for controlling access to certain functions (like inheritance). Beneficiaries or other users may perform actions (such as inheriting or withdrawing funds) after the intended period due to the incorrect tracking of the deadline, undermining contract logic.

Proof of Concepts:

`function test_DeadlineCorrectlyUpdatedOrNot() public {
vm.startPrank(owner);
im._setDeadline();
uint beforeTimeStamp = im.getDeadline();
console.log("Before TimeStamp", beforeTimeStamp);
vm.warp(beforeTimeStamp + 2 days);
im.createEstateNFT("our beach-house", 2000000, address(Usdc));
uint afterTimeStamp = im.getDeadline();
console.log("After TimeStamp", afterTimeStamp);
vm.stopPrank();
}`

Result: Ran 1 test for test/InheritanceManagerTest.t.sol:InheritanceManagerTest [PASS] test_DeadlineCorrectlyUpdatedOrNot() (gas: 189515) Logs: Before TimeStamp 7776001 After TimeStamp 7776001

Updates

Lead Judging Commences

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