Skip to content

Commit ba12a01

Browse files
committed
Add ERC-7715 concept page
1 parent 861c690 commit ba12a01

File tree

4 files changed

+53
-5
lines changed

4 files changed

+53
-5
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
description: Learn about MetaMask ERC-7715 permissions.
3+
keywords: [ERC-7715, 7715, permissions, wallet, smart account]
4+
---
5+
6+
# ERC-7715 permissions
7+
8+
The Delegation Toolkit supports [ERC-7715](https://eips.ethereum.org/EIPS/eip-7715), which lets you request fine-grained permissions from a MetaMask user to execute transactions on their behalf.
9+
For example, a user can grant your dapp permission to spend 10 USDC per day to buy ETH over the course of a month.
10+
Once the permission is granted, your dapp can use the allocated 10 USDC each day to purchase ETH directly from the MetaMask user's account.
11+
12+
ERC-7715 eliminates the need for users to approve every transaction, which is useful for highly interactive dapps.
13+
It also enables dapps to execute transactions for users without an active wallet connection.
14+
15+
:::note
16+
This feature requires [MetaMask Flask 12.14.2](/snaps/get-started/install-flask) or later.
17+
:::
18+
19+
## ERC-7715 permissions lifecycle
20+
21+
The ERC-7715 permissions lifecycle is as follows:
22+
23+
1. **Set up a session account** - Set up a session account to execute transactions on behalf of the MetaMask user.
24+
It can be a [smart account](smart-accounts.md) or an externally owned account (EOA).
25+
26+
2. **Request permissions** - Request permissions from the user.
27+
MetaMask supports multiple ERC-7715 [permission types](#permission-types).
28+
29+
3. **Set up a Viem client** - Set up a Viem client (the client type depends on the session account type) to redeem permissions.
30+
31+
4. **Redeem permissions** - Once the permission is granted, the session account redeems the permission.
32+
33+
See [how to perform executions on a MetaMask user's behalf](../guides/erc7715/execute-on-metamask-user-behalf.md) to get started with the ERC-7715 lifecycle.
34+
35+
## Permission types
36+
37+
The Delegation Toolkit currently supports the following types of ERC-7715 permissions:
38+
39+
- **Native token permissions** - Define how dapps can use users' native tokens.
40+
41+
- **ERC-20 token permissions** - Define how dapps can use users' ERC-20 tokens.
42+
43+
## ERC-7715 permissions vs. delegation
44+
45+
Requesting and redeeming ERC-7715 permissions differ from [creating and redeeming delegations](delegation/index.md).

delegation-toolkit/guides/erc7715/execute-on-metamask-user-behalf.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import TabItem from "@theme/TabItem";
99

1010
# Perform executions on a MetaMask user's behalf
1111

12-
The Delegation Toolkit supports [ERC-7715](https://eips.ethereum.org/EIPS/eip-7715), which lets you request fine-grained permissions from a MetaMask user to execute transactions on their
12+
[ERC-7715 permissions](../../concepts/erc7715.md) are fine-grained permissions that your dapp can request from a MetaMask user to execute transactions on their
1313
behalf. For example, a user can grant your dapp permission to spend 10 USDC per day to buy ETH over the course
1414
of a month. Once the permission is granted, your dapp can use the allocated 10 USDC each day to
1515
purchase ETH directly from the MetaMask user's account.
@@ -41,7 +41,7 @@ const walletClient = createWalletClient({
4141
### 2. Set up a Public Client
4242

4343
Set up a [Viem Public Client](https://viem.sh/docs/clients/public) using Viem's `createPublicClient` function.
44-
This client will help you query the account state and interact with blockchain network.
44+
This client will help you query the account state and interact with the blockchain network.
4545

4646
```typescript
4747
import { createPublicClient, http } from "viem";
@@ -60,7 +60,7 @@ to request ERC-7715 permissions. This account is responsible for executing trans
6060
on behalf of the user.
6161

6262
<Tabs>
63-
<TabItem value="Smart Account">
63+
<TabItem value="Smart account">
6464

6565
```typescript
6666
import { privateKeyToAccount } from "viem/accounts";
@@ -183,7 +183,7 @@ const sessionAccountWalletClient = createWalletClient({
183183

184184
### 6. Redeem ERC-7715 permissions
185185

186-
The session account can now [redeem the delegation](../experimental/erc-7710-redeem-delegations.md). The redeem transaction is sent to the `DelegationManager` contract, which validates the delegation and executes actions on the user's behalf.
186+
The session account can now redeem the delegation. The redeem transaction is sent to the `DelegationManager` contract, which validates the delegation and executes actions on the user's behalf.
187187

188188
To redeem the permissions, use the appropriate client action based on your session account type:
189189

delegation-toolkit/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ keywords: [MetaMask, delegation toolkit, smart accounts]
77

88
import CardList from "@site/src/components/CardList"
99

10-
# Embed MetaMask Smart Accounts using the Delegation Toolkit
10+
# Create MetaMask Smart Accounts using the Delegation Toolkit
1111

1212
The MetaMask Delegation Toolkit is a [Viem](https://viem.sh/)-based collection of tools for embedding [MetaMask Smart Accounts](concepts/smart-accounts.md) into dapps.
1313
Smart accounts support programmable account behavior and advanced features like delegated permissions, multi-signature approvals, and gas abstraction.
@@ -16,6 +16,8 @@ Smart accounts support programmable account behavior and advanced features like
1616
Delegation is powered by the toolkit's Delegation Framework, which defines how
1717
permissions are created, shared, and enforced.
1818

19+
MetaMask Smart Accounts also support [ERC-7715 permissions](concepts/erc7715.md), which are fine-grained permissions dapps can request from MetaMask users.
20+
1921
## Why use the toolkit?
2022

2123
The toolkit enables developers to create frictionless new experiences based on programmable account behavior and granular permission

gator-sidebar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const sidebar = {
4343
'concepts/delegation/caveat-enforcers',
4444
],
4545
},
46+
'concepts/erc7715',
4647
],
4748
},
4849
{

0 commit comments

Comments
 (0)