ERC-7410: ERC-20 Update Allowance
Fixes the broken approve() function in ERC-20 tokens. Increase or decrease allowances instead of setting absolute values.
Adam's role
Co-author. I pushed for this after seeing how agent spending limits need safe allowance management. When AI agents manage wallets, the approve race condition becomes a real attack vector.
What is it?
ERC-7410 replaces the dangerous approve() pattern with increaseAllowance() and decreaseAllowance(). Instead of setting an absolute spending limit (which creates a race condition), you add or subtract from the current allowance. Simple fix, massive security improvement.
Simple analogy
The current approve() is like telling a store 'you can charge me up to $100.' If you later change it to $50, there's a brief moment where both $100 AND $50 might be valid. ERC-7410 fixes this by saying 'add $50 more' or 'remove $50' instead.
How it works
Current Problem
You approve a spender for 100 tokens. Later you want to change it to 50. You call approve(spender, 50). But between your tx and the block, the spender drains the original 100, THEN gets the new 50. You lose 150.
The Fix: Relative Changes
Instead of setting absolute values, ERC-7410 uses relative adjustments. increaseAllowance(spender, 50) adds 50 to whatever the current allowance is. decreaseAllowance(spender, 30) subtracts 30.
No Race Condition
If a spender front-runs and spends their allowance, the decrease will apply to the remaining balance. They can't double-dip because you never set a new absolute value they could exploit.
Backward Compatible
ERC-7410 tokens still implement standard ERC-20. Old tools keep working. New tools get the safe allowance functions. No migration needed.
Key concepts
increaseAllowance(spender, addedValue)
Adds to the current allowance. If the spender can currently spend 100 tokens and you call increaseAllowance(spender, 50), they can now spend 150. No ambiguity, no race condition.
decreaseAllowance(spender, subtractedValue)
Subtracts from the current allowance. If the spender can currently spend 100 tokens and you call decreaseAllowance(spender, 30), they can now spend 70. Reverts if you try to subtract more than the current allowance.
The Race Condition Problem
With standard approve(), if you change an allowance from 100 to 50, a malicious spender can front-run your transaction: spend the old 100, then spend the new 50 too. That's 150 instead of 50. ERC-7410 makes this impossible.
Use cases
DeFi Approvals
Safely adjust DEX and lending protocol spending limits.
DeFi Approvals
Safely adjust DEX and lending protocol spending limits.
AI Agent Spending Limits
Safely manage how much an AI agent can spend from your wallet.
AI Agent Spending Limits
Safely manage how much an AI agent can spend from your wallet.
Subscription Services
Adjust recurring payment authorizations without risk.
Subscription Services
Adjust recurring payment authorizations without risk.
Technical specification
The core interface that defines ERC-7410.
// SPDX-License-Identifier: MIT
interface IERC7410 {
// Increase the allowance granted to spender
function increaseAllowance(address spender, uint256 addedValue)
external
returns (bool);
// Decrease the allowance granted to spender
function decreaseAllowance(address spender, uint256 subtractedValue)
external
returns (bool);
}