Omniscia Stakewise Audit
Pool Code Style Findings
Pool Code Style Findings
POO-01C: Undocumented Value Literal
| Type | Severity | Location |
|---|---|---|
| Code Style | Informational | Pool.sol:L81, L169, L182, L190, L211 |
Description:
The pendingValidatorsLimit is meant to represent a fractional off-set with a maximum of 1e4, indicating that the validatorIndex multipler can at most be 0.5 which implies that the maximum number of pending validators during which tokens are still minted as normal is at most equal to the currently activated ones.
Example:
210require(211 validatorIndex.mul(1e4) <= _activatedValidators.mul(pendingValidatorsLimit.add(1e4)),212 "Pool: validator is not active yet"213);Recommendation:
We advise the literal 1e4 to be stored to a contract level constant variable that properly illustrates its purpose and the pendingValidatorsLimit variable to be documented in the locations it is being utilized as well as its declaration to greatly increase the legibility of the codebase.
Alleviation:
After discussing with the Stakewise team, we concluded that such a change would actually render the codebase less readable given that it would cause all instances to be replaced by a long verbose variable name. As a result, we consider this exhibit null.