Skip to main content

Overview

This guide shows how to integrate thirdweb’s EIP-7702 Account Abstraction SDK into your dApp. EIP-7702 is the next generation of account abstraction. It lets externally owned accounts (EOAs) temporarily behave like smart contracts. This makes gasless transactions and advanced wallet features possible. Users do not need to migrate to new wallet addresses.

What this guide covers

  • Understanding EIP-7702
  • Setting up a React application with thirdweb’s EIP-7702 implementation
  • Implementing social logins with smart account features
  • Creating gasless transactions on Sei

Prerequisites

Before you start, make sure that you have:
  • Node.js v18 or later installed
  • Basic knowledge of React and TypeScript
  • A thirdweb account with an API key from the thirdweb dashboard
  • For Sei Mainnet: An active thirdweb Pay As You Go subscription ($5/month minimum) for gas sponsorship

What is EIP-7702?

EIP-7702 is an Ethereum Improvement Proposal that introduces native account abstraction. It lets EOAs temporarily delegate execution to smart contracts. This approach has several advantages over traditional ERC-4337 implementations:
  • Same address: Users keep their existing EOA address. They do not need to migrate to a new smart contract wallet.
  • Native protocol support: It is built into the protocol layer and does not need external bundler infrastructure.
  • Lower gas costs: It is more efficient than ERC-4337, because it does not need separate UserOperation bundling.
  • Temporary delegation: EOAs can temporarily act as smart contracts for a single transaction and then return to normal behavior.
  • Backward compatible: It works with existing wallets and infrastructure without breaking changes.

Sei network configuration

Sei Testnet:
  • RPC URL: https://evm-rpc-testnet.sei-apis.com
  • Chain ID: 1328
  • Block explorer: Seiscan Testnet
Sei Mainnet:
  • RPC URL: https://evm-rpc.sei-apis.com
  • Chain ID: 1329
  • Block explorer: Seiscan

Step 1: Deploy a Storage contract

For this example, deploy a simple Storage contract that stores and retrieves numbers. The contract demonstrates gasless transactions and smart account features with EIP-7702.

Storage contract (Solidity)

Deploy this contract with Remix or your preferred deployment tool. Save the contract address, because you need it later.

Step 2: Project setup

Create a new project

Install dependencies

Install and configure Tailwind CSS

Install Tailwind CSS and its dependencies:
Update tailwind.config.js:
Replace the contents of src/index.css with this code:

Configure environment variables

Create a .env file in your project root:
Get your Client ID from the thirdweb dashboard under Project → Overview.

Enable gas sponsorship (production)

To sponsor gas on Sei Mainnet:
  1. Go to the billing settings in the thirdweb dashboard.
  2. Subscribe to the Pay As You Go plan ($5/month minimum).
  3. Enable gas sponsorship in your project settings.

Step 3: Configure Vite

Create or update vite.config.ts:

Step 4: Configure thirdweb client

Create src/client.ts:

Step 5: Setup ThirdwebProvider

First, update src/main.tsx to include ThirdwebProvider:

Step 6: EIP-7702 smart account implementation

Replace src/App.tsx with the complete EIP-7702 implementation. Key configuration: The executionMode configuration enables EIP-7702 features:
  • mode: "EIP7702": Enables EIP-7702 account abstraction. The EOA temporarily acts as a smart contract.
  • sponsorGas: true: Enables gasless transactions. thirdweb pays the gas for users.

Step 7: Package configuration

Update your package.json:

Step 8: Run the application

Start development server

Test EIP-7702 features

  1. Open http://localhost:5173 in your browser.
  2. Connect with any social login, such as Google or email.
  3. Observe that the smart account is created automatically, without gas.
  4. Test the gasless storage operations:
    • To store the predefined value (37), click Store 37.
    • To store a custom number, click Store Custom Number.
    • Read the stored value that the interface displays.
  5. Monitor the console for transaction hashes and status updates.
  6. View more details in your thirdweb dashboard.

Troubleshooting

Network issues

If you have connectivity problems:
  1. Check the thirdweb status page.
  2. Make sure that your API key is active and has sufficient credits.
  3. Make sure that you are connected to the correct network: EVM chain ID 1329 for Sei Mainnet, or 1328 for Sei Testnet.

Transaction verification

After a successful transaction, you can verify it on the block explorer: Search for your transaction hash to see the full details, including gas used, status, and event logs.

Resources

thirdweb documentation & tools