Contracts that are imported and not used anywhere in the code are most likely an accident due to incomplete refactoring. Such imports can lead to confusion among readers.
Here is an example of this issue:
import {VRFCoordinatorV2, VRFCoordinatorV2Interface} from "@chainlink/contracts/src/v0.8/VRFCoordinatorV2.sol";
In the example above, VRFCoordinatorV2
is never used in the contract. As such it can be removed from the import like so:
import {VRFCoordinatorV2Interface} from "@chainlink/contracts/src/v0.8/VRFCoordinatorV2.sol";
Empty functions can reduce readability because readers need to guess whether it’s intentional or not. So writing a clear comment for empty functions is a good practice. Additionally, an empty function should also revert on call/emit an event.
- File:
VRFNFTRandomDrawFactory.sol
Line 55-59
File: OwnableUpgradeable.sol
Line 113
/// @audit "callably" -> "callable"
/// @dev only callably by the owner, dangerous call.
File: IVRFNFTRandomDraw.sol
Line 46
/// @audit "aftr" -> "after"
/// @notice When the owner reclaims nft aftr recovery time delay
The event below has no parameters in it to emit anything. Consider either removing this event or refactoring it with relevant info.
File: IVRFNFTRandomDrawFactory.sol
Line 18
event SetupFactory();
To comply with the Solidity Style Guide, lines should be limited to 120 characters max.
For example, the instance listed below is way over the limit of 120 characters:
File: IVRFNFTRandomDraw.sol
Line 64
Locking the pragma helps ensure that contracts don't get deployed with unintended versions, for example, the latest compiler version which could have higher risks of undiscovered bugs.
For example, The pragma version in Version.sol
is unspecific (pragma solidity ^0.8.10;
).
For upgradeable contracts, there should be a storage gap at the end of the contract. Without a storage gap, Storage clashes could occur while using inheritance.
For example:
File: VRFNFTRandomDrawFactory.sol
Consider adding the variable __gap
at the end of VRFNFTRandomDrawFactory.sol
:
uint256[50] private __gap;