A Next.js application demonstrating the integration of EIP 7702 (Account Abstraction) using Gelato's infrastructure. This project showcases how to use EOAs as smart contract wallets with advanced features like gasless transactions to borrow and supply loan(USDC) from/to Morpho market.
- Smart EOA's using Gelato Smart Wallet SDK
- Sponsored transactions using Gelato Bundler via 1Balance
- Node.js 18.x or later
- Yarn package manager
- A Gelato API key
- A Dynamic Environment ID
- An RPC URL for your target network (Base Sepolia)
- Clone the repository:
git clone https://github.com/gelatodigital/eip7702-next-demo.git
cd eip7702-next-demo
- Checkout to 7702 SDK Branch:
git checkout gelato-7702-sdk-morpho
- Install dependencies:
yarn install
-
Set up environment variables:
- Copy
.env.example
to.env
- Fill in the required environment variables
- Copy
Note:- Currently the demo is configured to base sepolia
NEXT_PUBLIC_MORPHO_DYNAMIC_ENVIRONMENT_ID=your-dynamic-environment-id
NEXT_PUBLIC_MORPHO_GELATO_API_KEY="your-gelato-api-key"
NEXT_PUBLIC_MORPHO_RPC_URL="your-rpc-url"
Run the development server:
yarn run dev
The application will be available at http://localhost:3000
├── app/ # Next.js app directory
│ ├── providers.tsx # Web3 providers configuration
│ └── page.tsx # Main application page
├── components/ # React components
├── lib/ # Utility functions and configurations
├── public/ # Static assets
@gelatonetwork/smartwallet-react-sdk
: Gelato's 7702 React SDKviem
v2.28: Modern Ethereum libraryethers
: Ethereum library