eip-5792

EIP-5792 Integration for Scaffold-ETH 2

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "eip-5792" with this command: npx skills add scaffold-eth/scaffold-eth-2/scaffold-eth-scaffold-eth-2-eip-5792

EIP-5792 Integration for Scaffold-ETH 2

Prerequisites

Check if ./packages/nextjs/scaffold.config.ts exists directly in the current working directory (do not search subdirectories). If it doesn't exist, this is not a Scaffold-ETH 2 project. Follow the instructions at https://docs.scaffoldeth.io/SKILL.md to scaffold it first. If it exists, continue directly with building.

Overview

EIP-5792 (Wallet Call API) lets apps send batched onchain write calls to wallets via wallet_sendCalls , check their status with wallet_getCallsStatus , and query wallet capabilities with wallet_getCapabilities . This replaces the one-tx-at-a-time pattern of eth_sendTransaction .

This skill covers integrating EIP-5792 batched transactions into an SE-2 project using wagmi's EIP-5792 hooks. For anything not covered here, refer to the EIP-5792 docs or wagmi docs. This skill focuses on SE-2 integration specifics and the wallet compatibility gotchas that trip people up.

Dependencies

No new dependencies needed. SE-2 already includes wagmi, which has the EIP-5792 hooks. The experimental hooks live at wagmi/experimental :

  • useWriteContracts — batch multiple contract calls into one wallet request

  • useCapabilities — detect what the connected wallet supports (batching, paymasters, etc.)

  • useShowCallsStatus — ask the wallet to display status of a batch

Import paths are moving. useCapabilities and useShowCallsStatus have been promoted to wagmi (stable). useWriteContracts is still in wagmi/experimental as of early 2026. Always check the wagmi docs for the current import paths — they may have changed.

Smart Contract

EIP-5792 works with any contract — there's nothing special about the contract side. The point is batching multiple calls (to one or more contracts) into a single wallet interaction. For a demo, a simple contract with two or more state-changing functions works well so users can see them batched:

// Syntax reference — adapt to the user's actual needs contract BatchExample { string public greeting = "Hello!"; uint256 public counter = 0;

function setGreeting(string memory _newGreeting) public payable {
    greeting = _newGreeting;
}

function incrementCounter() public {
    counter += 1;
}

receive() external payable {}

}

Deploy using the project's existing deployment pattern (Hardhat deploy/ or Foundry script/ ).

EIP-5792 Integration Pattern

Detecting wallet support

Not all wallets support EIP-5792. Use useCapabilities to check before offering batch UI:

import { useCapabilities } from "wagmi/experimental"; import { useAccount } from "wagmi";

const { address, chainId } = useAccount(); const { isSuccess: isEIP5792Wallet, data: walletCapabilities } = useCapabilities({ account: address });

// Check specific capabilities per chain const isPaymasterSupported = walletCapabilities?.[chainId]?.paymasterService?.supported;

isSuccess being true means the wallet responded to wallet_getCapabilities — i.e., it's EIP-5792 compliant. The data object is keyed by chain ID, with each chain listing its supported capabilities.

Batching contract calls

Use useWriteContracts to send multiple calls in one wallet interaction. You need the contract ABI and address — get these from SE-2's useDeployedContractInfo hook:

import { useWriteContracts } from "wagmi/experimental"; import { useDeployedContractInfo } from "~~/hooks/scaffold-eth";

const { data: deployedContract } = useDeployedContractInfo("YourContract"); const { writeContractsAsync, isPending } = useWriteContracts();

// Batch two calls const result = await writeContractsAsync({ contracts: [ { address: deployedContract.address, abi: deployedContract.abi, functionName: "setGreeting", args: ["Hello from batch!"], }, { address: deployedContract.address, abi: deployedContract.abi, functionName: "incrementCounter", }, ], // Optional: add capabilities like paymaster capabilities: isPaymasterSupported ? { paymasterService: { url: paymasterURL } } : undefined, });

The result contains an id that can be used to check status.

Showing batch status

Use useShowCallsStatus to let the wallet display the status of a batch:

import { useShowCallsStatus } from "wagmi/experimental";

const { showCallsStatusAsync } = useShowCallsStatus(); // After getting a batch ID from writeContractsAsync: await showCallsStatusAsync({ id: batchId });

This opens the wallet's native UI for showing transaction status — the app doesn't need to build its own status tracker.

Wallet Compatibility Gotchas

This is the main source of confusion with EIP-5792. Not all wallets behave the same way:

SE-2's burner wallet supports EIP-5792 with sequential (non-atomic) calls. It handles wallet_sendCalls by executing calls one at a time. However, advanced capabilities like paymasters and atomic execution aren't supported on the burner wallet or local chain. Test those features on a live testnet with a compliant wallet.

Coinbase Wallet is the most complete implementation. It supports batching, paymasters (via ERC-7677), and atomic execution. MetaMask has partial support. Check the EIP-5792 ecosystem page for the current list.

Capabilities vary by chain. A wallet might support paymasters on Base but not on Ethereum mainnet. Always check walletCapabilities?.[chainId] for the specific chain the user is on, not just whether the wallet is EIP-5792 compliant in general.

Paymaster integration (ERC-7677) is optional. If you want gas sponsorship, you need a paymaster service URL. This is passed as a capability in the writeContracts call. The paymaster service is external to SE-2 — you'll need to set one up (e.g., via Coinbase Developer Platform or other providers).

Graceful degradation is important. The UI should work for both EIP-5792 and non-EIP-5792 wallets. Use SE-2's standard useScaffoldWriteContract for individual calls as a fallback, and only show the batch button when useCapabilities succeeds. Consider offering a "switch to Coinbase Wallet" prompt when the connected wallet doesn't support EIP-5792.

Frontend

Build a page that demonstrates both individual and batched contract interactions. The key UX pattern:

  • Read state — use useScaffoldReadContract to show current contract values (these update after transactions)

  • Individual writes — use useScaffoldWriteContract for single calls (works with any wallet)

  • Batched writes — use useWriteContracts for the EIP-5792 batch (only enabled when wallet supports it)

  • Status display — use useShowCallsStatus to show batch result

  • Wallet detection — conditionally show/disable batch UI based on useCapabilities

How to Test

  • Deploy the contract: yarn deploy

  • Start the frontend: yarn start

  • For basic batching: use any wallet on localhost

  • For advanced capabilities (paymasters, atomic execution): deploy to a live testnet and connect with an EIP-5792 compliant wallet

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

erc-20

No summary provided by upstream source.

Repository SourceNeeds Review
General

ponder

No summary provided by upstream source.

Repository SourceNeeds Review
General

eip-712

No summary provided by upstream source.

Repository SourceNeeds Review