Skip to content

Commit 656b71e

Browse files
Add steps to deploy new factory, nexus bootstrap and entrypoint
1 parent e871ce4 commit 656b71e

14 files changed

Lines changed: 2546 additions & 79 deletions

scripts/biconomy/README-deploy-infrastructure-and-wallet.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The `deploy-infrastructure-and-wallet.js` script is a **complete, self-contained
77
- **Passport Infrastructure** (proven stable base) - Factory + MultiCallDeploy
88
- **Nexus Core** (modern Account Abstraction) - K1Validator + Implementation
99
- **Hybrid Wallet Deployment** - Configurable deployment via Factory or MultiCallDeploy
10-
- **Complete 6-Step Coverage** - Implements all original deployment steps in one script
10+
- **Complete 8-Step Coverage** - Implements all deployment steps (0-8) in one script
1111

1212
## Key Features
1313

@@ -19,13 +19,19 @@ The `deploy-infrastructure-and-wallet.js` script is a **complete, self-contained
1919

2020
### **Robust Architecture**
2121
- **Hybrid approach** combines the best of both systems
22-
- **Complete 6-step implementation** (all original steps in one script)
22+
- **Complete 8-step implementation** (all steps 0-8 in one script including NexusBootstrap and EntryPoint)
2323
- **Dual deployment methods** (Factory and MultiCallDeploy)
2424
- **Proper timing** with verification between deployments
2525
- **Comprehensive verification** of all components
2626
- **Deterministic deployment** using CREATE2 for wallet addresses
2727
- **Automatic fallback** from MultiCallDeploy to Factory if needed
2828

29+
### **Enhanced Testing & Operations**
30+
- **Wallet Operations Testing** - Tests ETH reception, interface accessibility, and connectivity
31+
- **Infrastructure Validation** - Verifies all components are properly deployed and connected
32+
- **EntryPoint Integration** - Smart deployment of real or mock EntryPoint for ERC-4337 support
33+
- **NexusBootstrap Support** - Proper Nexus initialization component deployment
34+
2935
### **Production Ready**
3036
- **Error handling** with detailed diagnostics
3137
- **Gas optimization** with configurable limits
@@ -62,6 +68,8 @@ USE_MULTICALL_DEPLOY=true NODE_ENV=development npx hardhat run scripts/biconomy/
6268
4. **Step 4**: K1Validator (Nexus) + Nexus Implementation
6369
5. **Step 5**: ImmutableSigner deployment
6470
6. **Step 6**: LatestWalletImplLocator → Nexus configuration
71+
7. **Step 7**: NexusBootstrap deployment (REQUIRED for Nexus initialization)
72+
8. **Step 8**: EntryPoint deployment (ERC-4337 support with smart fallback)
6573

6674
#### Phase 2: Wallet Deployment (Configurable Method)
6775
**Factory Method (Default)**:
@@ -75,10 +83,17 @@ USE_MULTICALL_DEPLOY=true NODE_ENV=development npx hardhat run scripts/biconomy/
7583
- Includes example initial transaction (0.1 ETH transfer)
7684
- Automatic fallback to Factory if interface issues occur
7785

78-
#### Phase 3: Verification
79-
1. **Code Verification** - Ensures all 8 components have bytecode
86+
#### Phase 3: Wallet Operations Testing
87+
1. **ETH Reception Test** - Sends 0.1 ETH to wallet and verifies balance
88+
2. **Wallet Structure Analysis** - Checks if wallet is smart contract or EOA
89+
3. **Nexus Interface Testing** - Tests wallet initialization and EntryPoint configuration
90+
4. **Infrastructure Connectivity** - Validates LatestWalletImplLocator configuration
91+
5. **EntryPoint Integration** - Tests EntryPoint accessibility and deposit functionality
92+
93+
#### Phase 4: Final Verification
94+
1. **Code Verification** - Ensures all 10 components have bytecode (including new Steps 7-8)
8095
2. **Size Validation** - Confirms proper deployment
81-
3. **Integration Testing** - Validates complete 6-step architecture
96+
3. **Integration Testing** - Validates complete 8-step architecture
8297

