Category: Coding Mistakes
Missing error handling
Informational Severity
Informational Impact
N/A Likelihood
Description
The slash_sequencer
function of the sequencer staking pallet does not handle possible errors from a call to Currency::repatriate_reserve
:
let _ = T::Currency::repatriate_reserved(
to_be_slashed,
to_reward,
repatriate_amount,
frame_support::traits::BalanceStatus::Free,
);
Impact
The function is technically not guaranteed to succeed; however, it is not clear whether a failure result can be returned in practice.
Recommendations
We recommend to explicitly handle all error cases, at least with an assertion, to ensure no unexpected condition can be undetected.
Remediation
This informational finding constitutes a violation of error handling best practices but is not an exploitable issue. Gasp believes this function will never return an error, and therefore opted not to make changes to the codebase in response to this finding.