Skip to content

Commit 7c079f4

Browse files
lock files for v0.11.0
1 parent 539cca5 commit 7c079f4

26 files changed

+2054
-891
lines changed

gator_versioned_docs/version-0.11.0/concepts/caveat-enforcers.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,15 @@ The `CaveatBuilder` provides a developer-friendly TypeScript API that:
127127
- Provides type-checking and validation for caveat parameters.
128128
- Handles the creation of the `caveats` array needed when creating a delegation.
129129

130-
Each [caveat type](../how-to/create-delegation/restrict-delegation.md#caveat-types) in the `CaveatBuilder`
130+
Each [caveat type](../reference/caveats.md) in the `CaveatBuilder`
131131
corresponds to a specific caveat enforcer contract. For example, when you use:
132132

133133
```typescript
134134
caveatBuilder.addCaveat("allowedTargets", ["0xc11F3a8E5C7D16b75c9E2F60d26f5321C6Af5E92"]);
135135
```
136136

137137
The builder is creating a caveat that references the
138-
[`AllowedTargetsEnforcer`](../how-to/create-delegation/restrict-delegation.md#allowedtargets) contract address and
138+
[`AllowedTargetsEnforcer`](../reference/caveats.md#allowedtargets) contract address and
139139
properly encodes the provided addresses as terms for that enforcer.
140140

141141
## Caveat enforcer best practices
@@ -145,14 +145,14 @@ When designing delegations with caveats, consider these best practices:
145145
- **Combine caveat enforcers appropriately** - Use multiple caveat enforcers to create comprehensive restrictions.
146146

147147
- **Consider caveat enforcer order** - When using caveat enforcers that modify external contract states, the order matters.
148-
For example, using [`NativeTokenPaymentEnforcer`](../how-to/create-delegation/restrict-delegation.md#nativetokenpayment) before
149-
[`NativeBalanceChangeEnforcer`](../how-to/create-delegation/restrict-delegation.md#nativebalancechange) might cause validation failures.
148+
For example, using [`NativeTokenPaymentEnforcer`](../reference/caveats.md#nativetokenpayment) before
149+
[`NativeBalanceChangeEnforcer`](../reference/caveats.md#nativebalancechange) might cause validation failures.
150150

151151
- **Be careful with unbounded delegations** - Always include appropriate caveat enforcers to limit what a delegate can do.
152152

153153
## Available caveat enforcers
154154

155-
The Delegation Toolkit provides [many out-of-the-box caveat enforcers](../how-to/create-delegation/restrict-delegation.md#caveat-types)
155+
The Delegation Toolkit provides [many out-of-the-box caveat enforcers](../reference/caveats.md)
156156
for common restriction patterns, including:
157157

158158
- Limiting target addresses and methods.

gator_versioned_docs/version-0.11.0/concepts/delegation.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ sidebar_position: 2
55

66
# Delegation
77

8-
*Delegation* is the ability for a [delegator account](delegator-accounts.md) to grant permission to another smart contract account (SCA)
9-
or externally owned account (EOA) to perform specific executions on the delegator's behalf, under defined rules and restrictions.
8+
*Delegation* is the ability for a [smart account](smart-accounts.md) to grant permission to another smart account
9+
or externally owned account (EOA) to perform specific executions on their behalf, under defined rules and restrictions.
10+
The account that grants the permission is called the *delegator account*, while the account that receives the permission
11+
is called the *delegate account*.
1012

1113
The MetaMask Delegation Toolkit includes the following delegation features:
1214

@@ -45,7 +47,7 @@ The delegation lifecycle is as follows:
4547
:::
4648

4749
4. **Delegation redemption** - The delegate (the account being granted the permission) redeems the
48-
delegation through an [ERC-4337 user operation](delegator-accounts.md#account-abstraction-erc-4337),
50+
delegation through an [ERC-4337 user operation](smart-accounts.md#account-abstraction-erc-4337),
4951
which verifies that the delegated authority is valid in order to perform the execution.
5052

5153
See [how to create a delegation](../how-to/create-delegation/index.md) to get started with the
@@ -62,7 +64,7 @@ It consists of the following components:
6264
- **Delegator Core** - Delegator Core contains the logic for the ERC-4337 compliant delegator accounts.
6365
It defines the interface needed for the Delegation Manager to invoke executions on behalf of the accounts.
6466

65-
- **Delegator account implementations** - There are [multiple delegator account implementations](delegator-accounts.md#delegator-account-types),
67+
- **Delegator account implementations** - There are [multiple delegator account implementations](smart-accounts.md#smart-account-implementation-types),
6668
with the main difference being the signature scheme used to manage the underlying account.
6769

6870
- **Delegation Manager** - The Delegation Manager validates delegations and triggers executions

gator_versioned_docs/version-0.11.0/concepts/environment.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The delegator environment serves several key purposes:
1818

1919
## Resolve the delegator environment
2020

21-
When you create a [`MetaMaskSmartAccount`](../how-to/create-delegator-account.md) instance, the Delegation Toolkit automatically
21+
When you create a [MetaMask smart account](smart-accounts.md), the Delegation Toolkit automatically
2222
resolves the environment based on the version it requires and the chain configured.
2323
If no environment is found for the specified chain, it throws an error.
2424

@@ -66,11 +66,11 @@ export delegatorSmartAccount;
6666
</Tabs>
6767

6868
:::note
69-
See the [changelog](../changelog/0.11.0.md) of the toolkit version you are using for supported chains.
69+
See the changelog of the toolkit version you are using (in the left sidebar) for supported chains.
7070
:::
7171

7272
Alternatively, you can use the `getDelegatorEnvironment` function to resolve the environment.
73-
This function is especially useful if your delegator is not a smart contract account when
73+
This function is especially useful if your delegator is not a smart account when
7474
[creating a redelegation](../how-to/create-delegation/index.md#create-a-redelegation).
7575

7676
```typescript
@@ -224,5 +224,5 @@ overrideDeployedEnvironment(
224224

225225
:::note
226226
Make sure to specify the Delegation Framework version required by the toolkit.
227-
See the [changelog](../changelog/0.11.0.md) of the toolkit version you are using for its required Framework version.
227+
See the changelog of the toolkit version you are using (in the left sidebar) for its required Framework version.
228228
:::

gator_versioned_docs/version-0.11.0/concepts/delegator-accounts.md renamed to gator_versioned_docs/version-0.11.0/concepts/smart-accounts.md

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
---
2-
description: Learn about account abstraction, the delegator account flow, and account types.
2+
description: Learn about MetaMask smart accounts.
33
sidebar_position: 1
44
---
55

6-
# Delegator accounts
6+
# Smart accounts
77

8-
The MetaMask Delegation Toolkit enables you to create and manage *delegator accounts*.
9-
Delegator accounts are [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) smart contract accounts (SCAs)
8+
The MetaMask Delegation Toolkit enables you to create and manage MetaMask *smart accounts*.
9+
Smart accounts are [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) smart contract accounts
1010
that support programmable account behavior and advanced features such as multi-signature approvals,
1111
automated transaction batching, and custom security policies.
12-
Unlike traditional wallets, which rely on private keys for every transaction, MetaMask delegator
12+
Unlike traditional wallets, which rely on private keys for every transaction, MetaMask smart
1313
accounts use smart contracts to govern account logic.
1414

15+
Smart accounts are referenced in the toolkit as `MetaMaskSmartAccount`.
16+
1517
## Account abstraction (ERC-4337)
1618

1719
Account abstraction, specified by [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337), is a
18-
mechanism that enables users to manage SCAs containing arbitrary verification logic.
19-
ERC-4337 enables SCAs to be used as primary accounts in place of traditional private key-based
20+
mechanism that enables users to manage smart accounts containing arbitrary verification logic.
21+
ERC-4337 enables smart contracts to be used as primary accounts in place of traditional private key-based
2022
accounts, or externally owned accounts (EOAs).
2123

2224
ERC-4337 introduces the following concepts:
2325

2426
- **User operation** - A package of instructions signed by a user, specifying executions for
25-
the SCA to perform.
27+
the smart account to perform.
2628
User operations are collected and submitted to the network by bundlers.
2729

2830
- **Bundler** - A service that collects multiple user operations, packages them into a single transaction,
@@ -32,15 +34,34 @@ ERC-4337 introduces the following concepts:
3234
adhere to the required rules and security checks.
3335

3436
- **Paymasters** - Entities that handle the payment of gas fees on behalf of users, often integrated
35-
into SCAs to facilitate gas abstraction.
37+
into smart accounts to facilitate gas abstraction.
38+
39+
## Smart account implementation types
40+
41+
The MetaMask Delegation Toolkit supports two types of smart accounts, each offering unique features and use cases.
42+
See [Configure accounts and signers](../how-to/create-smart-account/configure-accounts-signers.md) to learn how to use these different account types.
43+
44+
### Hybrid smart account
45+
46+
The Hybrid smart account is a flexible implementation that supports both an externally owned account (EOA) "owner" and any number of P256 (passkey) signers.
47+
You can configure any of these signers as the signatory, and use them to sign any data, including user operations, on behalf of the smart account.
48+
49+
This type is referenced in the toolkit as `Implementation.Hybrid`.
50+
51+
### Multisig smart account
52+
53+
The Multisig smart account is an implementation that supports multiple signers with a configurable threshold for valid signatures, allowing for enhanced security and flexibility in account management.
54+
The signatory must have at least as many signers include as the threshold is configured for the account.
3655

37-
## Delegator account flow
56+
This type is referenced in the toolkit as `Implementation.Multisig`.
3857

39-
The MetaMask delegator account flow is as follows:
58+
## Smart account flow
4059

41-
1. **Account setup** - A user creates an SCA by deploying a smart contract, and initializing it with
60+
The MetaMask smart account flow is as follows:
61+
62+
1. **Account setup** - A user creates a smart account by deploying a smart contract, and initializing it with
4263
ownership and security settings.
43-
The user can customize the SCA in the following ways:
64+
The user can customize the smart account in the following ways:
4465

4566
- **Account logic** - They can configure custom logic for actions such as multi-signature
4667
approvals, spending limits, and automated transaction batching.
@@ -60,20 +81,8 @@ The MetaMask delegator account flow is as follows:
6081
4. **Validation and execution** - The bundled transaction goes to an entry point contract, which
6182
validates each user operation and executes them if they meet the smart contract's rules.
6283

63-
## Delegator account types
64-
65-
The MetaMask Delegation Toolkit supports two types of delegator accounts, each offering unique features and use cases.
66-
See [Configure accounts and signers](../how-to/configure-delegator-accounts-signers.md) to learn how to use these different account types.
67-
68-
### Hybrid Delegator
69-
70-
The Hybrid Delegator is a flexible implementation that supports both an externally owned account (EOA) "owner" and any number of P256 (passkey) signers.
71-
You can configure any of these signers as the signatory, and use them to sign on behalf of the delegator.
72-
73-
This type is referenced in the toolkit as `Implementation.Hybrid`.
74-
75-
### Multisig Delegator
76-
77-
The Multisig Delegator is an implementation that supports multiple signers with a configurable threshold for valid signatures, allowing for enhanced security and flexibility in account management. The signatory must have at least as many signers include as the threshold is configured for the account.
84+
## Delegator accounts
7885

79-
This type is referenced in the Toolkit as `Implementation.Multisig`.
86+
Delegator accounts are a type of smart account that allows users to grant permission to other smart accounts or EOAs
87+
to perform specific executions on their behalf, under defined rules and restrictions.
88+
Learn more about [delegation](delegation.md).

gator_versioned_docs/version-0.11.0/experimental/_category_.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
"slug": "/experimental",
77
"title": "Delegation Toolkit experimental features"
88
}
9-
}
9+
}

gator_versioned_docs/version-0.11.0/experimental/erc-7710-redeem-delegations.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import TabItem from "@theme/TabItem";
1212
This is an experimental feature and may change in future releases.
1313
:::
1414

15-
[ERC-7710](https://eip.tools/eip/7710) introduces a standard way for smart contract accounts (SCAs) to delegate capabilities to other
16-
SCAs or externally owned accounts (EOAs).
15+
[ERC-7710](https://eip.tools/eip/7710) introduces a standard way for smart accounts to delegate capabilities to other
16+
smart accounts or externally owned accounts (EOAs).
1717

1818
The MetaMask Delegation Toolkit provides two experimental functions, `erc7710BundlerActions()` and `erc7710WalletActions()`, that let
1919
a caller redeem delegations granted by MetaMask's permissions system.
@@ -57,7 +57,7 @@ const permissionsResponse = [{
5757

5858
const permissionsContext = permissionsResponse[0].context;
5959
const delegationManager = permissionsResponse[0].signerMeta.delegationManager;
60-
// accountMeta is only present when the smart contract account is not deployed.
60+
// accountMeta is only present when the smart account is not deployed.
6161
const accountMetadata = permissionsResponse[0].accountMeta;
6262
```
6363

@@ -80,14 +80,11 @@ If you redeem delegations in any other way, it is your responsibility to validat
8080

8181
## Redeem the permission
8282

83-
Redeem a delegation using one of two methods. Choose the method based on your account type:
83+
Redeem a delegation with a [smart account](#redeem-with-a-smart-account) or an [externally owned account (EOA)](#redeem-with-an-eoa).
8484

85-
- If redeeming with an SCA, call `sendUserOperationWithDelegation`.
86-
- If redeeming with an EOA, call `sendTransactionWithDelegation`.
85+
### Redeem with a smart account
8786

88-
### Redeem with an SCA
89-
90-
To redeem a delegation with a smart contract account, create a [`MetaMaskSmartAccount`](../how-to/create-delegator-account.md#create-a-metamasksmartaccount)
87+
To redeem a delegation with a smart account, create a [`MetaMaskSmartAccount`](../how-to/create-smart-account/index.md#create-a-metamasksmartaccount)
9188
and a [Viem Bundler Client](https://viem.sh/account-abstraction/clients/bundler).
9289

9390
After setting up your Bundler Client, you can extend its functionality with `erc7710BundlerActions` actions to support ERC-7710. Once extended, use `sendUserOperationWithDelegation` to redeem the permission.
@@ -213,7 +210,7 @@ const hash = walletClient.sendTransactionWithDelegation({
213210
<TabItem value="config.ts">
214211

215212
```typescript
216-
import { http, createPublicClient } from "viem";
213+
import { http, createPublicClient, createWalletClient } from "viem";
217214
import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";
218215
import { sepolia as chain } from "viem/chains";
219216
import { erc7710WalletActions } from "@metamask/delegation-toolkit/experimental";

gator_versioned_docs/version-0.11.0/experimental/erc-7715-request-permissions.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ The MetaMask Delegation Toolkit provides the experimental actions for ERC-7715 t
2121
## Request permissions
2222

2323
To request permissions, extend your [Viem Wallet Client](https://viem.sh/docs/clients/wallet) with `erc7715ProviderActions` actions.
24-
You'll need a session account to request the permission, which can be either an externally owned account (EOA) or a smart contract account (SCA).
25-
This example uses an SCA:
24+
You'll need a session account to request the permission, which can be either a smart account or an externally owned account (EOA).
25+
This example uses a smart account:
2626

2727
<Tabs>
2828
<TabItem value="example.ts">
@@ -92,8 +92,8 @@ export const walletClient = createWalletClient({
9292
</Tabs>
9393

9494
<details>
95-
<summary> ERC-7715 request permission sample </summary>
96-
95+
<summary>ERC-7715 request permission sample</summary>
96+
<div>
9797
Here's what your ERC-7715 native token streaming allowance request looks like:
9898

9999
```ts
@@ -120,6 +120,7 @@ export const walletClient = createWalletClient({
120120
```
121121

122122
Learn more about the [ERC-7715 permission schema](https://eip.tools/eip/7715).
123+
</div>
123124
</details>
124125

125126

gator_versioned_docs/version-0.11.0/get-started/quickstart.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,9 @@ const bundlerClient = createBundlerClient({
4646

4747
### 3. Create a delegator account
4848

49-
[Create a delegator account](../how-to/create-delegator-account.md) to set up a delegation.
50-
The delegator must be a smart account.
49+
[Create a delegator smart account](../how-to/create-smart-account/index.md) to set up a delegation.
5150

52-
This example configures a [Hybrid Delegator](../how-to/configure-delegator-accounts-signers.md#configure-a-hybrid-delegator):
51+
This example configures a [Hybrid](../how-to/create-smart-account/configure-accounts-signers.md#configure-a-hybrid-smart-account) delegator account:
5352

5453
```typescript
5554
import {
@@ -72,9 +71,9 @@ const delegatorSmartAccount = await toMetaMaskSmartAccount({
7271
### 4. Create a delegate account
7372

7473
Create a delegate account to receive the delegation.
75-
The delegate can be either a smart contract account (SCA) or an externally owned account (EOA).
74+
The delegate can be either a smart account or an externally owned account (EOA).
7675

77-
This example uses an SCA:
76+
This example uses a smart account:
7877

7978
```typescript
8079
import {
@@ -135,7 +134,7 @@ The delegate account can now [redeem the delegation](../how-to/redeem-delegation
135134
The redeem transaction is sent to the `DelegationManager` contract, which validates the delegation and
136135
executes actions on the delegator's behalf.
137136

138-
To prepare the call data for the redeem transaction, use the `redeemDelegation` utility function from the Delegation Toolkit.
137+
To prepare the calldata for the redeem transaction, use the `redeemDelegation` utility function from the Delegation Toolkit.
139138

140139
```typescript
141140
import {

gator_versioned_docs/version-0.11.0/how-to/configure.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ sidebar_label: Configure the toolkit
66

77
# Configure the Delegation Toolkit
88

9-
The MetaMask Delegation Toolkit enables you to easily integrate delegator accounts into your dapp, enabling a more flexible, secure, and frictionless experience for your users.
9+
The MetaMask Delegation Toolkit enables you to easily integrate [smart accounts](../concepts/smart-accounts.md) into your dapp,
10+
enabling a more flexible, secure, and frictionless experience for your users.
1011

1112
The toolkit is highly configurable, allowing you to tailor it to your project's specific needs. It includes support for custom signers, multiple signatory schemes, custom paymasters and bundlers, and more.
1213

gator_versioned_docs/version-0.11.0/how-to/create-delegation/create-custom-caveat-enforcer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import TabItem from "@theme/TabItem";
88

99
# Create a custom caveat enforcer
1010

11-
When [restricting a delegation](restrict-delegation.md), the MetaMask Delegation Toolkit provides some [out-of-the-box caveat enforcers](restrict-delegation.md#caveat-types)
11+
When [restricting a delegation](restrict-delegation.md), the MetaMask Delegation Toolkit provides some [out-of-the-box caveat enforcers](../../reference/caveats.md)
1212
that cover common use cases.
1313
For more granular or custom control, you can follow the instructions on this page to create custom caveat enforcers from scratch.
1414

0 commit comments

Comments
 (0)