Stratax Contracts

First Flight #57
Beginner FriendlyDeFi
100 EXP
Submission Details
Impact: low
Likelihood: low

Inconsistent Storage Naming Convention (Unclear State Variables + Maintainability Impact)

Author Revealed upon completion

Inconsistent Storage Naming Convention (Unclear State Variables + Maintainability Impact)

Description:

The contract does not follow a clear naming convention to distinguish storage variables from local or memory variables.

@> address public owner;

Using generic names such as owner may reduce clarity in larger contracts, especially when local variables or parameters share similar names.

Impact:

  • Makes it harder to visually distinguish storage variables from function parameters.

  • Increases risk of shadowing or accidental misuse.

  • Reduces consistency and professional code standards.

  • Slightly increases review and audit complexity.

While not a direct security issue, consistent naming significantly improves maintainability and reduces human error risk.

Recommended Mitigation:

Adopt a clear naming convention for storage variables, such as prefixing with s_:

- address public owner;
+ address public s_owner;

Or use uppercase for immutable/constants where appropriate:

address public s_owner;

Additionally, update references across the contract:

require(msg.sender == s_owner, "Not owner");

This enhances readability and aligns with best practices in Solidity development.


[L-14] Missing Empty Array Validation (Invalid Input Not Rejected + UX/Consistency Impact)

Description:

StrataxOracle::setPriceFeeds validates array length equality, but does not reject empty arrays. This allows no-op calls that waste gas and may create misleading “successful” transactions.

@> require(_tokens.length == _priceFeeds.length, "Array length mismatch");

Impact:

  • Allows meaningless transactions (no updates performed).

  • Wastes gas and can confuse integrators/ops tooling.

  • Inconsistent input validation (length match is checked, but emptiness is not).

Proof of Concept:

Calling:

setPriceFeeds(new address, new address);

passes the current require, but does not update anything.

Recommended Mitigation:

Add an explicit empty check before the length equality check (and prefer custom errors if already adopted):

error StrataxOracle__EmptyArray();
error StrataxOracle__ArrayLengthMismatch();
if (_tokens.length == 0 || _priceFeeds.length == 0) revert EStrataxOracle__mptyArray();
if (_tokens.length != _priceFeeds.length) revert StrataxOracle__ArrayLengthMismatch();

Support

FAQs

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

Give us feedback!