Why do token approvals cost gas: The onchain allowance
Why do token approvals cost gas? An ERC-20 approval writes an allowance to token storage, so supplying usually needs a paid approval before the supply transaction.
Tokenbearing Editorial4 min read#c58310

An ERC-20 approval costs gas because it writes a spending permission into the token contract, and every onchain state change uses gas. That approval is usually a separate transaction before you supply tokens, unless you already have enough allowance or the token and protocol support a permit flow.
What does an ERC-20 approval change?
An ERC-20 approval records how many of your tokens a named spender may use. The token’s approve(spender, amount) function sets that allowance for your wallet and the specified spender.
When a contract later calls transferFrom, the token checks the allowance and lets the spender move tokens up to the permitted amount. The protocol cannot pull tokens from your wallet just because you connected it or chose to supply; the token contract needs that recorded permission.
For a supply to SparkLend, the spender is the Pool contract that handles the supply. SparkLend is a permissionless money market where users lend assets and borrow other listed assets against supplied collateral. The linked background adds that lending-market context to the approval flow: the Pool needs an allowance before it can move the supplied ERC-20 tokens.
Why does recording an allowance use gas?
Recording an allowance uses gas because the token contract writes a value to onchain storage. Your approval transaction runs the token’s code, changes its state, and must be processed by the network.
The allowance is associated with both the token owner and the spender. Setting an allowance from zero to a nonzero amount requires a storage write that costs 20,000 gas. The final transaction cost can also depend on the other work performed by the contract call and network conditions.
That is why an approval is not just a local setting in your wallet. The token contract must store the permission so it can enforce it when the spender later requests a transfer. You pay gas for the approval transaction that makes this change.
Why do supplying tokens usually take two transactions?
Supplying usually takes two transactions because the token allowance and the supply are separate onchain actions. First, you call approve on the token contract, naming the protocol’s spender and an allowance amount. Then you call the lending protocol’s supply function.
In the second transaction, the protocol uses transferFrom to move the tokens from your wallet into the market. The token checks that the allowance covers the amount being transferred. If it does, the transfer can proceed; if it does not, the token cannot authorize that movement under the recorded permission.
So when a supply screen shows an approval step followed by a supply step, each transaction has a different job. The first changes the token’s allowance state. The second asks the protocol to take the approved tokens and account for them as a supply. Each is an onchain transaction and can require gas.
You can skip a new approval when the spender already has enough allowance for the supply. If the allowance is too small, or none is recorded, the token needs another approval before the transfer can succeed. Wallets and protocol interfaces may present the allowance amount differently, but the token contract enforces the permission.
How does EIP-2612 permit avoid a separate approval?
An EIP-2612 permit can avoid a separate approval transaction by letting you sign an allowance message offchain and include that signature in the supply transaction. Creating the signature does not itself write to the blockchain, so signing it does not require a separate gas-paid approval transaction.
With a supported token and a protocol flow that accepts its permit, the supply transaction carries the signature to the token’s permit function. The token verifies the signature and records the allowance during that transaction; the protocol can then use the permission to transfer the tokens as part of the supply flow. The user signs once and submits one transaction instead of first submitting an approval and then submitting a supply.
Permit support depends on both sides of the flow: the token must implement EIP-2612, and the protocol must support using that permit for the action. Without that support, the regular allowance path applies. The signature removes the separate approval transaction; the supply transaction still runs onchain and uses gas.