-
Notifications
You must be signed in to change notification settings - Fork 1
[OFC-01C] Redundant Representation of Literal Constant #14
Copy link
Copy link
Open
Description
OFC-01C: Redundant Representation of Literal Constant
| Type | Severity | Location |
|---|---|---|
| Code Style | ![]() |
OFTCoreUpgradeable.sol:L42 |
Description:
The OFTCoreStorageLocation variable is declared as a bytes32 literal instead of utilizing its commented-out representation.
Example:
// keccak256(abi.encode(uint256(keccak256("layerzero.storage.OFTCore")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant OFTCoreStorageLocation = 0x822492242235517548c4a8cf040400e3c0daf5b82af652ed16dce4fa3ae72800;Recommendation:
We advise the commented-out representation to replace the value literal, ensuring that the value can be easily maintained while ensuring that no external verification of equivalence must be performed.
To note, it is possible to perform literal-based calculations in constant declarations and keccak256 evaluations of string values are correctly evaluated during compile-time.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
