Skip to content

Commit 5b13a06

Browse files
Add Scaffold-ETH page (#2457)
* Add Scaffold-ETH page * minor edits * update scaffold eth section * fix the broken links * minor edits --------- Co-authored-by: AyushBherwani1998 <ayush.bherwani@consensys.net> Co-authored-by: Ayush Bherwani <ayush.bherwani1998@gmail.com>
1 parent f9113f9 commit 5b13a06

File tree

6 files changed

+139
-4
lines changed

6 files changed

+139
-4
lines changed

gator-sidebar.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ const sidebar = {
2525
],
2626
},
2727
'get-started/use-the-cli',
28+
{
29+
type: 'category',
30+
label: 'Use Scaffold-ETH 2',
31+
collapsed: true,
32+
items: [
33+
'get-started/use-scaffold-eth/smart-accounts',
34+
'get-started/use-scaffold-eth/advanced-permissions',
35+
],
36+
},
2837
'get-started/supported-networks',
2938
],
3039
},
792 KB
Loading
864 KB
Loading
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
description: Get started with the Advanced Permissions (ERC-7715) using Scaffold-ETH 2.
3+
sidebar_label: Advanced Permissions (ERC-7715)
4+
keywords: [scaffold-eth, delegation, advanced permissions, erc7715, 7715, template]
5+
---
6+
7+
# Use Advanced Permissions with Scaffold-ETH 2
8+
9+
Use the [Advanced Permissions (ERC-7715) extension](https://github.com/MetaMask/erc-7715-extension) for [Scaffold-ETH 2](https://docs.scaffoldeth.io/) to bootstrap a project in
10+
under two minutes. This extension helps you quickly generate the boilerplate code to request fine-grained permissions
11+
from a MetaMask user, and execute transactions on their behalf.
12+
13+
## Prerequisites
14+
15+
- Install [Node.js](https://nodejs.org/en/blog/release/v20.18.3) v20.18.3 or later.
16+
- Install [Yarn](https://yarnpkg.com/) package manager.
17+
- Install [Git](https://git-scm.com/install/).
18+
- [Create a Pimlico API key](https://docs.pimlico.io/guides/create-api-key#create-api-key).
19+
20+
### 1. Install the extension
21+
22+
Run the following command to install the Smart Accounts Kit extension:
23+
24+
```bash
25+
npx create-eth@latest -e metamask/erc-7715-extension your-project-name
26+
```
27+
28+
### 2. Set up enviroment variables
29+
30+
Navigate into the project's `nextjs` package, and create a `.env.local` file. Once created, update the
31+
`NEXT_PUBLIC_PIMLICO_API_KEY` environment variable with your Pimlico API Key.
32+
33+
```bash
34+
cd your-project-name/packages/nextjs
35+
cp .env.example .env.local
36+
```
37+
38+
### 3. Start the frontend
39+
40+
In the project's root directory start the development server.
41+
42+
```bash
43+
yarn start
44+
```
45+
46+
### 4. Complete the Advanced Permissions lifecycle
47+
48+
Navigate to the **Advanced Permissions (ERC-7715)** page in your Scaffold-ETH
49+
frontend at http://localhost:3000/erc-7715-permissions, and follow the steps to request an advanced
50+
permission, and execute a transaction on the user's behalf.
51+
52+
You can view the completed transaction on Etherscan.
53+
54+
<p align="center">
55+
<img src={require("../../assets/scaffold-eth-7715.png").default} alt="Scaffold-ETH 2 Advanced Permissions Page" />
56+
</p>
57+
58+
## Next steps
59+
60+
Learn more about [Advanced Permissions (ERC-7715)](../../concepts/advanced-permissions.md).
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
description: Get started with the MetaMask Smart Accounts using Scaffold-ETH 2.
3+
sidebar_label: MetaMask Smart Accounts
4+
keywords: [scaffold-eth, delegation, smart accounts, template]
5+
---
6+
7+
# Use MetaMask Smart Accounts with Scaffold-ETH 2
8+
9+
Use the [MetaMask Smart Accounts extension](https://github.com/metamask/gator-extension) for [Scaffold-ETH 2](https://docs.scaffoldeth.io/) to bootstrap a project in
10+
under two minutes. This extension helps you quickly generate the boilerplate code to create an embedded smart account, and complete
11+
the delegation lifecycle (create, sign, and redeem a delegation).
12+
13+
## Prerequisites
14+
15+
- Install [Node.js](https://nodejs.org/en/blog/release/v20.18.3) v20.18.3 or later.
16+
- Install [Yarn](https://yarnpkg.com/) package manager.
17+
- Install [Git](https://git-scm.com/install/).
18+
- [Create a Pimlico API key](https://docs.pimlico.io/guides/create-api-key#create-api-key).
19+
20+
## Steps
21+
22+
### 1. Install the extension
23+
24+
Run the following command to install the Smart Accounts Kit extension:
25+
26+
```bash
27+
npx create-eth@latest -e metamask/gator-extension your-project-name
28+
```
29+
30+
### 2. Set up enviroment variables
31+
32+
Navigate into the project's `nextjs` package, and create a `.env.local` file. Once created, update the
33+
`NEXT_PUBLIC_PIMLICO_API_KEY` environment variable with your Pimlico API Key.
34+
35+
```bash
36+
cd your-project-name/packages/nextjs
37+
cp .env.example .env.local
38+
```
39+
40+
### 3. Start the frontend
41+
42+
In the project's root directory start the development server.
43+
44+
```bash
45+
yarn start
46+
```
47+
48+
### 4. Complete the delegation lifecycle
49+
50+
Navigate to the **MetaMask Smart Accounts & Delegation** page in your Scaffold-ETH
51+
frontend at http://localhost:3000/delegations, and follow the steps to deploy a delegator
52+
account, create a delegate wallet, create a delegation, and redeem a delegation.
53+
54+
You can view the completed transaction on Etherscan.
55+
56+
<p align="center">
57+
<img src={require("../../assets/scaffold-eth-smart-accounts.png").default} alt="Scaffold-ETH 2 Smart Accounts & Delegation Page" />
58+
</p>
59+
60+
## Next steps
61+
62+
Learn more about [MetaMask Smart Accounts](../../concepts/smart-accounts.md) and [delegation](../../concepts/delegation/index.md).

smart-accounts-kit/index.mdx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,14 @@ Check out the following documentation from these partners:
5454
<CardList
5555
items={[
5656
{
57-
href: "https://scaffoldeth.io/extensions",
58-
title: "Scaffold-ETH 2",
59-
description: "Install the MetaMask Delegation Toolkit extension for Scaffold-ETH 2.",
60-
buttonIcon: "external-arrow",
57+
href: "get-started/use-scaffold-eth/smart-accounts",
58+
title: "Smart Accounts with Scaffold-ETH 2",
59+
description: "Install the MetaMask Smart Accounts extension for Scaffold-ETH 2.",
60+
},
61+
{
62+
href: "get-started/use-scaffold-eth/advanced-permissions",
63+
title: "Advanced Permissions with Scaffold-ETH 2",
64+
description: "Install the MetaMask Advanced Permissions (ERC-7715) extension for Scaffold-ETH 2.",
6165
},
6266
{
6367
href: "https://viem.sh/account-abstraction/accounts/smart/toMetaMaskSmartAccount",

0 commit comments

Comments
 (0)