The contract credits the *requested* transferFrom amount rather than the *actual* balance delta received. With a fee-on-transfer or rebasing token the contract receives less than it records, so later withdrawals overdraw the pool and the last users cannot exit.
// token takes a 2% transfer fee // deposit(1000): contract receives 980 but credits 1000 // enough users do this and the pool is 2% short -> final withdraw reverts.
uint256 before = token.balanceOf(address(this));
token.safeTransferFrom(msg.sender, address(this), amount);
uint256 received = token.balanceOf(address(this)) - before;
balances[msg.sender] += received; // credit what actually arrived
The SaferICO scanner runs 201 detectors over your Solidity source, SAFE-0107 among them. Paste an address or the source itself — a small per-scan fee, shown before you sign, or unlimited on any plan.