In this track: Tokens and digital ownership
intermediate · 3 MIN READ

Fee-on-transfer tokens explained

The requested amount and the recipient’s net increase can differ.

LET’S PICTURE IT

Sending a parcel through a service that retains part of the contents requires different accounting from delivering every item unchanged.

SEE IT FOR YOURSELF
A valid counter call, step by stepStep 1 / 4
A valid counter call, step by stepFunction requestincrement()No argumentsBefore executionstored count0A local teaching example with a defined starting stateIncoming callCheck function dispatchCheck coded conditionsRules passConditions passContinue executionA failed check can revert insteadCalculation0 + 1Result: 1Storage writecount = 1Persists if call succeedsCalculating a local value and storing it are separate stepsPersistent statecount1Later readGetter reports 1No new incrementState, logs and browser display have different roles

This example begins with count zero and a request to call increment(). No real contract is deployed.

Animated local teaching model. No wallet, RPC or live blockchain data. Some labels and hashes are abbreviated for readability.

The implementation can take a fee

A token may deduct an amount or apply special distribution rules during transfer. A requested raw amount therefore may not equal the recipient’s final balance increase.

Interfaces should not assume equality

A contract receiving deposits can miscredit users if it assumes every successful transfer delivers the full requested quantity. A robust integration needs an explicit compatibility policy and accounting model.

Events need context too

A token can emit records under its own implementation. Reading a Transfer label without inspecting the actual behavior can hide fees or other adjustments. State and logs answer related but different questions.

Keep the example bounded

Our transfer encoder produces standard calldata; it does not simulate a token’s transfer policy. Decoding an amount tells you what was requested under the supplied interface, not the net economic result of a real execution.

TURN UNDERSTANDING INTO PRACTICEOpen the ABI encoder →
QUICK CHECK · NO PRESSURE

Does encoding transfer(recipient, 100) prove the recipient will gain exactly 100 raw units for every token?

Your progress stays in this browser.
Keep exploring the original referenceethereum.org ↗

Original explanations by EtherTools. Examples are educational and source-linked; this site is independent of the Ethereum Foundation. Our approach.