Several inputs should be validated to avoid bad initialization of the StakingPool contract.
When initialize the StakingPool contract, no check was made to validate the inputs provided by user. When initializing the StakingPool contract, no check was made to validate the inputs provided by the user. So the _token variable can be initialized with the value address(0) which is an invalid address; the strings _liquidTokenName and _liquidTokenSymbol can take the value empty string which will prevent the token from being identified; the variable _unusedDepositLimit which represents max number of tokens can be initialized to zerowhich is not logical and finally the array _fees can be initialized with a size equal to zero and null elements or an extremely large size, which causes unexpected behaviour:
This lack of verification can cause a number of problems:
- Loss of Functionality: If _token is set to address(0), any subsequent interactions with the token (such as transfers, approvals, or balance checks) will fail. This can effectively break the functionality of the contract since the staking and rewards logic would likely depend on a valid token contract.
- UI/UX Problems: If _liquidTokenName or _liquidTokenSymbol is an empty string, it could lead to Front-end interfaces and block explorers that rely on these values to display token information (name, symbol) might malfunction or show incorrect data. Users may not trust a token that doesn’t have a valid name or symbol.
- Incorrect Fee Calculations: If _fees contains invalid or malformed fee entries, the contract could miscalculate the total fees. This might result in users being charged incorrect fees, which could be higher or lower than intended.
- Excessive Gas Costs: If the _fees array is too large and there’s no validation, looping through it could cause the contract to hit the block gas limit during execution
Manual analysis.
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.