smart-account-deployment

Deploys ERC-4337 smart accounts in .NET using CREATE2 address prediction and SmartAccountBuilder.

2.3k|744|Updated Nov 23, 2015
One-click install
npx skills add https://github.com/Nethereum/Nethereum --skill smart-account-deployment
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: smart-account-deployment
Source: https://github.com/Nethereum/Nethereum/tree/main/plugins/nethereum-skills/skills/smart-account-deployment
Command: npx skills add https://github.com/Nethereum/Nethereum --skill smart-account-deployment

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Nethereum.Web3, Nethereum.AccountAbstraction, Nethereum.AccountAbstraction.SimpleAccount.

What problem does it solve?

Deploying ERC-4337 smart contract wallets requires coordinating factory contracts, CREATE2 salts, EntryPoint versions, and init code, and mistakes like mismatched salts or unfunded counterfactual addresses cause failed deployments.

Core Features & Use Cases

  • Counterfactual Address Prediction: Compute a smart account address with CREATE2 before any on-chain deployment using SmartAccountBuilder.
  • Upfront or Lazy Deployment: Deploy directly via the factory or embed InitCode in the first UserOperation so the account deploys atomically with its first transaction.
  • EntryPoint Deposit Management: Query, add, and withdraw EntryPoint deposits to fund gas for UserOperations.
  • Use Case: A .NET backend needs to provision a smart wallet for each new user. It predicts each user's address with a unique salt, shares the address for funding, then lazily deploys the account on the user's first token transfer via AAContractHandler.

Quick Start

Ask the AI to generate C# code that predicts and deploys an ERC-4337 smart account with Nethereum's SmartAccountBuilder given a factory address and owner private key.

Frequently Asked Questions about smart-account-deployment

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy an ERC-4337 smart account in C#?

Use Nethereum's SmartAccountBuilder: call web3.CreateSmartAccount().WithFactory(factoryAddress).WithOwnerKey(privateKey).BuildAsync() to deploy via the factory and receive a ready-to-use SmartAccountService. Install Nethereum.Web3, Nethereum.AccountAbstraction, and Nethereum.AccountAbstraction.SimpleAccount.

How to predict a smart account address before deployment with CREATE2?

Call GetAddressAsync() on the SmartAccountBuilder with the same factory, owner, and salt you will use for deployment. The returned counterfactual address matches the eventual deployed address as long as none of those parameters change.

Can I deploy a smart account lazily with the first UserOperation?

Yes. Obtain init code via GetInitCodeAsync() and set it as the UserOperation's InitCode field, or configure AAContractHandler with a FactoryConfig so the first contract call deploys and executes atomically.

Why does my deployed smart account address differ from the predicted address?

The address changes if the salt, factory address, or owner differs between prediction and deployment. CREATE2 derives the address from these exact inputs, so keep them identical across both calls.

Which EntryPoint version should I use for new smart account deployments?

Use EntryPointAddresses.Latest (V09) for new deployments. The account is bound to the EntryPoint version at deploy time, so choosing the wrong EntryPoint causes UserOperation failures.