Skip to content

Commit ea4da7b

Browse files
committed
7702 docs
1 parent 72402b9 commit ea4da7b

File tree

2 files changed

+68
-2
lines changed
  • apps/portal/src/app
    • dotnet/wallets/providers/account-abstraction
    • unity/v5/wallets/account-abstraction

2 files changed

+68
-2
lines changed

apps/portal/src/app/dotnet/wallets/providers/account-abstraction/page.mdx

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,49 @@ export const metadata = createMetadata({
66
"Instantiate a SmartWallet for enhanced user interactions with blockchain applications.",
77
});
88

9-
# SmartWallet.Create
9+
# Native Account Abstraction (via EIP-7702 Smart EOAs)
10+
11+
With the recent Ethereum upgrade Pectra, EIP-7702 allows you to upgrade your EOA and get SmartWallet-like functionality with:
12+
- Much cheaper gas costs, batching functionality
13+
- No account separation - your wallet address does not change, not even on zksync chains (once they implement EIP-7702)
14+
- Much faster execution, with the option of paying for gas yourself or having thirdweb manage gas sponsorship, similar to SmartWallet.
15+
16+
The API is also drastically simplified!
17+
18+
### ExecutionMode.EIP7702Sponsored**
19+
Upgrade to an EIP7702 smart account, unlocking all functionality of 4337 without the downsides, and thirdweb handles the execution and gas sponsorship for you!
20+
```csharp
21+
var smartEoa = await InAppWallet.Create(
22+
client: thirdwebClient,
23+
authProvider: AuthProvider.Google,
24+
executionMode: ExecutionMode.EIP7702
25+
);
26+
```
27+
28+
### ExecutionMode.EIP7702
29+
Upgrade to an EIP7702 smart account, unlocking all functionality of 4337 without the downsides, but sponsoring gas yourself.
30+
```csharp
31+
var smartEoa = await InAppWallet.Create(
32+
client: thirdwebClient,
33+
authProvider: AuthProvider.Google,
34+
executionMode: ExecutionMode.EIP7702
35+
);
36+
```
37+
38+
### ExecutionMode.EOA
39+
Normal" EOA Execution, no smart account functionality
40+
```csharp
41+
var basicEoa = await InAppWallet.Create(
42+
client: thirdwebClient,
43+
authProvider: AuthProvider.Google,
44+
// does not need to be explicitly passed, is the default but we're showing it here
45+
executionMode: ExecutionMode.EOA
46+
);
47+
```
48+
49+
_When using EIP-7702 execution modes, upon your first transaction - if not already delegated to a smart account - an EIP-7702 authorization will be signed and bundled with your first transaction, similar to how 4337 works with initcode, but without the large gas costs, slower execution and chain specific requirements._
50+
51+
# SmartWallet (via EIP-4337 Bundlers)
1052

1153
Instantiate a `SmartWallet` to enable advanced blockchain interactions, including gasless transactions through account abstraction. This wallet type is especially useful for creating a user-friendly experience in decentralized applications.
1254

apps/portal/src/app/unity/v5/wallets/account-abstraction/page.mdx

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,31 @@ export const metadata = createMetadata({
77
"Instantiate a SmartWallet to sign transactions and messages.",
88
});
99

10-
# SmartWallet
10+
# Native Account Abstraction (via EIP-7702 Smart EOAs)
11+
Native Account Abstraction is a system that allows you to set code to an EOA, unlocking a world of possibilities to enhance their functionality. It is available since the Pectra upgrade on various chains.
12+
13+
Enabling it is as simple as creating an `InAppWallet` and passing the `ExecutionMode.EIP7702Sponsored` flag during creation.
14+
15+
```csharp
16+
// Turn your boring EOAs into Smart EOAs!
17+
var smartIaw = await ConnectWallet(
18+
new WalletOptions(
19+
provider: WalletProvider.InAppWallet,
20+
chainId: 11155111, // Sepolia supports EIP-7702
21+
inAppWalletOptions: new InAppWalletOptions(
22+
authprovider: AuthProvider.Google,
23+
executionMode: ExecutionMode.EIP7702Sponsored // new!
24+
)
25+
)
26+
);
27+
ThirdwebDebug.Log("Connected to InAppWallet: " + await smartIaw.GetAddress());
28+
29+
// Execute a transaction as usual, execution is managed by thirdweb seamlessly!
30+
var receipt = await smartIaw.Transfer(11155111, await smartIaw.GetAddress(), 0);
31+
ThirdwebDebug.Log($"Transfer receipt: https://sepolia.etherscan.io/tx/{receipt.TransactionHash}");
32+
```
33+
34+
# SmartWallet (via EIP-4337 Bundlers)
1135

1236
Instantiate or upgrade any other wallet to a `SmartWallet` to enable advanced blockchain interactions, including gasless transactions through Account Abstraction (ERC4337 as well as ZkSync Native AA).
1337

0 commit comments

Comments
 (0)