Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: low
Invalid

_setDeadline is not called at contract creation

Summary

The InheritanceManager constructor does not call _setDeadline upon contract creation despite the documentation of the setDeadline function saying that should be called on contract creation and every owner controlled function.

Vulnerability Details

Affected code :

constructor() {
owner = msg.sender;
nft = new NFTFactory(address(this));
//@audit - the documentation says that __setDeadline is supposed to be called at contract creation but it's not called
}

Despite explicitly stating that _setDeadline should be called upon contract creation here :

/**
* @dev internal helper function to be called at contract creation and every owner controlled event/function call
* to resett the timer off inactivity.
*/
function _setDeadline() internal {
deadline = block.timestamp + TIMELOCK;
}

_setDeadline is never called upon contract creation making creating a descripancy with how the constructor is intended to function and how it currently functions.

Flow :

Rose deploys the InheritanceManger contract

Rose becomes the owner of the inheritanceManger contract

The InheritanceManger deploys the NftFactory contract and becomes the inheritanceManger for the nftFactory contract

But the _setDeadline is never called upon contract creation causing the contract to have no deadline

Impact

Based on the documentation there is a difference in the intended function of the _setDeadline and how it actually works upon contract creation in the InheritanceManger contract which causes the Inheritance Manager Contract to have no set deadline when the contract is created causing confusion.

Tools Used

Manual Review

Recommendations

Ensure there is a call to setDeadline upon contract creation :

constructor() {
owner = msg.sender;
nft = new NFTFactory(address(this));
+ _setDeadline()
}
Updates

Lead Judging Commences

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

constructor does not initialize deadline

Appeal created

0xtimefliez Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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