Skip to content
high Token Standards No SWC entry CWE-682

Fee-on-Transfer / Rebasing Token Accounting Mismatch

SAFE-0052 Token Standards Checked automatically by the scanner
1

What goes wrong

The protocol credits users the nominal transfer amount, but a fee-on-transfer or rebasing token delivers less (or a changing amount), so internal accounting exceeds real holdings and the last users cannot withdraw.

2

How to fix it

the pattern that is safe
uint256 b0 = token.balanceOf(address(this));
token.safeTransferFrom(msg.sender, address(this), amt);
deposits[msg.sender] += token.balanceOf(address(this)) - b0;
Account for real received amounts on elastic tokens.
Check your own contract for this

The SaferICO scanner runs 201 detectors over your Solidity source, SAFE-0052 among them. Paste an address or the source itself — a small per-scan fee, shown before you sign, or unlimited on any plan.

Run the scanner See how it is attacked Read the docs