Check a token spending allowance
Work out how much a spender may move today and what happens if the wallet receives more tokens tomorrow.
ACADEMY LAB 02 · READ-ONLY EXERCISE
Three numbers on the screen
A practice wallet holds 3 WETH. A named spender has an allowance of 5 WETH. The spender calls transferFrom for 2 WETH and the call succeeds. Work out the remaining wallet balance, the remaining allowance, and the maximum the spender could move immediately.
Reveal the ledger
The wallet holds 1 WETH. The finite allowance has fallen to 3 WETH. Only 1 WETH is available to move immediately. If the wallet later receives 4 WETH, the spender could then move up to 3 WETH without another approval, assuming no intervening allowance change.
What to record
Identify the network, token contract, owner and spender. Query allowance(owner, spender) and balanceOf(owner) at the same block. An earlier Approval event is evidence of a past instruction. The current allowance can have changed since that event.
Repeat the exercise in Wallet Lab. Compare the ERC-20 allowance interface with the implementation in the WETH Token File.
