The ZENO contract is designed to manage ZENO token issuance and functionality, relying on proper initialization of critical parameters such as the USDC token address and the token’s maturity date. However, the constructor of the ZENO contract lacks essential input validations:
It does not check that the _usdc address is non-zero.
It does not validate that the _maturityDate is set to a future timestamp with an adequate buffer.
Without these validations, the contract can be deployed with invalid parameters (e.g., a zero address for USDC or a past maturity date), which can cause malfunctioning during auction operations or token interactions.
The attached test suite demonstrates that the contract accepts invalid inputs—resulting in zero values for USDC and maturity date—thereby confirming the vulnerability. This misinitialization may lead to unpredictable behavior in auctions and token transfers, ultimately undermining protocol stability and stakeholder confidence.
The constructor of the ZENO contract is defined as follows:
Identified Omissions:
Zero Address Check:
The constructor fails to validate that _usdc and _initialOwner are non-zero addresses. An invalid (zero) USDC address means that any interactions expecting a proper USDC token will fail.
Maturity Date Validation:
There is no check ensuring that _maturityDate is in the future (with an acceptable minimum delay). A maturity date set to the current timestamp or a past timestamp may lead to immediate or unexpected triggering of maturity-dependent logic.
Time and Value Consistency:
The absence of validations for time dimensions (e.g., ensuring the auction start and end times are set correctly) can lead to auctions with invalid timing, further compounding potential operational issues.
Because the constructor does not enforce these checks, a deployer could inadvertently (or maliciously) initialize the contract with:
A zero address for _usdc, causing any USDC-based operations to malfunction.
A maturity date that is either in the past or too soon, resulting in immediate maturity and potentially breaking time-dependent functions.
The provided test suite explicitly creates a ZENO instance with zero values for these parameters, confirming that the constructor does not revert or prevent invalid initialization.
The following test suite demonstrates the issue:
Test Outcome:
The test successfully deploys a ZENO contract with a zero address for USDC and a maturity date of 0, indicating that the constructor lacks proper validations.
Implication:
Such an initialization would lead to operational failures when the contract attempts to interact with USDC or enforce maturity-based logic, potentially breaking auction functions and destabilizing the protocol.
Operational Failure:
An invalid USDC address prevents the ZENO contract from interacting with the intended stablecoin, leading to failed transfers and broken functionality.
Time-Dependent Logic Breakdown:
An improperly set maturity date (e.g., in the past or zero) can trigger premature maturity events or disable time-based features, undermining the economic design.
Economic Exploitation:
Invalid initialization parameters can be exploited to disrupt auctions or token sales, causing financial losses or unfair advantages.
Loss of Stakeholder Trust:
Deployments with invalid parameters compromise the protocol’s reliability, reducing user confidence and participation.
Manual Review
Foundry
To secure the ZENO contract, update the constructor with comprehensive input validations:
Non-Zero Address Checks:
Ensure that _usdc and _initialOwner are not the zero address.
Maturity Date Validation:
Verify that _maturityDate is set to a future timestamp with an appropriate minimum delay (e.g., at least 1 day in the future).
Optional Additional Checks:
Consider validating other parameters (if applicable) such as ensuring non-zero values for _name, _symbol, and any critical numerical parameters.
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.