Omniscia Altura Audit
ALTU Code Style Findings
ALTU Code Style Findings
ALT-01C: Redundant Parenthesis Statements
| Type | Severity | Location |
|---|---|---|
| Code Style | ![]() | ALTU.sol:L63 |
Description:
The referenced statements are redundantly wrapped in parenthesis' (()).
Example:
contracts/ALTU.sol
63bool locked = (!unlockTimeSet) || (block.timestamp < transferUnlockTime);Recommendation:
We advise them to be safely omitted, increasing the legibility of the codebase.
ALT-02C: Redundant State Variable
| Type | Severity | Location |
|---|---|---|
| Gas Optimization | ![]() | ALTU.sol:L13, L41, L63 |
Description:
The unlockTimeSet variable is set to true whenever the transferUnlockTime variable is configured as non-zero, rendering it effectively redundant.
Example:
contracts/ALTU.sol
33function setTransferUnlockTimeOnce(uint64 unlockTime_)34 external35 onlyRole(DEFAULT_ADMIN_ROLE)36{37 if (unlockTimeSet) revert UnlockTimeAlreadySet();38 if (unlockTime_ == 0) revert InvalidUnlockTime();39
40 transferUnlockTime = unlockTime_;41 unlockTimeSet = true;42
43 emit TransferUnlockTimeSet(unlockTime_);44}Recommendation:
We advise the code to evaluate whether the transferUnlockTime value is non-zero in place of the unlockTimeSet variable, optimizing the code's gas cost.