8398
## Output
8499

scripts/biconomy/README.md

Lines changed: 78 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Biconomy Nexus Integration
22

3-
This directory contains the complete Passport-Nexus hybrid infrastructure implementation, deployment scripts, and wallet management tools.
3+
This directory contains the **complete and production-ready** Passport-Nexus hybrid infrastructure implementation. All temporary files have been cleaned up and only essential components remain.
44

55
## Project Structure
66

@@ -14,18 +14,28 @@ scripts/biconomy/
1414
│ ├── step4.ts # Deploy Nexus core (K1Validator + Nexus with CREATE2)
1515
│ ├── step5.ts # Deploy ImmutableSigner
1616
│ ├── step6.ts # Configure LatestWalletImplLocator → Nexus
17+
│ ├── step7.ts # Deploy NexusBootstrap (REQUIRED for Nexus)
18+
│ ├── step8.ts # Deploy/Configure EntryPoint (ERC-4337)
1719
│ ├── step0.json # Step 0 deployment results
1820
│ ├── step1.json # Step 1 deployment results
1921
│ ├── step2.json # Step 2 deployment results
2022
│ ├── step3.json # Step 3 deployment results
2123
│ ├── step4.json # Step 4 deployment results
22-
│ └── step5.json # Step 5 deployment results
24+
│ ├── step5.json # Step 5 deployment results
25+
│ ├── step6.json # Step 6 deployment results
26+
│ ├── step7.json # Step 7 deployment results
27+
│ └── step8.json # Step 8 deployment results
2328
├── deploy-infrastructure-and-wallet.js # Complete deployment script (all-in-one)
24-
├── wallet-deployment.ts # Wallet deployment using step artifacts
29+
├── wallet-deployment.ts # Enhanced wallet deployment with Nexus support
30+
├── demonstrate-erc4337-concept.js # ERC-4337 concept demonstration (reference)
31+
├── test-revised-factory.js # Factory test example (reference)
32+
├── final-deployment.js # Legacy deployment script
2533
├── README-deploy-infrastructure-and-wallet.md # Complete infrastructure README
2634
└── README.md # This file
2735
```
2836

37+
**✨ Note**: This directory has been cleaned up from 47 files to 12 essential files. All temporary investigation, testing, and debugging scripts have been removed.
38+
2939
## Architecture Overview
3040

3141
### 🏗️ Hybrid Infrastructure (Passport + Nexus)
@@ -70,6 +80,19 @@ Step 2: Implementation Management │
7080
│ Locator │ ──points to──▶ Nexus Implementation
7181
└─────────────────┘
7282
83+
Step 7: Nexus Initialization Step 8: ERC-4337 Support
84+
┌─────────────────┐ ┌──────────────────┐
85+
│ NexusBootstrap │ │ EntryPoint │
86+
│ (Required) │ │ (ERC-4337) │
87+
└─────────────────┘ └──────────────────┘
88+
│ │
89+
│ enables │ enables
90+
▼ ▼
91+
┌─────────────────┐ ┌──────────────────┐
92+
│ Nexus Module │ │ UserOperation │
93+
│ Initialization │ │ Validation │
94+
└─────────────────┘ └──────────────────┘
95+
7396
Step 0: CREATE2 Foundation
7497
┌─────────────────┐
7598
│OwnableCreate2 │ ──enables──▶ Deterministic Addresses
@@ -95,6 +118,15 @@ Step 0: CREATE2 Foundation
95118
- **ImmutableSigner**: 2x2 signature validation for critical operations
96119
- **Configuration**: Links all components together
97120

121+
#### **Nexus Initialization & ERC-4337 (Steps 7-8)**
122+
- **NexusBootstrap**: **REQUIRED** component for Nexus wallet initialization
123+
- Enables proper module setup during wallet creation
124+
- Critical for Nexus functionality - wallets cannot be properly initialized without it
125+
- **EntryPoint**: ERC-4337 Account Abstraction support
126+
- Enables UserOperation validation and execution
127+
- Supports bundler integration and gasless transactions
128+
- Automatically deploys real EntryPoint or falls back to mock for development
129+
98130
#### **CREATE2 Foundation (Step 0)**
99131
- **OwnableCreate2Deployer**: Enables deterministic contract addresses
100132
- **Used by**: Steps 2 and 4 for predictable deployments
@@ -126,6 +158,12 @@ NODE_ENV=development npx hardhat run scripts/biconomy/steps/step5.ts --network l
126158

127159
# Step 6: Configure infrastructure
128160
NODE_ENV=development npx hardhat run scripts/biconomy/steps/step6.ts --network localhost
161+
162+
# Step 7: Deploy NexusBootstrap (REQUIRED for Nexus initialization)
163+
NODE_ENV=development npx hardhat run scripts/biconomy/steps/step7.ts --network localhost
164+
165+
# Step 8: Deploy/Configure EntryPoint (ERC-4337 support)
166+
NODE_ENV=development npx hardhat run scripts/biconomy/steps/step8.ts --network localhost
129167
```
130168

