The totalAllocation value in FeeManager.sol is a hardcoded literal in multiple places instead of a constant.
Vulnerability Detail
The totalAllocation value is used in more than one place in FeeManager.sol using a literal value instead of a constant variable.
Hardcoding values in-line without context as so called "magic numbers" makes the code prone to future errors, less readable and harder to maintain.
Impact
While this currently has no impact, it's possible that in case this value needs to change in the future, the fact that it needs to be modified in multiple places might cause it to be overlooked. Even a single place where this change was overlooked can cause hard to detect business logic issues in the protocol down the line.
[I-1] - Magic Numbers in FeeManager.sol
Low/Info issue submitted by BugTrippin
Summary
The
totalAllocation
value inFeeManager.sol
is a hardcoded literal in multiple places instead of a constant.Vulnerability Detail
The
totalAllocation
value is used in more than one place inFeeManager.sol
using a literal value instead of a constant variable.Hardcoding values in-line without context as so called "magic numbers" makes the code prone to future errors, less readable and harder to maintain.
Impact
While this currently has no impact, it's possible that in case this value needs to change in the future, the fact that it needs to be modified in multiple places might cause it to be overlooked. Even a single place where this change was overlooked can cause hard to detect business logic issues in the protocol down the line.
Code Snippet
https://github.com/sherlock-audit/2024-04-titles/blob/main/wallflower-contract-v2/src/fees/FeeManager.sol#L148
https://github.com/sherlock-audit/2024-04-titles/blob/main/wallflower-contract-v2/src/fees/FeeManager.sol#L483
Tool used
Manual Review, Aderyn
Recommendation
Introduce a constant variable defining the value for
totalAllocation
inFeeManager.sol
.