@@ -5,8 +5,8 @@ This guide provides comprehensive instructions for deploying Account Abstraction
5
5
## 📋 Overview
6
6
7
7
The deployment script deploys three core contracts:
8
- - ** EntryPoint ** : The main entry point for ERC-4337 user operations
9
- - ** OmniAccountFactory ** : Factory contract for creating OmniAccount smart wallets
8
+ - ** EntryPointV1 ** : The main entry point for ERC-4337 user operations
9
+ - ** OmniAccountFactoryV1 ** : Factory contract for creating OmniAccount smart wallets
10
10
- ** SimplePaymaster** : Paymaster contract for sponsoring transactions
11
11
12
12
## 🔧 Prerequisites
@@ -30,13 +30,17 @@ The script automatically detects and configures for these networks:
30
30
31
31
| Network | Chain ID | Filename |
32
32
| ---------| ----------| ----------|
33
- | Ethereum Mainnet | 1 | ` mainnet.json ` |
34
- | Ethereum Sepolia | 11155111 | ` sepolia.json ` |
33
+ | Ethereum Mainnet | 1 | ` ethereum.json ` |
34
+ | Ethereum Sepolia | 11155111 | ` ethereum-sepolia.json ` |
35
+ | Arbitrum Mainnet | 42161 | ` arbitrum.json ` |
36
+ | Arbitrum Sepolia | 421614 | ` arbitrum-sepolia.json ` |
35
37
| BSC Mainnet | 56 | ` bsc.json ` |
36
38
| BSC Testnet | 97 | ` bsc-testnet.json ` |
37
39
| Polygon Mainnet | 137 | ` polygon.json ` |
38
- | Polygon Mumbai | 80001 | ` mumbai.json ` |
39
- | Local Anvil | 1337 | ` local.json ` |
40
+ | Polygon Mumbai | 80001 | ` polygon-mumbai.json ` |
41
+ | HyperEVM Mainnet | 999 | ` hyperevm.json ` |
42
+ | HyperEVM Testnet | 998 | ` hyperevm-testnet.json ` |
43
+ | Local Anvil | 1337/31337 | ` local.json ` |
40
44
41
45
## ⚙️ Configuration
42
46
@@ -54,6 +58,7 @@ PAYMASTER_INITIAL_DEPOSIT=1000000000000000000 # 1 ETH in wei (default: 1 ETH)
54
58
INITIALIZE_PAYMASTER=true # Whether to initialize paymaster (default: true)
55
59
INITIAL_BUNDLER=0x1234567890abcdef... # Initial bundler address (default: deployer)
56
60
SAVE_DEPLOYMENT_FILE=true # Save deployment file (default: false, set true for official deployments)
61
+ DEPLOYMENT_ENV=staging # Environment subdirectory (e.g., staging, production)
57
62
ETHERSCAN_API_KEY=ABC123 # For contract verification
58
63
```
59
64
@@ -73,6 +78,24 @@ forge script script/Deploy.s.sol:Deploy \
73
78
-vvv
74
79
```
75
80
81
+ ### Using Remote Deployment Script (Recommended)
82
+
83
+ The ` deploy-remote.sh ` script handles deployment and automatic ABI enrichment:
84
+
85
+ ``` bash
86
+ # Set environment variables in .env
87
+ DEPLOYMENT_ENV=staging # Optional: staging, production, etc.
88
+
89
+ # Run the deployment script
90
+ ./deploy-remote.sh
91
+ ```
92
+
93
+ This script will:
94
+ 1 . Deploy all contracts to the specified network
95
+ 2 . Save enhanced artifacts with addresses and bytecode
96
+ 3 . Automatically enrich artifacts with ABIs from Foundry build outputs
97
+ 4 . Save to ` deployments/[environment]/[network].json `
98
+
76
99
77
100
### Ethereum Mainnet with Verification
78
101
``` bash
@@ -98,11 +121,11 @@ Chain ID: 97
98
121
Deployer address: 0x...
99
122
Deployer balance: 1.5 ETH
100
123
101
- 🚀 Deploying EntryPoint ...
102
- ✅ EntryPoint deployed at: 0x...
124
+ 🚀 Deploying EntryPointV1 ...
125
+ ✅ EntryPointV1 deployed at: 0x...
103
126
104
- 🚀 Deploying OmniAccountFactory ...
105
- ✅ OmniAccountFactory deployed at: 0x...
127
+ 🚀 Deploying OmniAccountFactoryV1 ...
128
+ ✅ OmniAccountFactoryV1 deployed at: 0x...
106
129
107
130
🚀 Deploying SimplePaymaster...
108
131
✅ SimplePaymaster deployed at: 0x...
@@ -112,33 +135,73 @@ Deployer balance: 1.5 ETH
112
135
113
136
=== DEPLOYMENT COMPLETE ===
114
137
📋 Contract Addresses:
115
- EntryPoint : 0x...
116
- OmniAccountFactory : 0x...
117
- SimplePaymaster: 0x...
138
+ EntryPointV1 : 0x...
139
+ OmniAccountFactoryV1 : 0x...
140
+ SimplePaymaster: 0x...
118
141
```
119
142
120
- ### JSON File
121
- Location: ` deployments/bsc-testnet.json `
143
+ ### JSON File (Enhanced Artifacts)
144
+ Location: ` deployments/[environment]/[network].json ` (e.g., ` deployments/staging/bsc-testnet.json ` )
145
+
122
146
``` json
123
147
{
124
148
"network" : " BSC Testnet" ,
125
149
"chainId" : 97 ,
126
150
"timestamp" : 1703001234 ,
151
+ "blockNumber" : 123456 ,
127
152
"deployer" : " 0x..." ,
128
153
"contracts" : {
129
- "EntryPoint" : " 0x..." ,
130
- "OmniAccountFactory" : " 0x..." ,
131
- "SimplePaymaster" : " 0x..."
154
+ "EntryPointV1" : {
155
+ "address" : " 0x..." ,
156
+ "abi" : [... ], // Full contract ABI
157
+ "bytecode" : " 0x608060..." , // Deployed bytecode
158
+ "metadata" : {}
159
+ },
160
+ "OmniAccountFactoryV1" : {
161
+ "address" : " 0x..." ,
162
+ "abi" : [... ],
163
+ "bytecode" : " 0x608060..." ,
164
+ "metadata" : {}
165
+ },
166
+ "SimplePaymaster" : {
167
+ "address" : " 0x..." ,
168
+ "abi" : [... ],
169
+ "bytecode" : " 0x608060..." ,
170
+ "metadata" : {
171
+ "initialBundler" : " 0x..."
172
+ }
173
+ }
132
174
}
133
175
}
134
176
```
135
177
178
+ The artifacts are saved in environment-based subdirectories:
179
+ - ** Local** : ` deployments/local/ `
180
+ - ** Staging** : ` deployments/staging/ `
181
+ - ** Production** : ` deployments/production/ `
182
+ - ** No environment** : ` deployments/ ` (backward compatible)
183
+
136
184
### Broadcast Files
137
185
Foundry creates detailed transaction logs in:
138
186
```
139
187
broadcast/Deploy.s.sol/[CHAIN_ID]/run-latest.json
140
188
```
141
189
190
+ ## 📝 ABI Enrichment
191
+
192
+ The deployment scripts automatically enrich artifacts with contract ABIs after deployment. If this fails or you need to manually enrich:
193
+
194
+ ``` bash
195
+ # Run the ABI enrichment script
196
+ node extract-abis.js
197
+ ```
198
+
199
+ This script:
200
+ - Reads all deployment files from ` deployments/ `
201
+ - Extracts ABIs from Foundry build artifacts
202
+ - Updates deployment files with full contract ABIs
203
+ - Handles both old (address-only) and new (enhanced) formats
204
+
142
205
## 🔍 Contract Verification
143
206
144
207
### Automatic Verification
@@ -157,20 +220,20 @@ forge script script/Deploy.s.sol:Deploy \
157
220
If automatic verification fails:
158
221
159
222
``` bash
160
- # Verify EntryPoint
223
+ # Verify EntryPointV1
161
224
forge verify-contract \
162
225
--chain-id [CHAIN_ID] \
163
226
--constructor-args $( cast abi-encode " constructor()" ) \
164
227
[ENTRYPOINT_ADDRESS] \
165
- src/core/EntryPoint .sol:EntryPoint \
228
+ src/core/EntryPointV1 .sol:EntryPointV1 \
166
229
--etherscan-api-key $ETHERSCAN_API_KEY
167
230
168
231
# Verify Factory
169
232
forge verify-contract \
170
233
--chain-id [CHAIN_ID] \
171
234
--constructor-args $( cast abi-encode " constructor(address)" [ENTRYPOINT_ADDRESS]) \
172
235
[FACTORY_ADDRESS] \
173
- src/accounts/OmniAccountFactory .sol:OmniAccountFactory \
236
+ src/accounts/OmniAccountFactoryV1 .sol:OmniAccountFactoryV1 \
174
237
--etherscan-api-key $ETHERSCAN_API_KEY
175
238
176
239
# Verify Paymaster
@@ -186,18 +249,32 @@ forge verify-contract \
186
249
187
250
### Deployment Files Management
188
251
189
- The script can optionally create deployment files in ` deployments/ ` folder when ` SAVE_DEPLOYMENT_FILE=true ` . For official deployments:
252
+ The script creates enhanced deployment files when ` SAVE_DEPLOYMENT_FILE=true ` . For official deployments:
190
253
191
254
``` bash
192
255
# After successful deployment, commit only official deployment files
193
- git add deployments/mainnet .json # For Ethereum mainnet
194
- git add deployments/bsc .json # For BSC mainnet
195
- git add deployments/bsc-testnet.json # For BSC testnet (if official)
256
+ git add deployments/production/ethereum .json # For Ethereum mainnet
257
+ git add deployments/production/arbitrum .json # For Arbitrum mainnet
258
+ git add deployments/staging/ bsc-testnet.json # For BSC testnet staging
196
259
git commit -m " Deploy AA contracts to mainnet"
197
260
198
261
# Tag official releases
199
262
git tag v1.0.0-mainnet
200
263
git push origin v1.0.0-mainnet
201
264
```
202
265
266
+ ### Using Deployment Artifacts
267
+
268
+ ``` javascript
269
+ // Load deployment artifacts in your application
270
+ const deployment = require (' ./deployments/staging/arbitrum-sepolia.json' );
271
+
272
+ // Access contract addresses and ABIs
273
+ const entryPointAddress = deployment .contracts .EntryPointV1 .address ;
274
+ const entryPointABI = deployment .contracts .EntryPointV1 .abi ;
275
+
276
+ // Create contract instance (ethers.js example)
277
+ const entryPoint = new ethers.Contract (entryPointAddress, entryPointABI, provider);
278
+ ```
279
+
203
280
** Note** : The ` broadcast/ ` folder is in ` .gitignore ` and should not be committed as it contains transaction details that change with each deployment run.
0 commit comments