Skip to content

Commit 280a246

Browse files
Fix steps and wallet-deployment to use create2
1 parent 31716b2 commit 280a246

12 files changed

Lines changed: 251 additions & 85 deletions

File tree

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
{
2-
"timestamp": "2025-09-24T23:24:09.028Z",
2+
"timestamp": "2025-09-25T01:46:27.488Z",
33
"status": "COMPLETE_SUCCESS",
4-
"network": "hardhat",
4+
"network": "localhost",
55
"deployer": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
66
"infrastructure": {
7-
"passportMultiCallDeploy": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
8-
"passportFactory": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
9-
"latestWalletImplLocator": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0",
10-
"startupWalletImpl": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9",
11-
"nexusK1Validator": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9",
12-
"nexusImplementation": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707",
13-
"immutableSigner": "0x0165878A594ca255338adfa4d48449f69242Eb8F",
7+
"passportMultiCallDeploy": "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82",
8+
"passportFactory": "0x9A676e781A523b5d0C0e43731313A708CB607508",
9+
"latestWalletImplLocator": "0x0B306BF915C4d645ff596e518fAf3F9669b97016",
10+
"startupWalletImpl": "0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1",
11+
"nexusK1Validator": "0x9A9f2CCfdE556A7E9Ff0848998Aa4a0CFD8863AE",
12+
"nexusImplementation": "0x68B1D87F95878fE05B998F19b66F4baba5De1aed",
13+
"immutableSigner": "0x3Aa5ebB10DC797CAC828524e59A333d0A371443c",
1414
"locatorToNexusConfigured": true,
15-
"configurationTxHash": "0x7252cc5800837c6d018039f29f0aa8e5d0598f04ce3fc8e05f32b9f75e2d2b7a"
15+
"configurationTxHash": "0x242b57db45a0de6feba790dedfb0a7d011df0d6b3f4a6e166e53cd4f5264349a"
1616
},
1717
"wallet": {
18-
"address": "0x828709bE90a398c2a21cB2EeC27A82866Aab7466",
18+
"address": "0x690466671732A777CB50c029f5B1dD9CEF9F8654",
1919
"owner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
20-
"mainModule": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707"
20+
"mainModule": "0x68B1D87F95878fE05B998F19b66F4baba5De1aed"
2121
}
2222
}

scripts/biconomy/steps/step0.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"create2DeployerAddress": "0x5FbDB2315678afecb367f032d93F642f64180aa3"
3+
}

scripts/biconomy/steps/step0.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import * as fs from 'fs';
12
import * as hre from 'hardhat';
23
import { EnvironmentInfo, loadEnvironmentInfo } from '../../environment';
34
import { newWalletOptions, WalletOptions } from '../../wallet-options';
@@ -27,6 +28,11 @@ async function step0(): Promise<EnvironmentInfo> {
2728
submitterAddress // Owner of the deployer
2829
]);
2930

31+
// Save deployment information
32+
fs.writeFileSync('scripts/biconomy/steps/step0.json', JSON.stringify({
33+
create2DeployerAddress: create2Deployer.address,
34+
}, null, 1));
35+
3036
console.log(`[${network}] Step 0 deployment completed`);
3137
console.log(`[${network}] OwnableCreate2Deployer deployed at: ${create2Deployer.address}`);
3238
console.log(`[${network}] IMPORTANT: Update DEPLOYER_CONTRACT_ADDRESS in .env to: ${create2Deployer.address}`);

scripts/biconomy/steps/step1.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"multiCallAdminPubKey": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
33
"factoryAdminPubKey": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
4-
"multiCallDeploy": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
5-
"factory": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"
4+
"multiCallDeploy": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
5+
"factory": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0"
66
}

scripts/biconomy/steps/step2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"walletImplLocatorAdmin": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
33
"walletImplChangerAdmin": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
4-
"latestWalletImplLocator": "0x5FbDB2315678afecb367f032d93F642f64180aa3"
4+
"latestWalletImplLocator": "0xAe74a658ecB4b944D82a4C86F392EF4061c548e9"
55
}

scripts/biconomy/steps/step2.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as fs from 'fs';
22
import * as hre from 'hardhat';
33
import { EnvironmentInfo, loadEnvironmentInfo } from '../../environment';
44
import { newWalletOptions, WalletOptions } from '../../wallet-options';
5-
import { deployContract } from '../../contract';
5+
import { deployContractViaCREATE2 } from '../../contract';
66
import { waitForInput } from '../../helper-functions';
77

