Odd Tartan Gerbil
Medium
The missing initialization of state variables in the constructor will cause unexpected behavior for the contract users as the contract functions will attempt to use uninitialized addresses.
In vaultV2Deployer.sol:30
, the constructor parameters are not being assigned to their corresponding state variables.
- Admin needs to deploy the contract without initializing the state variables for addresses like
numa
,lstAddress
,pricefeed
, anduptimefeed
.
- No external conditions required for this issue to manifest.
- An attacker calls a function that depends on uninitialized addresses.
- The contract functions fail or behave unexpectedly because the required addresses are not set.
The affected party (contract users) suffer from unexpected contract behavior due to uninitialized addresses.
Numa/contracts/deployment/vaultV2Deployer.sol
// vaultV2Deployer.sol:30
constructor(
address _vaultFeeReceiver,
address _vaultRwdReceiver,
uint128 _lstHeartbeat,
address _numaAddress,
address _lstAddress,
address _pricefeedAddress,
address _uptimeAddress
) {
vaultFeeReceiver = _vaultFeeReceiver;
vaultRwdReceiver = _vaultRwdReceiver;
lstHeartbeat = _lstHeartbeat;
}
Ensure constructor assigns parameters to their respective state variables to prevent uninitialized addresses.