Vanguard

First Flight #56
Beginner FriendlyDeFiFoundry
100 EXP
View results
Submission Details
Impact: low
Likelihood: high
Invalid

[L-01] `totalPenaltyFeesCollected` Never Updated

Root + Impact

Description

The tracking variable for penalty fees is declared but never incremented.

Location: src/TokenLaunchHook.sol:51

uint256 public totalPenaltyFeesCollected; // Always remains 0

Risk

Likelihood: Every penalized swap leaves this value unchanged at 0.

Impact:

  • Cannot track protocol revenue from penalties

  • Misleading state variable

Proof of Concept

function test_PoC_L03_UnusedPenaltyTracking() public {
uint256 penaltiesBefore = hook.totalPenaltyFeesCollected();
// Do multiple rapid swaps to trigger cooldown penalties
for (uint256 i = 0; i < 5; i++) {
_swap(user1, 0.001 ether);
}
uint256 penaltiesAfter = hook.totalPenaltyFeesCollected();
// Penalties were applied (via feeOverride) but NOT tracked!
assertEq(penaltiesBefore, penaltiesAfter, "Penalty tracking never updated");
assertEq(penaltiesAfter, 0, "Always remains 0");
}

Recommendations

Remove if not needed, or implement proper tracking.

Updates

Lead Judging Commences

chaossr Lead Judge
17 days ago

Appeal created

chaossr Lead Judge 17 days ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!