Skip to content

Commit 71d7356

Browse files
AyushBherwani1998alexandratranbgravenorst
authored
Rename ERC-7715 to Advanced Permissions
* update ERC-7715 to Advanced Permissions * move erc-7715 out of experimental path * Apply suggestions from code review Co-authored-by: Alexandra Carrillo <[email protected]> * Apply suggestions from code review Co-authored-by: Byron Gravenorst <[email protected]> --------- Co-authored-by: Alexandra Carrillo <[email protected]> Co-authored-by: Byron Gravenorst <[email protected]>
1 parent e7e16a6 commit 71d7356

File tree

11 files changed

+82
-83
lines changed

11 files changed

+82
-83
lines changed
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
2-
description: Learn about MetaMask ERC-7715 permissions.
2+
description: Learn about MetaMask Advanced Permissions (ERC-7715).
33
keywords: [ERC-7715, 7715, permissions, wallet, smart account]
44
---
55

6-
# ERC-7715 permissions
6+
# Advanced Permissions (ERC-7715)
77

8-
The Smart Accounts Kit 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.
8+
The Smart Accounts Kit supports Advanced Permissions ([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.
99
For example, a user can grant your dapp permission to spend 10 USDC per day to buy ETH over the course of a month.
1010
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.
1111

12-
ERC-7715 eliminates the need for users to approve every transaction, which is useful for highly interactive dapps.
12+
Advanced Permissions eliminate the need for users to approve every transaction, which is useful for highly interactive dapps.
1313
It also enables dapps to execute transactions for users without an active wallet connection.
1414

1515
:::note
@@ -23,42 +23,42 @@ Dapps can use this method to request a wallet to grant the dapp permission to ex
2323
`wallet_grantPermissions` requires a `signer` parameter, which identifies the entity requesting or managing the permission.
2424
Common signer implementations include wallet signers, single key and multisig signers, and account signers.
2525

26-
The Smart Accounts Kit supports multiple types of signers, but [an account signer is used in this documentation's examples](../guides/erc7715/execute-on-metamask-users-behalf.md) as a common implementation.
27-
With an account signer, a session account is created and used for the single purpose of requesting and redeeming ERC-7715 permissions, and does not contain tokens.
26+
Smart Accounts Kit supports multiple signer types. The documentation uses [an account signer](../guides/advanced-permissions/execute-on-metamask-users-behalf.md) as a common implementation example.
27+
When you use an account signer, a session account is created solely to request and redeem Advanced Permissions, and doesn't contain tokens
2828
The session account can be granted with permissions and redeem them as specified in [ERC-7710](https://eips.ethereum.org/EIPS/eip-7710).
2929
The session account can be a smart account or an externally owned account (EOA).
3030

3131
The MetaMask user that the session account requests permissions from must be upgraded to a [MetaMask smart account](smart-accounts.md).
3232

33-
## ERC-7715 vs. delegations
33+
## Advanced Permissions vs. delegations
3434

35-
ERC-7715 expands on regular [delegations](delegation/index.md) by enabling permission sharing *via the MetaMask browser extension*.
35+
Advanced Permissions expand on regular [delegations](delegation/index.md) by enabling permission sharing *via the MetaMask browser extension*.
3636

3737
With regular delegations, the dapp constructs a delegation and requests the user to sign it.
3838
These delegations are not human-readable, so it is the dapp's responsibility to provide context for the user.
3939
Regular delegations cannot be signed through the MetaMask extension, because if a dapp requests a delegation without constraints, the whole wallet can be exposed to the dapp.
4040

41-
In contrast, ERC-7715 enables dapps (and AI agents) to request permissions from a user directly via the MetaMask extension.
42-
ERC-7715 requires a permission configuration which displays a human-readable confirmation for the MetaMask user.
41+
In contrast, Advanced Permissions enable dapps (and AI agents) to request permissions from a user directly via the MetaMask extension.
42+
Advanced Permissions require a permission configuration which displays a human-readable confirmation for the MetaMask user.
4343
The user can modify the permission parameters if the request is configured to allow adjustments.
4444

45-
For example, the following ERC-7715 permission request displays a rich UI including the start time, amount, and period duration for an [ERC-20 token periodic transfer](../guides/erc7715/use-permissions/erc20-token.md#erc-20-periodic-permission):
45+
For example, the following Advanced Permissions request displays a rich UI including the start time, amount, and period duration for an [ERC-20 token periodic transfer](../guides/advanced-permissions/use-permissions/erc20-token.md#erc-20-periodic-permission):
4646

4747
<p align="center">
4848
<img src={require("../assets/erc7715-request.png").default} alt="ERC-7715 request" width="450px" class="appScreen" />
4949
</p>
5050

51-
## ERC-7715 permissions lifecycle
51+
## Advanced Permissions lifecycle
5252

53-
The ERC-7715 permissions lifecycle is as follows:
53+
The Advanced Permissions lifecycle is as follows:
5454

5555
1. **Set up a session account** - Set up a session account to execute transactions on behalf of the MetaMask user.
5656
It can be a [smart account](smart-accounts.md) or an externally owned account (EOA).
5757

5858
2. **Request permissions** - Request permissions from the user.
59-
The Smart Accounts Kit supports [ERC-20 token permissions](../guides/erc7715/use-permissions/erc20-token.md) and
60-
[native token permissions](../guides/erc7715/use-permissions/native-token.md).
59+
The Smart Accounts Kit supports [ERC-20 token permissions](../guides/advanced-permissions/use-permissions/erc20-token.md) and
60+
[native token permissions](../guides/advanced-permissions/use-permissions/native-token.md).
6161

6262
4. **Redeem permissions** - Once the permission is granted, the session account can redeem the permission, executing on the user's behalf.
6363

64-
See [how to perform executions on a MetaMask user's behalf](../guides/erc7715/execute-on-metamask-users-behalf.md) to get started with the ERC-7715 lifecycle.
64+
See [how to perform executions on a MetaMask user's behalf](../guides/advanced-permissions/execute-on-metamask-users-behalf.md) to get started with the Advanced Permissions lifecycle.

delegation-toolkit/experimental/erc-7710-redeem-delegations.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ This data encodes the authority that lets the delegate redeem the permission.
6565
### Security considerations for `accountMeta`
6666

6767
When a user grants a permission, they can provide `accountMeta` which is an array of `factory` and `factoryData` values.
68-
These calls must be executed before redeeming the permission (this is handled for you in [`sendUserOperationWithDelegation`](../reference/erc7715/bundler-client.md#senduseroperationwithdelegation)).
68+
These calls must be executed before redeeming the permission (this is handled for you in [`sendUserOperationWithDelegation`](../reference/advanced-permissions/bundler-client.md#senduseroperationwithdelegation)).
6969

7070
Because each `accountMeta` is an arbitrary call specified by the granter, it is important that these are executed carefully.
7171
We recommend taking the following precautions:
@@ -86,7 +86,7 @@ Redeem a delegation with a [MetaMask smart account](#redeem-with-a-metamask-smar
8686
To redeem a delegation with a MetaMask smart account, [create a smart account](../guides/smart-accounts/create-smart-account.md)
8787
and a [Viem Bundler Client](https://viem.sh/account-abstraction/clients/bundler).
8888

89-
After setting up your Bundler Client, you can extend its functionality with `erc7710BundlerActions` actions to support ERC-7710. Once extended, use [`sendUserOperationWithDelegation`](../reference/erc7715/bundler-client.md#senduseroperationwithdelegation) to redeem the permission.
89+
After setting up your Bundler Client, you can extend its functionality with `erc7710BundlerActions` actions to support ERC-7710. Once extended, use [`sendUserOperationWithDelegation`](../reference/advanced-permissions/bundler-client.md#senduseroperationwithdelegation) to redeem the permission.
9090

9191
<Tabs>
9292
<TabItem value="example.ts">
@@ -128,7 +128,7 @@ import { createPublicClient, http, createBundlerClient } from "viem";
128128
import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";
129129
import { sepolia as chain } from "viem/chains";
130130
import { createBundlerClient } from "viem/account-abstraction";
131-
import { erc7710BundlerActions } from "@metamask/smart-accounts-kit/experimental";
131+
import { erc7710BundlerActions } from "@metamask/smart-accounts-kit/actions";
132132
import { toMetaMaskSmartAccount, Implementation } from "@metamask/smart-accounts-kit";
133133

134134
export const publicClient = createPublicClient({
@@ -168,7 +168,7 @@ export const bundlerClient = createBundlerClient({
168168

169169
To redeem a delegation with an EOA, create a [Viem Wallet Client](https://viem.sh/docs/clients/wallet).
170170

171-
After creating your Wallet Client, you can extend its functionality with `erc7710WalletActions` actions to support ERC-7710. Once extended, use [`sendTransactionWithDelegation`](../reference/erc7715/wallet-client.md#sendtransactionwithdelegation) to redeem the permission.
171+
After creating your Wallet Client, you can extend its functionality with `erc7710WalletActions` actions to support ERC-7710. Once extended, use [`sendTransactionWithDelegation`](../reference/advanced-permissions/wallet-client.md#sendtransactionwithdelegation) to redeem the permission.
172172

173173
<Tabs>
174174
<TabItem value="example.ts">
@@ -212,7 +212,7 @@ const hash = walletClient.sendTransactionWithDelegation({
212212
import { http, createPublicClient, createWalletClient } from "viem";
213213
import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";
214214
import { sepolia as chain } from "viem/chains";
215-
import { erc7710WalletActions } from "@metamask/smart-accounts-kit/experimental";
215+
import { erc7710WalletActions } from "@metamask/smart-accounts-kit/actions";
216216

217217
export const publicClient = createPublicClient({
218218
chain,

delegation-toolkit/experimental/erc-7715-request-permissions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const grantedPermissions = await walletClient.grantPermissions([{
6363
import { createWalletClient, custom, createPublicClient, http } from "viem";
6464
import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";
6565
import { sepolia as chain } from "viem/chains";
66-
import { erc7715ProviderActions } from "@metamask/smart-accounts-kit/experimental";
66+
import { erc7715ProviderActions } from "@metamask/smart-accounts-kit/actions";
6767
import { toMetaMaskSmartAccount, Implementation } from "@metamask/smart-accounts-kit";
6868

6969
const publicClient = createPublicClient({
@@ -165,7 +165,7 @@ You should always verify the granted permissions and adjust your dapp's behavior
165165
## Security considerations for `accountMeta`
166166

167167
When a user grants a permission, they can provide [`accountMeta`](erc-7710-redeem-delegations.md#extract-relevant-data) which is an array of `factory` and `factoryData` values.
168-
These calls must be executed before redeeming the permission (this is handled for you in [`sendUserOperationWithDelegation`](../reference/erc7715/bundler-client.md#senduseroperationwithdelegation)).
168+
These calls must be executed before redeeming the permission (this is handled for you in [`sendUserOperationWithDelegation`](../reference/advanced-permissions/bundler-client.md#senduseroperationwithdelegation)).
169169

170170
Because each `accountMeta` is an arbitrary call specified by the granter, it is important that these are executed carefully.
171171
We recommend taking the following precautions:

delegation-toolkit/guides/erc7715/execute-on-metamask-users-behalf.md renamed to delegation-toolkit/guides/advanced-permissions/execute-on-metamask-users-behalf.md

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
2-
description: Use ERC-7715 permissions to perform executions on a MetaMask user's behalf.
2+
description: Use Advanced Permissions (ERC-7115) to perform executions on a MetaMask user's behalf.
33
sidebar_label: Execute on a MetaMask user's behalf
4-
keywords: [execution, smart account, create, redeem, delegation, erc 7715, 7715, session account]
4+
keywords: [execution, smart account, create, redeem, delegation, erc 7715, 7715, session account, advanced permissions]
55
---
66

77
import Tabs from "@theme/Tabs";
88
import TabItem from "@theme/TabItem";
99

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

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
12+
[Advanced Permissions (ERC-7115)](../../concepts/advanced-permissions.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.
@@ -26,12 +26,11 @@ In this guide, you'll request an ERC-20 periodic transfer permission from a Meta
2626
Set up a [Viem Wallet Client](https://viem.sh/docs/clients/wallet) using Viem's `createWalletClient` function. This client will
2727
help you interact with MetaMask Flask.
2828

29-
Then, extend the Wallet Client functionality using `erc7715ProviderActions`. These actions enable you to request ERC-7715
30-
permissions from the user.
29+
Then, extend the Wallet Client functionality using `erc7715ProviderActions`. These actions enable you to request Advanced Permissions from the user.
3130

3231
```typescript
3332
import { createWalletClient, custom } from "viem";
34-
import { erc7715ProviderActions } from "@metamask/smart-accounts-kit/experimental";
33+
import { erc7715ProviderActions } from "@metamask/smart-accounts-kit/actions";
3534

3635
const walletClient = createWalletClient({
3736
transport: custom(window.ethereum),
@@ -56,7 +55,7 @@ const publicClient = createPublicClient({
5655
### 3. Set up a session account
5756

5857
Set up a session account which can either be a smart account or an externally owned account (EOA)
59-
to request ERC-7715 permissions. The requested permissions are granted to the session account, which
58+
to request Advanced Permissions. The requested permissions are granted to the session account, which
6059
is responsible for executing transactions on behalf of the user.
6160

6261
<Tabs>
@@ -97,14 +96,14 @@ const sessionAccount = privateKeyToAccount("0x...");
9796

9897
### 4. Check the EOA account code
9998

100-
Currently, ERC-7715 does not support automatically upgrading a MetaMask user's account to a [MetaMask smart account](../../concepts/smart-accounts.md). Therefore, you must
101-
ensure that the user is upgraded to a smart account before requesting ERC-7715 permissions.
99+
Currently, Advanced Permissions do not support automatically upgrading a MetaMask user's account to a [MetaMask smart account](../../concepts/smart-accounts.md). Therefore, you must
100+
ensure that the user is upgraded to a smart account before requesting Advanced Permissions.
102101

103102
If the user has not yet been upgraded, you can handle the upgrade [programmatically](/wallet/how-to/send-transactions/send-batch-transactions/#about-atomic-batch-transactions) or ask the
104103
user to [switch to a smart account manually](https://support.metamask.io/configure/accounts/switch-to-or-revert-from-a-smart-account/#how-to-switch-to-a-metamask-smart-account).
105104

106105
:::info Why is a Smart Account upgrade is required?
107-
MetaMask's ERC-7715 implementation requires the user to be upgraded to a MetaMask
106+
MetaMask's Advanced Permissions (ERC-7115) implementation requires the user to be upgraded to a MetaMask
108107
Smart Account because, under the hood, you're requesting a signature for an [ERC-7710 delegation](../../concepts/delegation/index.md).
109108
ERC-7710 delegation is one of the core features supported only by MetaMask Smart Accounts.
110109
:::
@@ -138,11 +137,11 @@ if (code) {
138137
}
139138
```
140139

141-
### 5. Request ERC-7715 permissions
140+
### 5. Request Advanced Permissions
142141

143-
Request ERC-7715 permissions from the user. In this example, you'll request an
142+
Request Advanced Permissions from the user. In this example, you'll request an
144143
[ERC-20 periodic permission](use-permissions/erc20-token.md#erc-20-periodic-permission) using the Wallet Client's
145-
[`requestExecutionPermissions`](../../reference/erc7715/wallet-client.md#requestexecutionpermissions) action.
144+
[`requestExecutionPermissions`](../../reference/advanced-permissions/wallet-client.md#requestexecutionpermissions) action.
146145

147146
```typescript
148147
import { sepolia as chain } from "viem/chains";
@@ -193,14 +192,14 @@ to estimate gas for user operations and submit transactions to the network.
193192
For an EOA, set up a [Viem Wallet Client](https://viem.sh/docs/clients/wallet)
194193
using Viem's `createWalletClient` function. This lets you send transactions directly to the network.
195194

196-
The toolkit provides public actions for both of the clients which can be used to redeem ERC-7715 permissions, and execute transactions on a user's behalf.
195+
The toolkit provides public actions for both of the clients which can be used to redeem Advanced Permissions, and execute transactions on a user's behalf.
197196

198197
<Tabs>
199198
<TabItem value="Smart account">
200199

201200
```typescript
202201
import { createBundlerClient } from "viem/account-abstraction";
203-
import { erc7710BundlerActions } from "@metamask/smart-accounts-kit/experimental";
202+
import { erc7710BundlerActions } from "@metamask/smart-accounts-kit/actions";
204203

205204
const bundlerClient = createBundlerClient({
206205
client: publicClient,
@@ -215,7 +214,7 @@ const bundlerClient = createBundlerClient({
215214

216215
```typescript
217216
import { createWalletClient, http } from "viem";
218-
import { erc7710WalletActions } from "@metamask/smart-accounts-kit/experimental";
217+
import { erc7710WalletActions } from "@metamask/smart-accounts-kit/actions";
219218
import { sepolia as chain } from "viem/chains";
220219

221220
const sessionAccountWalletClient = createWalletClient({
@@ -229,13 +228,13 @@ const sessionAccountWalletClient = createWalletClient({
229228
</Tabs>
230229

231230

232-
### 7. Redeem ERC-7715 permissions
231+
### 7. Redeem Advanced Permissions
233232

234233
The session account can now redeem the permissions. The redeem transaction is sent to the `DelegationManager` contract, which validates the delegation and executes actions on the user's behalf.
235234

236235
To redeem the permissions, use the client action based on your session account type.
237-
A smart account uses the Bundler Client's [`sendUserOperationWithDelegation`](../../reference/erc7715/bundler-client.md#senduseroperationwithdelegation) action,
238-
and an EOA uses the Wallet Client's [`sendTransactionWithDelegation`](../../reference/erc7715/wallet-client.md#sendtransactionwithdelegation) action:
236+
A smart account uses the Bundler Client's [`sendUserOperationWithDelegation`](../../reference/advanced-permissions/bundler-client.md#senduseroperationwithdelegation) action,
237+
and an EOA uses the Wallet Client's [`sendTransactionWithDelegation`](../../reference/advanced-permissions/wallet-client.md#sendtransactionwithdelegation) action:
239238

240239
<Tabs>
241240
<TabItem value="Smart account">

delegation-toolkit/guides/erc7715/use-permissions/erc20-token.md renamed to delegation-toolkit/guides/advanced-permissions/use-permissions/erc20-token.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
description: Learn how to use the ERC-20 token permissions with ERC-7715.
2+
description: Learn how to use the ERC-20 token permissions with Advanced Permissions (ERC-7715).
33
keywords: [permissions, spending limit, restrict, 7715, erc-7715, erc20-permissions]
44
---
55

@@ -8,7 +8,7 @@ import TabItem from "@theme/TabItem";
88

99
# Use ERC-20 token permissions
1010

11-
[ERC-7715](https://eips.ethereum.org/EIPS/eip-7715) supports ERC-20 token permission types that allow you to request fine-grained
11+
[Advanced Permissions (ERC-7715)](../../../concepts/advanced-permissions.md) supports ERC-20 token permission types that allow you to request fine-grained
1212
permissions for ERC-20 token transfers with time-based (periodic) or streaming conditions, depending on your use case.
1313

1414
## Prerequisites
@@ -73,7 +73,7 @@ const grantedPermissions = await walletClient.requestExecutionPermissions([{
7373

7474
```typescript
7575
import { createWalletClient, custom } from "viem";
76-
import { erc7715ProviderActions } from "@metamask/smart-accounts-kit/experimental";
76+
import { erc7715ProviderActions } from "@metamask/smart-accounts-kit/actions";
7777

7878
export const walletClient = createWalletClient({
7979
transport: custom(window.ethereum),
@@ -144,7 +144,7 @@ const grantedPermissions = await walletClient.requestExecutionPermissions([{
144144

145145
```typescript
146146
import { createWalletClient, custom } from "viem";
147-
import { erc7715ProviderActions } from "@metamask/smart-accounts-kit/experimental";
147+
import { erc7715ProviderActions } from "@metamask/smart-accounts-kit/actions";
148148

149149
export const walletClient = createWalletClient({
150150
transport: custom(window.ethereum),

0 commit comments

Comments
 (0)