F-2024-0004·missing-validation

Unnecessary gas consumption: Lack a check for zero input

Acknowledgedindex-funddefirebalancing
TL;DR

redeem, lendToken, collectToken and other functions lack a zero-amount check, allowing zero-input calls that consume gas without effect.

Severity
LOW
Impact
LOW
Likelihood
MEDIUM
Method
MManual review
CAT.
Complexity
LOW
Exploitability
LOW
02Section · Description

Description

The redeem, lendToken, collectToken and more functions lack a check for zero input, which allows them to be executed with an amount of zero, leading to unnecessary gas consumption without any meaningful transaction effect.

While the functions have other checks, they do not verify that the amount parameter is greater than zero before proceeding.

03Section · Impact

Impact

If called with an amount of zero, the function unnecessarily consumes gas for validation checks and state modifications. This behavior does not lead to direct financial loss but can result in wasted gas if abused or called erroneously with zero. It also poses potential disruption or inconvenience through minor network load increase due to such calls.

04Section · Recommendation

Recommendation

To prevent unnecessary gas usage and ensure only meaningful transactions are processed, the function should include a check to verify that the amount is greater than zero:

solidity
require(amount != 0, "Amount must be greater than zero");
F-2024-0004

oog
zealynx

Smart Contract Security Digest

Monthly exploit breakdowns, audit checklists, and DeFi security research — straight to your inbox

© 2026 Zealynx