Description:
The TokenDivider contract uses local state to manage the fractional token balance,
disregarding the actual balance of the ERC20 token. As a result, the ERC20 token balance becomes redundant and inconsistent with the balance in the local state.
Impact:
Transferring fraction erc20 token directly will not update the local state, breaking the consistency between the local state and the actual balance of the ERC20 token.
Proof of Concept:
add the following in test/unit/TokenDividerTest.t.sol
and run the test forge test --mt testTransferERCFractionOutsideDividerNotSync
Recommended Mitigation:
Remove the local state for fractional token balance and use the ERC20 token balance directly.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.