Missing Zero-Address Validation in StrataxOracle::getRoundData (Invalid Input + Defensive Programming Gap)
Description:
The function StrataxOracle::getRoundData does not validate that _token is not the zero address before accessing the priceFeedsmapping. This allows unintended calls using address(0) and weakens input validation consistency across the contract.
If _token == address(0), the function reads priceFeeds[address(0)], which may revert indirectly or behave unexpectedly if misconfigured.
Impact:
Allows accidental misuse of the function with address(0).
Weakens API guarantees for external integrations.
Inconsistent validation compared to best practices for external-facing functions.
Minor maintainability and correctness issue.
This is not a direct security vulnerability but reflects incomplete defensive validation.
Proof of Concept:
Calling:
will attempt to read priceFeeds[address(0)], potentially:
Reverting with "Price feed not set for token", or
Succeeding if the zero address was mistakenly configured.
Recommended Mitigation:
Add an explicit zero-address check and migrate to custom errors for gas efficiency and consistency:
This ensures stronger input validation, improved consistency, and better gas efficiency across the contract.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.
The contest is complete and the rewards are being distributed.