Skip to content

Commit 6b58add

Browse files
Add EntryPoint 0.7 code
1 parent 6c8bb84 commit 6b58add

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+3573
-2321
lines changed

package-lock.json

Lines changed: 9 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,21 @@
3030
"deploy:ganache": "hardhat run --network ganache utils/deploy-contracts.ts",
3131
"deploy": "hardhat run utils/deploy-contracts.ts --network",
3232
"verify": "hardhat verify --network",
33+
"setup:base-sepolia": "NODE_ENV=production npx hardhat run scripts/biconomy/setup-base-sepolia.js --network base_sepolia",
34+
"deploy:steps:base-sepolia": "NODE_ENV=production npm run deploy:step0:base-sepolia && npm run deploy:step1:base-sepolia && npm run deploy:step2:base-sepolia && npm run deploy:step3:base-sepolia && npm run deploy:step4:base-sepolia && npm run deploy:step5:base-sepolia && npm run deploy:step6:base-sepolia && npm run deploy:step7:base-sepolia && npm run deploy:step8:base-sepolia && npm run deploy:step9:base-sepolia && npm run deploy:step10:base-sepolia",
35+
"deploy:step0:base-sepolia": "NODE_ENV=production npx hardhat run scripts/biconomy/steps/step0.ts --network base_sepolia",
36+
"deploy:step1:base-sepolia": "NODE_ENV=production npx hardhat run scripts/biconomy/steps/step1.ts --network base_sepolia",
37+
"deploy:step2:base-sepolia": "NODE_ENV=production npx hardhat run scripts/biconomy/steps/step2.ts --network base_sepolia",
38+
"deploy:step3:base-sepolia": "NODE_ENV=production npx hardhat run scripts/biconomy/steps/step3.ts --network base_sepolia",
39+
"deploy:step4:base-sepolia": "NODE_ENV=production npx hardhat run scripts/biconomy/steps/step4.ts --network base_sepolia",
40+
"deploy:step5:base-sepolia": "NODE_ENV=production npx hardhat run scripts/biconomy/steps/step5.ts --network base_sepolia",
41+
"deploy:step6:base-sepolia": "NODE_ENV=production npx hardhat run scripts/biconomy/steps/step6.ts --network base_sepolia",
42+
"deploy:step7:base-sepolia": "NODE_ENV=production npx hardhat run scripts/biconomy/steps/step7.ts --network base_sepolia",
43+
"deploy:step8:base-sepolia": "NODE_ENV=production npx hardhat run scripts/biconomy/steps/step8.ts --network base_sepolia",
44+
"deploy:step9:base-sepolia": "NODE_ENV=production npx hardhat run scripts/biconomy/steps/step9.ts --network base_sepolia",
45+
"deploy:step10:base-sepolia": "NODE_ENV=production npx hardhat run scripts/biconomy/steps/step10.ts --network base_sepolia",
46+
"deploy:wallet:base-sepolia": "NODE_ENV=production npx hardhat run scripts/biconomy/wallet-deployment.ts --network base_sepolia",
47+
"deploy:infrastructure:base-sepolia": "NODE_ENV=production npx hardhat run scripts/biconomy/deploy-infrastructure-and-wallet.js --network base_sepolia",
3348
"release": "yarn publish src"
3449
},
3550
"husky": {
@@ -53,7 +68,7 @@
5368
"@nomiclabs/hardhat-etherscan": "^3.1.0",
5469
"@nomiclabs/hardhat-truffle5": "^2.0.0",
5570
"@nomiclabs/hardhat-web3": "^2.0.0",
56-
"@openzeppelin/contracts": "^4.9.3",
71+
"@openzeppelin/contracts": "^4.9.6",
5772
"@tenderly/hardhat-tenderly": "^1.0.11",
5873
"@typechain/ethers-v5": "^10.1.1",
5974
"@types/chai-as-promised": "^7.1.0",

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

Lines changed: 46 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ The `deploy-infrastructure-and-wallet.js` script is a **complete, self-contained
66

77
- **Passport Infrastructure** (proven stable base) - Factory + MultiCallDeploy
88
- **Nexus Core** (modern Account Abstraction) - K1Validator + Implementation
9-
- **Hybrid Wallet Deployment** - Configurable deployment via Factory or MultiCallDeploy
9+
- **EntryPoint v0.7** - Latest ERC-4337 Account Abstraction standard
10+
- **ERC-4337 UserOp Testing** - Complete UserOperation creation, signing, and execution
11+
- **Simplified Architecture** - Direct Nexus deployment via `NexusAccountFactory`
1012
- **Complete 11-Step Coverage** - Implements all deployment steps (0-10) in one script
11-
- **CFA Compatibility** - Uses `PassportCompatibleNexusFactory` for address compatibility
13+
- **CFA Compatibility** - Maintains address compatibility with old Passport wallets
1214

1315
**⚠️ Note**: This script contains some legacy functions that are now redundant after the step-based approach implementation. Consider using `wallet-deployment.ts` for wallet-only deployments, which has been cleaned and optimized.
1416

@@ -19,7 +21,9 @@ The `deploy-infrastructure-and-wallet.js` script is a **complete, self-contained
1921
| **Purpose** | Complete infrastructure + wallet deployment | Wallet-only deployment using existing infrastructure |
2022
| **Dependencies** | Self-contained, no external files | Requires step artifacts (step0.json - step10.json) |
2123
| **Code Status** | Contains some legacy functions (~60% redundant) | Cleaned & optimized (45% smaller) |
22-
| **Deployment Methods** | CFA Factory + MultiCallDeploy | CFA Factory + MultiCallDeploy (with robust fallback) |
24+
| **Deployment Methods** | NexusAccountFactory + MultiCallDeploy fallback | NexusAccountFactory + MultiCallDeploy fallback |
25+
| **ERC-4337 Support** | ✅ EntryPoint v0.7 + UserOp testing | ✅ EntryPoint v0.7 + UserOp testing |
26+
| **EntryPoint Deposit** | ✅ Automatic prefund management | ✅ Automatic prefund management |
2327
| **Use Case** | Fresh deployments, testing, development | Production wallet deployment |
2428
| **Recommended For** | Initial setup, complete redeployment | Regular wallet deployment operations |
2529

@@ -43,9 +47,18 @@ The `deploy-infrastructure-and-wallet.js` script is a **complete, self-contained
4347
### **Enhanced Testing & Operations**
4448
- **Wallet Operations Testing** - Tests ETH reception, interface accessibility, and connectivity
4549
- **Infrastructure Validation** - Verifies all components are properly deployed and connected
46-
- **EntryPoint Integration** - Smart deployment of real or mock EntryPoint for ERC-4337 support
50+
- **EntryPoint v0.7 Integration** - Real EntryPoint deployment with ERC-4337 support
51+
- **ERC-4337 UserOp Testing** - Complete UserOperation creation, signing, and execution
52+
- **EntryPoint Deposit Management** - Automatic prefund deposit for gas payments
4753
- **NexusBootstrap Support** - Proper Nexus initialization component deployment
4854

55+
### **Base Sepolia Production Ready**
56+
- **Network Setup Script** - `setup-base-sepolia.js` validates network and account
57+
- **Package.json Scripts** - Dedicated Base Sepolia deployment commands
58+
- **Production Environment** - `NODE_ENV=production` configuration
59+
- **Gas Optimization** - Testnet-optimized gas settings
60+
- **Balance Validation** - Automatic ETH balance checking and warnings
61+
4962
### **Production Ready**
5063
- **Error handling** with detailed diagnostics
5164
- **Gas optimization** with configurable limits
@@ -55,11 +68,31 @@ The `deploy-infrastructure-and-wallet.js` script is a **complete, self-contained
5568
## Usage
5669

5770
### Prerequisites
58-
- Hardhat node running locally
71+
- For **Local Development**: Hardhat node running locally
72+
- For **Base Sepolia**: Private key and sufficient ETH balance
5973
- Environment variables configured (see `env-setup.md`)
6074
- Node.js with required dependencies
6175

62-
### Basic Deployment
76+
### Base Sepolia Deployment (Recommended)
77+
78+
#### Using Package.json Scripts
79+
```bash
80+
# 1. Setup and validate Base Sepolia
81+
npm run setup:base-sepolia
82+
83+
# 2. Deploy all infrastructure (steps 0-10)
84+
npm run deploy:steps:base-sepolia
85+
86+
# 3. Deploy wallet using existing infrastructure
87+
npm run deploy:wallet:base-sepolia
88+
89+
# Alternative: Deploy everything in one go
90+
npm run deploy:infrastructure:base-sepolia
91+
```
92+
93+
### Local Development Deployment
94+
95+
#### Basic Deployment
6396

6497
#### Default Method (Factory)
6598
```bash
@@ -239,17 +272,17 @@ Step 7: Nexus Initialization Step 8: ERC-4337 Support
239272
│ (Required) │ │ (ERC-4337) │
240273
└─────────────────┘ └──────────────────┘
241274
242-
Step 9: CFA-Compatible Factory Step 0: CREATE2 Foundation
275+
Step 9: Simplified Architecture Step 0: CREATE2 Foundation
243276
┌─────────────────┐ ┌──────────────────┐
244-
PassportCompatible│ ──uses──▶ │ OwnableCreate2 │
245-
NexusFactory │ │ Deployer │
246-
(CFA Compat) │ │ │
277+
NexusAccount │ ──uses──▶ │ OwnableCreate2 │
278+
Factory │ │ Deployer │
279+
(Direct Deploy) │ │ │
247280
└─────────────────┘ └──────────────────┘
248281
249282
Deployment Methods:
250-
CFA Factory: PassportCompatibleNexusFactory ──deploy──▶ Wallet (CFA compatible)
251-
• MultiCallDeploy: MultiCallDeploy ──deploy+execute──▶ Wallet + Initial TXs
252-
• Fallback: Factory ──deploy──▶ Wallet (if MultiCallDeploy fails)
283+
NexusAccountFactory: NexusAccountFactory ──deploy──▶ Nexus Wallet (CFA compatible)
284+
• MultiCallDeploy: MultiCallDeploy ──deploy+execute──▶ Wallet + Initial TXs (fallback)
285+
Automatic Fallback: NexusAccountFactory ──deploy──▶ Nexus Wallet (if MultiCallDeploy fails)
253286
```
254287

255288
## Configuration

0 commit comments

Comments
 (0)