88
/**
@@ -30,12 +30,19 @@ async function step2(): Promise<EnvironmentInfo> {
3030
// Setup wallet
3131
const wallets: WalletOptions = await newWalletOptions(env);
3232

33-
// Deploy LatestWalletImplLocator using direct deployment
34-
console.log(`[${network}] Deploying LatestWalletImplLocator...`);
35-
const latestWalletImplLocator = await deployContract(env, wallets, 'LatestWalletImplLocator', [
36-
walletImplLocatorAdmin,
37-
walletImplChangerAdmin
38-
]);
33+
// Deploy LatestWalletImplLocator using CREATE2
34+
console.log(`[${network}] Deploying LatestWalletImplLocator via CREATE2...`);
35+
let latestWalletImplLocator;
36+
try {
37+
latestWalletImplLocator = await deployContractViaCREATE2(env, wallets, 'LatestWalletImplLocator', [
38+
walletImplLocatorAdmin,
39+
walletImplChangerAdmin
40+
]);
41+
console.log(`[${network}] LatestWalletImplLocator deployed at: ${latestWalletImplLocator.address}`);
42+
} catch (error) {
43+
console.error('Error deploying LatestWalletImplLocator via CREATE2:', error);
44+
throw error;
45+
}
3946

4047
// Save deployment information
4148
fs.writeFileSync('scripts/biconomy/steps/step2.json', JSON.stringify({

scripts/biconomy/steps/step3.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"walletImplLocatorAddress": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
3-
"startupWalletImpl": "0x5FbDB2315678afecb367f032d93F642f64180aa3"
2+
"walletImplLocatorAddress": "0xAe74a658ecB4b944D82a4C86F392EF4061c548e9",
3+
"startupWalletImpl": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9"
44
}

scripts/biconomy/steps/step4.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"factoryAddress": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
3-
"startupWalletImplAddress": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
2+
"factoryAddress": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0",
3+
"startupWalletImplAddress": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9",
44
"entryPointAddress": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
55
"validator": {
6-
"address": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
6+
"address": "0x79122DBB6bb40682b207F974BD749eC5EeCB5e8C",
77
"owner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
88
"initData": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
99
},
10-
"nexus": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"
10+
"nexus": "0xD6615a6D0A255c9af6cA4009e814cCc0b8a5348F"
1111
}

scripts/biconomy/steps/step4.ts

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as hre from 'hardhat';
33
import { utils } from 'ethers';
44
import { EnvironmentInfo, loadEnvironmentInfo } from '../../environment';
55
import { newWalletOptions, WalletOptions } from '../../wallet-options';
6-
import { deployContract } from '../../contract';
6+
import { deployContractViaCREATE2 } from '../../contract';
77
import { waitForInput } from '../../helper-functions';
88

99
/**
@@ -45,20 +45,34 @@ async function step4(): Promise<EnvironmentInfo> {
4545
const deployerAddress = await wallets.getWallet().getAddress();
4646

4747
// Deploy K1Validator (Nexus core validator)
48-
console.log(`[${network}] Deploying K1Validator (Nexus core)...`);
49-
const validator = await deployContract(env, wallets, 'K1Validator', []);
48+
console.log(`[${network}] Deploying K1Validator (Nexus core) via CREATE2...`);
49+
let validator;
50+
try {
51+
validator = await deployContractViaCREATE2(env, wallets, 'K1Validator', []);
52+
console.log(`[${network}] ✅ K1Validator deployed at: ${validator.address}`);
53+
} catch (error) {
54+
console.error('❌ Error deploying K1Validator via CREATE2:', error);
55+
throw error;
56+
}
5057

5158
// Deploy Nexus Implementation (integrating with Passport infrastructure)
5259
console.log(`[${network}] Deploying Nexus implementation...`);
5360
const validatorInitData = utils.hexConcat([deployerAddress]);
5461
console.log(`[${network}] K1Validator init data: ${validatorInitData}`);
5562

56-
// Deploy Nexus (core smart account implementation)
57-
const nexus = await deployContract(env, wallets, 'Nexus', [
58-
entryPointAddress, // EntryPoint for Account Abstraction
59-
validator.address, // K1Validator for signature validation
60-
validatorInitData // Initialization data for the validator
61-
]);
63+
// Deploy Nexus (core smart account implementation) via CREATE2
64+
let nexus;
65+
try {
66+
nexus = await deployContractViaCREATE2(env, wallets, 'Nexus', [
67+
entryPointAddress, // EntryPoint for Account Abstraction
68+
validator.address, // K1Validator for signature validation
69+
validatorInitData // Initialization data for the validator
70+
]);
71+
console.log(`[${network}] ✅ Nexus implementation deployed at: ${nexus.address}`);
72+
} catch (error) {
73+
console.error('❌ Error deploying Nexus via CREATE2:', error);
74+
throw error;
75+
}
6276

6377
// Save deployment information
6478
fs.writeFileSync('scripts/biconomy/steps/step4.json', JSON.stringify({

scripts/biconomy/steps/step5.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"signerRootAdminPubKey": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
33
"signerAdminPubKey": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
44
"signerAddress": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
5-
"immutableSigner": "0x5FbDB2315678afecb367f032d93F642f64180aa3"
5+
"immutableSigner": "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853"
66
}

0 commit comments

Comments
 (0)