131169
### Method 2: Complete Deployment (Recommended)
@@ -167,6 +205,8 @@ MAX_PRIORITY_FEE_PER_GAS=1000000000
167205
# Admin addresses (automatically set to first signer in development)
168206
WALLET_IMPL_LOCATOR_ADMIN=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
169207
WALLET_IMPL_CHANGER_ADMIN=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
208+
209+
# ERC-4337 EntryPoint (set after step8 or use existing)
170210
ENTRY_POINT_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8
171211

172212
# CREATE2 factory address (set after step0)
@@ -315,6 +355,41 @@ Development settings optimized for speed:
315355
- **Gas Price**: Optimized for localhost/testnet
316356
- **EIP-1559**: Configured for modern networks
317357

358+
## New Components (Steps 7-8)
359+
360+
### Step 7: NexusBootstrap
361+
**Critical component for Nexus wallet functionality**
362+
363+
- **Purpose**: Enables proper initialization of Nexus wallets with modules
364+
- **Requirement**: **MANDATORY** for any Nexus wallet deployment
365+
- **Functionality**:
366+
- Configures default validator (K1Validator) during wallet creation
367+
- Sets up initial module configuration
368+
- Ensures wallets are properly initialized and functional
369+
- **Dependencies**: Requires K1Validator from Step 4
370+
- **Output**: `step7.json` with NexusBootstrap address
371+
372+
### Step 8: EntryPoint (ERC-4337)
373+
**Account Abstraction support for advanced wallet features**
374+
375+
- **Purpose**: Enables ERC-4337 Account Abstraction functionality
376+
- **Features**:
377+
- UserOperation validation and execution
378+
- Bundler integration support
379+
- Gasless transaction capabilities
380+
- Meta-transaction support
381+
- **Smart Deployment**:
382+
- First attempts to use existing EntryPoint from environment
383+
- Then tries to deploy real EntryPoint from `account-abstraction` package
384+
- Falls back to MockEntryPoint for development if real EntryPoint unavailable
385+
- **Output**: `step8.json` with EntryPoint address and source type
386+
387+
### Integration Notes
388+
- **Step 7** is **required** for Nexus wallets to function properly
389+
- **Step 8** is **optional** but recommended for full ERC-4337 support
390+
- Both steps integrate seamlessly with existing Passport infrastructure
391+
- Complete deployment now covers **9 steps** (0-8) for full functionality
392+
318393
## Support
319394

320395
For issues or questions:

0 commit comments

Comments
 (0)