A trader wants to deposit 100 USDC into a vault. The vault needs permission to pull the tokens, so the familiar flow asks for an approval and then a deposit. If the trader stops after the first step, the allowance remains while the deposit stays unfinished. A wallet that supports atomic batching can present both calls together and execute them as one all-or-nothing action.
The wallet interface and the execution layer
An app can use EIP-5792’s wallet_getCapabilities to check what the connected wallet supports on the chain in use. It can then submit the approval and deposit as a batch using wallet_sendCalls. When the app sets atomicRequired to true, the standard requires the calls to execute together or leave no material effects onchain. If the wallet reports that the account is ready for an upgrade, the upgrade requires the user's approval. If the user declines, the wallet must reject the request for an atomic batch. The identifier returned by wallet_sendCalls lets the app check progress through wallet_getCallsStatus. EIP-5792 Wallet Call API
ERC-4337 describes one way a wallet can carry out that action. A smart account can define how it authorizes operations and executes calls. The wallet packages its request as a UserOperation. A bundler submits it in a transaction to the EntryPoint contract, which coordinates validation and execution. An optional paymaster can cover gas under its own policy. The wallet interface governs how the app requests the batch. ERC-4337 governs how a compatible account can submit and execute the operation. ERC-4337 specification
What the trader should see
In the vault example, the wallet can present the approval for 100 USDC to the vault’s spender contract and the deposit of those funds in the same review. The trader needs to see the spender, the amount, and the destination so they can verify what they authorize. If the vault rejects the deposit because its cap was reached before execution, the required atomic batch rolls back the approval made by that same batch. An allowance from an earlier transaction would still have its previous value.
Gas sponsorship involves a separate choice. A vault operator might cover a first deposit, subject to a budget and an allowlist of eligible calls. The operation still consumes gas and the paymaster pays it. A product that advertises a sponsored deposit should show who covers the fee before the user confirms, especially if a sponsorship request is declined and the interface can offer a user-paid path. ERC-4337 paymaster extension
What happens when the wallet lacks support
The app can offer separate approval and deposit transactions if that flow is safe for the vault. It should tell the trader that the first confirmation grants an allowance and that doing so leaves permission active even if the trader closes the page before depositing. If the flow depends on both calls succeeding together, the app should require atomic support.
A useful check for this design is to force the second call to revert. The wallet should report a failed batch, and the token allowance should match its value before the operation. That single test checks the outcome the trader cares about when the deposit fails halfway through.
