The TempleGold contract's constructor lacks zero address checks for critical contract addresses, including staking, escrow, and teamGnosis. This oversight could lead to the deployment of a contract with non-functional core components, potentially resulting in irrecoverable losses and broken functionality.
In the constructor of the TempleGold contract, several critical addresses are set without verifying that they are not the zero address:
The absence of zero address checks for _initArgs.staking
, _initArgs.escrow
, and _initArgs.gnosis
means that it's possible to deploy the contract with these critical components set to the zero address (0x0000000000000000000000000000000000000000).
The impact of this vulnerability includes:
Immutable Broken State: Once deployed with zero addresses, the contract's core functionalities would be permanently broken, as these addresses cannot be changed post-deployment.
Distribution Mechanism Failure: The _distribute
function, which relies on staking.notifyDistribution()
and escrow.notifyDistribution()
, would fail if these addresses are set to zero.
Irrecoverable Fund Loss: Any funds meant to be sent to teamGnosis would be permanently lost if it's set to the zero address.
Trust and Economic Damage: Such a deployment error could lead to significant economic losses and severely damage the project's reputation and user trust.
Manual review
To mitigate this vulnerability, implement zero address checks in the constructor:
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.