EIP7702 Integration Guide for Wallets
Intro, Why EIP7702
EIP7702 is an upcoming upgrade to Ethereum and EVM blockchains which enables wallets to convert the user EOA wallets into Smart Accounts
Biconomy has built the most comprehensive EIP7702 Solution on the market:
✅ Sponsor gas across all chains, with a single gas tank
Deposit funds to a single chain and use that to sponsor transactions for users across 30+ chains and rollups.
✅ Enable users to share gas across all supported chains
Your users can use their ETH, USDC, USDT (or any of the xy+ supported ERC20 tokens) to pay for gas on any chain.
✅ Unify User Balances Across all Chains
Treat user balances across all chains as if they're a single balance. Biconomy uses leading bridging and intent providers to make sure the funds are transferred with the best execution prices and fastest execution speed.
Quickstart Guide for Developers
Install Packages
Install AbstractJS TypeScript SDK and viem
npm install @biconomy/abstractjs viem
Sign a wallet authorization
In order add Smart Account capabilities to an EOA account, you must sign an authorization specifying which Smart Account address will be "installed" on the EOA address. In order to save on gas costs, you will be setting the authorization to a singleton contract - which means that no new contracts will need to be deployed.
// This is the address of the EOA to which
// address we'll be "installing" the smart account to.
const eoa = privateKeyToAccount('0xPrivateKey')
// Create an instance of a viem wallet client and extend it with the
// required eip7702 actions.
const walletClient = createWalletClient({
chain: odysseyTestnet,
account: eoa,
transport: http(),
}).extend(eip7702Actions())
const authorization = await walletClient.signAuthorization({
// Address of the Nexus Proxy Singleton
contractAddress: nexusProxyAddress
})
Initialize the Modular Execution Environment
const meeClient = createMeeClient({
nodeUrl: 'https://mee-node.biconomy.io'
})
Set up the Smart Account
Initialize the Smart Account you will be using for delegation. In this case, we'll be using Biconomy Nexus.
const account = await toMultichainNexusAccount({
chains: [odysseyTestnet],
signer: eoa,
// Override the address of the account to the EOA address
address: eoa.address
})
Execute a Supertransaction
const quote = await getQuote(meeClient, {
instructions: [
{
calls: [
{ to: zeroAddress, gasLimit: 100_000n, value: 0n }
],
chainId: optimism.id
}
],
feeToken: mcUSDC.on(optimism.id)
})
const hash = await executeQuote(meeSerivice, quote)