Omniscia Myso Finance Audit
FeeHandler Manual Review Findings
FeeHandler Manual Review Findings
FHR-01M: Improper Error Condition Evaluation
Type | Severity | Location |
---|---|---|
Logical Fault | ![]() | FeeHandler.sol:L87 |
Description:
The DistPartnerFeeAlreadySet
error will be yielded when the distribution pattern's fee remains unchanged rather than when it has already been set.
Impact:
The system permits the fee of a distribution partner to be reconfigured which might ultimately not be desirable based on the relevant error naming convention.
After the desired alleviation was supplied, we consider this to be an informational-level finding as the code's original behaviour was proper.
Example:
75function setDistPartnerFeeShares(76 address[] calldata accounts,77 uint256[] calldata feeShares78) external virtual onlyOwner {79 if (accounts.length == 0 || accounts.length != feeShares.length) {80 revert Errors.InvalidArrayLength();81 }82 for (uint256 i = 0; i < accounts.length; ++i) {83 if (feeShares[i] > BASE) {84 revert Errors.InvalidDistPartnerFeeShare();85 }86 if (distPartnerFeeShare[accounts[i]] == feeShares[i]) {87 revert Errors.DistPartnerFeeAlreadySet();88 }89 distPartnerFeeShare[accounts[i]] = feeShares[i];90 }91
92 emit SetDistPartnerFeeShares(accounts, feeShares);93}
Recommendation:
We advise either the conditional to be updated so as to prevent a re-configuration of the fee of a distribution partner or the error name to be updated to reflect that the distribution partner fee would remain unchanged, the former of which we recommend.
Alleviation (d9eb549dcca601db1fa91336ebe4d08fa8f2908b):
The error signature was updated to properly illustrate the condition it is meant to be yielded under thus addressing this exhibit.