Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gator-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const sidebar = {
],
},
'get-started/use-the-cli',
'get-started/use-scaffold-eth',
'get-started/supported-networks',
],
},
Expand Down
Binary file added smart-accounts-kit/assets/scaffold-eth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions smart-accounts-kit/get-started/use-scaffold-eth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
description: Get started with the Smart Accounts Kit using Scaffold-ETH 2.
sidebar_label: Use Scaffold-ETH 2
keywords: [scaffold-eth, delegation, smart accounts, template]
---

# Use smart accounts with Scaffold-ETH 2

Use the Smart Accounts Kit extension for [Scaffold-ETH 2](https://docs.scaffoldeth.io/) to bootstrap a project in under two minutes.
This extension demonstrates the end-to-end flow for initializing a MetaMask smart account, creating and signing a delegation, and redeeming the delegation.

## Run the extension

1. Run the following command to install the Smart Accounts Kit extension:

```bash
npx create-eth@latest -e metamask/gator-extension
```

2. Upon installation, you'll be asked the following prompts:
```bash
? Your project name: (my-dapp-example)
? What solidity framework do you want to use?
❯ hardhat
foundry
none
```
Once you've answered the prompts, the extension will create the project using the specified settings.

3. Navigate into the project's `nextjs` package:
```bash
cd my-dapp-example/packages/nextjs
```
4. Create a `.env.local` file:
```bash
cp .env.example .env.local
```
Fill in the `NEXT_PUBLIC_PIMLICO_API_KEY` environment variable with your [Pimlico API key](https://docs.pimlico.io/guides/create-api-key#create-api-key).
5. In the root of your project, start the development server:
```bash
yarn start
```
Navigate to the project in your browser:
<p align="center">
<img src={require("../assets/scaffold-eth.png").default} alt="Scaffold-ETH 2 Smart Accounts Kit" class="appScreen" />
</p>
6. Connect your MetaMask wallet on the Sepolia testnet.
In the **MetaMask Smart Accounts & Delegation** section, follow the prompts to deploy a delegator account, create a delegate wallet, create a delegation, and redeem a delegation.
You can view the completed transaction on Etherscan.
## Next steps
Learn more about [MetaMask Smart Accounts](../concepts/smart-accounts.md) and [delegation](../concepts/delegation/index.md).
5 changes: 2 additions & 3 deletions smart-accounts-kit/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@ Check out the following documentation from these partners:
<CardList
items={[
{
href: "https://scaffoldeth.io/extensions",
href: "get-started/use-scaffold-eth",
title: "Scaffold-ETH 2",
description: "Install the MetaMask Delegation Toolkit extension for Scaffold-ETH 2.",
buttonIcon: "external-arrow",
description: "Install the Smart Accounts Kit extension for Scaffold-ETH 2.",
},
{
href: "https://viem.sh/account-abstraction/accounts/smart/toMetaMaskSmartAccount",
Expand Down
Loading