Skip to content

Commit e7e16a6

Browse files
ERC-7715 hot fixes
* fix 7715 permissions code snippets * update versioned docs * improve 7715 docs
1 parent 0d6e6a0 commit e7e16a6

File tree

8 files changed

+68
-30
lines changed

8 files changed

+68
-30
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ const publicClient = createPublicClient({
5656
### 3. Set up a session account
5757

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

6262
<Tabs>
6363
<TabItem value="Smart account">
@@ -97,7 +97,7 @@ const sessionAccount = privateKeyToAccount("0x...");
9797

9898
### 4. Check the EOA account code
9999

100-
Currently, ERC-7715 does not support automatically upgrading a user's account to a [MetaMask smart account](../../concepts/smart-accounts.md). Therefore, you must
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
101101
ensure that the user is upgraded to a smart account before requesting ERC-7715 permissions.
102102

103103
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
@@ -162,6 +162,8 @@ const grantedPermissions = await walletClient.requestExecutionPermissions([{
162162
signer: {
163163
type: "account",
164164
data: {
165+
// The requested permissions will granted to the
166+
// session account.
165167
address: sessionAccount.address,
166168
},
167169
},

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ const grantedPermissions = await walletClient.requestExecutionPermissions([{
4747
type: "account",
4848
data: {
4949
// Session account created as a prerequisite.
50+
//
51+
// The requested permissions will granted to the
52+
// session account.
5053
address: sessionAccountAddress,
5154
},
5255
},
@@ -61,6 +64,7 @@ const grantedPermissions = await walletClient.requestExecutionPermissions([{
6164
justification?: "Permission to transfer 1 USDC every day",
6265
},
6366
},
67+
isAdjustmentAllowed: true,
6468
}]);
6569
```
6670

@@ -111,6 +115,9 @@ const grantedPermissions = await walletClient.requestExecutionPermissions([{
111115
type: "account",
112116
data: {
113117
// Session account created as a prerequisite.
118+
//
119+
// The requested permissions will granted to the
120+
// session account.
114121
address: sessionAccountAddress,
115122
},
116123
},
@@ -128,6 +135,7 @@ const grantedPermissions = await walletClient.requestExecutionPermissions([{
128135
justification: "Permission to use 0.1 USDC per second",
129136
},
130137
},
138+
isAdjustmentAllowed: true,
131139
}]);
132140
```
133141

delegation-toolkit/guides/erc7715/use-permissions/native-token.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ const grantedPermissions = await walletClient.requestExecutionPermissions([{
4444
type: "account",
4545
data: {
4646
// Session account created as a prerequisite.
47+
//
48+
// The requested permissions will granted to the
49+
// session account.
4750
address: sessionAccountAddress,
4851
},
4952
},
@@ -58,6 +61,7 @@ const grantedPermissions = await walletClient.requestExecutionPermissions([{
5861
justification: "Permission to use 0.001 ETH every day",
5962
},
6063
},
64+
isAdjustmentAllowed: true,
6165
}]);
6266
```
6367

@@ -105,22 +109,26 @@ const grantedPermissions = await walletClient.requestExecutionPermissions([{
105109
type: "account",
106110
data: {
107111
// Session account created as a prerequisite.
112+
//
113+
// The requested permissions will granted to the
114+
// session account.
108115
address: sessionAccountAddress,
109116
},
110117
},
111-
permission: {
112-
type: "native-token-stream",
113-
data: {
114-
// 0.0001 ETH in wei format.
115-
amountPerSecond: parseEther("0.0001"),
116-
// 0.1 ETH in wei format.
117-
initialAmount: parseEther("0.1"),
118-
// 1 ETH in wei format.
119-
maxAmount: parseEther("1"),
120-
startTime: currentTime,
121-
justification: "Permission to use 0.0001 ETH per second",
122-
},
118+
permission: {
119+
type: "native-token-stream",
120+
data: {
121+
// 0.0001 ETH in wei format.
122+
amountPerSecond: parseEther("0.0001"),
123+
// 0.1 ETH in wei format.
124+
initialAmount: parseEther("0.1"),
125+
// 1 ETH in wei format.
126+
maxAmount: parseEther("1"),
127+
startTime: currentTime,
128+
justification: "Permission to use 0.0001 ETH per second",
123129
},
130+
},
131+
isAdjustmentAllowed: true,
124132
}]);
125133
```
126134

delegation-toolkit/reference/erc7715/wallet-client.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const grantedPermissions = await walletClient.requestExecutionPermissions([{
5050
signer: {
5151
type: "account",
5252
data: {
53+
// The requested permissions will granted to the address.
5354
address: "0x0955fFD7b83e5493a8c1FD5dC87e2CF37Eacc44a",
5455
},
5556
},

gator_versioned_docs/version-0.13.0/guides/erc7715/execute-on-metamask-users-behalf.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ const publicClient = createPublicClient({
5656
### 3. Set up a session account
5757

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

6262
<Tabs>
6363
<TabItem value="Smart account">
@@ -97,7 +97,7 @@ const sessionAccount = privateKeyToAccount("0x...");
9797

9898
### 4. Check the EOA account code
9999

100-
Currently, ERC-7715 does not support automatically upgrading a user's account to a [MetaMask smart account](../../concepts/smart-accounts.md). Therefore, you must
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
101101
ensure that the user is upgraded to a smart account before requesting ERC-7715 permissions.
102102

103103
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
@@ -162,6 +162,8 @@ const grantedPermissions = await walletClient.requestExecutionPermissions([{
162162
signer: {
163163
type: "account",
164164
data: {
165+
// The requested permissions will granted to the
166+
// session account.
165167
address: sessionAccount.address,
166168
},
167169
},

gator_versioned_docs/version-0.13.0/guides/erc7715/use-permissions/erc20-token.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ const grantedPermissions = await walletClient.requestExecutionPermissions([{
4747
type: "account",
4848
data: {
4949
// Session account created as a prerequisite.
50+
//
51+
// The requested permissions will granted to the
52+
// session account.
5053
address: sessionAccountAddress,
5154
},
5255
},
@@ -61,6 +64,7 @@ const grantedPermissions = await walletClient.requestExecutionPermissions([{
6164
justification?: "Permission to transfer 1 USDC every day",
6265
},
6366
},
67+
isAdjustmentAllowed: true,
6468
}]);
6569
```
6670

@@ -111,6 +115,9 @@ const grantedPermissions = await walletClient.requestExecutionPermissions([{
111115
type: "account",
112116
data: {
113117
// Session account created as a prerequisite.
118+
//
119+
// The requested permissions will granted to the
120+
// session account.
114121
address: sessionAccountAddress,
115122
},
116123
},
@@ -128,6 +135,7 @@ const grantedPermissions = await walletClient.requestExecutionPermissions([{
128135
justification: "Permission to use 0.1 USDC per second",
129136
},
130137
},
138+
isAdjustmentAllowed: true,
131139
}]);
132140
```
133141

gator_versioned_docs/version-0.13.0/guides/erc7715/use-permissions/native-token.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ const grantedPermissions = await walletClient.requestExecutionPermissions([{
4444
type: "account",
4545
data: {
4646
// Session account created as a prerequisite.
47+
//
48+
// The requested permissions will granted to the
49+
// session account.
4750
address: sessionAccountAddress,
4851
},
4952
},
@@ -58,6 +61,7 @@ const grantedPermissions = await walletClient.requestExecutionPermissions([{
5861
justification: "Permission to use 0.001 ETH every day",
5962
},
6063
},
64+
isAdjustmentAllowed: true,
6165
}]);
6266
```
6367

@@ -105,22 +109,26 @@ const grantedPermissions = await walletClient.requestExecutionPermissions([{
105109
type: "account",
106110
data: {
107111
// Session account created as a prerequisite.
112+
//
113+
// The requested permissions will granted to the
114+
// session account.
108115
address: sessionAccountAddress,
109116
},
110117
},
111-
permission: {
112-
type: "native-token-stream",
113-
data: {
114-
// 0.0001 ETH in wei format.
115-
amountPerSecond: parseEther("0.0001"),
116-
// 0.1 ETH in wei format.
117-
initialAmount: parseEther("0.1"),
118-
// 1 ETH in wei format.
119-
maxAmount: parseEther("1"),
120-
startTime: currentTime,
121-
justification: "Permission to use 0.0001 ETH per second",
122-
},
118+
permission: {
119+
type: "native-token-stream",
120+
data: {
121+
// 0.0001 ETH in wei format.
122+
amountPerSecond: parseEther("0.0001"),
123+
// 0.1 ETH in wei format.
124+
initialAmount: parseEther("0.1"),
125+
// 1 ETH in wei format.
126+
maxAmount: parseEther("1"),
127+
startTime: currentTime,
128+
justification: "Permission to use 0.0001 ETH per second",
123129
},
130+
},
131+
isAdjustmentAllowed: true,
124132
}]);
125133
```
126134

gator_versioned_docs/version-0.13.0/reference/erc7715/wallet-client.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const grantedPermissions = await walletClient.requestExecutionPermissions([{
5050
signer: {
5151
type: "account",
5252
data: {
53+
// The requested permissions will granted to the address.
5354
address: "0x0955fFD7b83e5493a8c1FD5dC87e2CF37Eacc44a",
5455
},
5556
},

0 commit comments

Comments
 (0)