69587 sc insight recovered event missing recipient makes fund attribution impossible with multiple managers

Submitted on Mar 15th 2026 at 18:48:07 UTC by @teoslaf1 for Audit Comp | Folks Finance: Staking Contracts

  • Report ID: #69587

  • Report Type: Smart Contract

  • Report severity: Insight

  • Target: https://github.com/Folks-Finance/folks-staking-contracts/blob/main/src/Staking.sol

Description

recoverERC20 emits:

event Recovered(address indexed token, uint256 amount);
// ...
emit Recovered(tokenAddress, tokenAmount);

msg.sender — the manager who receives the tokens — is never logged. Since MANAGER_ROLE is a role-based permission that can be granted to multiple addresses, there is no way to attribute a recovery event to a specific manager from the event log alone. An off-chain observer must trace the raw ERC20 Transfer event and cross-reference it with known manager addresses to reconstruct who received the funds.

This matters for:

  • Treasury monitoring and accounting systems

  • Security incident response (which manager moved funds?)

  • Compliance and audit trails

Fix

Add recipient to the event:

Proof of Concept

Add the test to /test/Staking.t.sol

Run it with:

Was this helpful?