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

Variable `Aidrop::daysInSecond` variable is not needed.

Summary

The variable daysInSecond is not needed and can be replaced with a built in variable in solidity days. This would prevent any sort of typos or mistakes.

Vulnerability Details

In the example below we can see the two values are equal.

function test_secondsInDays() external {
console.log(1 days);
console.log(airdropContract.daysInSecond());
assertEq(1 days, airdropContract.daysInSecond());
}
}

Impact Would help reduce potential mistakes and typos.

Tools Used

Foundry

Recommendations

- uint256 public constant daysInSecond = 3600 * 24;
....
- uint256 numberOfDaysInCouple = (block.timestamp - soulmateContract.idToCreationTimestamp(soulmateContract.ownerToId(msg.sender))) / daysInSecond;
+ uint256 numberOfDaysInCouple = (block.timestamp - soulmateContract.idToCreationTimestamp(soulmateContract.ownerToId(msg.sender))) / 1 days;
Updates

Lead Judging Commences

0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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