> ## Documentation Index
> Fetch the complete documentation index at: https://docs.onebalance.io/llms.txt
> Use this file to discover all available pages before exploring further.

# EIP-7702 Troubleshooting

> Handle multi-input limitations and edge cases

## Common Implementation Issues

Quick reference for resolving EIP-7702 implementation questions:

### Signature-Related Errors

| Issue                             | Cause                                              | Solution                                                                                                                                 |
| --------------------------------- | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| **"Y parity is required"**        | Wallet doesn't return yParity in signature         | Use [viem](https://viem.sh) or [compatible wallet library](https://docs.privy.io/wallets/using-wallets/ethereum/sign-7702-authorization) |
| **"Invalid signature"**           | Using `signTypedData()` instead of `signMessage()` | Use UserOperation hash signing for Kernel accounts                                                                                       |
| **"UserOperation hash mismatch"** | Incorrect BigInt conversion or EntryPoint version  | Ensure all numeric fields are `BigInt` and use EntryPoint 0.7                                                                            |

### Multi-Chain Operation Errors

| Issue                                    | Cause                                               | Solution                                                               |
| ---------------------------------------- | --------------------------------------------------- | ---------------------------------------------------------------------- |
| **"Missing origin chain signatures"**    | Forgot to sign origin chain operations              | Sign all operations in `quote.originChainsOperations[]`                |
| **"Transaction failed on origin chain"** | Origin chain delegation or UserOp signature missing | Check that both delegation and UserOp are signed for each origin chain |

### Delegation Errors

| Issue                    | Cause                                                      | Solution                                                                                                                 |
| ------------------------ | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| **`DELEGATION-001`**     | EOA has a pre-existing delegation to a non-Kernel contract | Revoke existing delegation or use a different EOA. See [error code reference](/api-reference/error-codes#delegation-001) |
| **"Nonce too low"**      | Outdated delegation nonce                                  | OneBalance handles this automatically; retry the request                                                                 |
| **"Already delegated"**  | EOA already delegated to this contract                     | Normal - no delegation object will be returned                                                                           |
| **"Contract not found"** | Using wrong Kernel v3.3 address                            | Use the contract address returned by OneBalance                                                                          |

### Account Configuration Errors

| Issue                            | Cause                                  | Solution                                                               |
| -------------------------------- | -------------------------------------- | ---------------------------------------------------------------------- |
| **"Account type not supported"** | Wrong account type configuration       | Must use `type: "kernel-v3.3-ecdsa"` and `deploymentType: "EIP7702"`   |
| **"Address mismatch"**           | Different signer and account addresses | Both `signerAddress` and `accountAddress` must be the same EOA address |

<Warning>
  **Critical**: Kernel v3.3 accounts require different signing patterns than role-based accounts. Always use UserOperation hash signing (`signMessage()`) instead of typed data signing (`signTypedData()`).
</Warning>

## Multi-Input Limitation

OneBalance's EIP-7702 implementation has one architectural limitation for all operations (swaps, transfers, contract calls): it can only handle single-transaction execution when you have assets on **≤1 source chain different from the destination chain**.

This limitation exists because OneBalance relies on external routing providers that don't yet support EIP-7702 authorization tuples in their multi-input APIs. Learn more about [how OneBalance works](/overview/how-onebalance-works).

### When You Need the Workaround

| Your Assets                 | Destination     | Result               |
| --------------------------- | --------------- | -------------------- |
| USDC on Optimism            | Arbitrum        | ✅ Single transaction |
| USDC on Optimism + Arbitrum | Arbitrum        | ✅ Single transaction |
| USDC on Optimism + Base     | Arbitrum        | ⚠️ Needs workaround  |
| USDC on 3+ different chains | Any destination | ⚠️ Needs workaround  |

<Info>
  This affects approximately 20% of operations. Most users will use the single-transaction flow without issues.
</Info>

## Manual Delegation Workaround

When you encounter the multi-input limitation, you need to manually delegate your EOAs before using OneBalance:

<Steps>
  <Step title="Manually Delegate on Required Chains">
    Submit EIP-7702 delegations directly to each chain where you have assets
  </Step>

  <Step title="Use Standard OneBalance Flow">
    Once delegated, use the normal OneBalance integration flow
  </Step>

  <Step title="Handle Interruptions">
    If the process is interrupted, you may need to manually complete transactions
  </Step>
</Steps>

### Manual Delegation Process

<Info>
  This requires a wallet library that supports EIP-7702 [`signAuthorization`](https://viem.sh/docs/eip7702/signAuthorization) method, such as [viem](https://viem.sh).
</Info>

```typescript theme={null}
import { createWalletClient, http } from 'viem';
import { optimism, base } from 'viem/chains';

// Submit delegation manually on each required chain
async function submitDelegation(chainId: number) {
  const walletClient = createWalletClient({
    chain: chainId === 10 ? optimism : base,
    transport: http()
  });

  const authorization = await walletClient.signAuthorization({
    contractAddress: "0xd6CEDDe84be40893d153Be9d467CD6aD37875b28", // Kernel v3.3
    nonce: 0 // Get current nonce from chain
  });

  const hash = await walletClient.sendTransaction({
    authorizationList: [authorization],
    data: "0x",
    to: walletClient.account.address,
  });
  
  return hash;
}
```

## Best Practices

* **Optimize for the 80%**: Most users will use the single-transaction flow without issues
* **Detect automatically**: Route users based on their asset distribution
* **Provide clear messaging**: Explain when and why the workaround is needed
* **Handle errors gracefully**: Implement proper error handling and recovery
* **Monitor success rates**: Track how often the workaround is needed

<Tip>
  Consider implementing a fallback that automatically detects when the single-transaction flow fails and offers the manual delegation alternative.
</Tip>

<Info>
  Most errors are automatically handled by OneBalance. The main issue you'll encounter is the multi-input limitation, which affects about 20% of operations. Learn more about [transaction lifecycle](/concepts/transaction-lifecycle).
</Info>

## Next Steps

<CardGroup cols={2}>
  <Card title="Getting Started" icon="rocket" href="/guides/eip-7702/getting-started">
    Learn the basic implementation flow
  </Card>

  <Card title="API Reference" icon="book" href="/api-reference/quotes/prepare-call-quote">
    Complete API documentation
  </Card>
</CardGroup>
