Assessment reports>Session Token>Discussion>Redundant checks

Redundant checks

The finalizeNode function is exclusively called by the contributeFunds function. Both functions incorporate the checks shown below. Furthermore, the finalizeNode function is triggered solely when totalContribution() equals stakingRequirement but additionally verifies this condition. Therefore, duplicate checks can be deleted.

require(!finalized, "Node has already been finalized.");
require(!cancelled, "Node has been cancelled.");

This issue has been acknowledged by Session team, and a fix was implemented in commit 07460298.

Zellic © 2024Back to top ↑