Skip to content

Commit c681320

Browse files
Simplify NexusAccountFactory methods params
1 parent 20f02cc commit c681320

15 files changed

Lines changed: 81 additions & 147 deletions

File tree

scripts/biconomy/deploy-infrastructure-and-wallet.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,21 +143,18 @@ async function deployWalletWithNexusFactory(infrastructure, deployer, network) {
143143
console.log(`[${network}] 📋 EntryPoint: ${infrastructure.entryPoint}`);
144144
console.log(`[${network}] 📋 K1Validator: ${infrastructure.k1ValidatorModule}`);
145145

146-
// Create initData for NexusAccountFactory: [entryPoint, validator, owner]
147-
const initData = hre.ethers.utils.defaultAbiCoder.encode(
148-
['address', 'address', 'address'],
149-
[infrastructure.entryPoint, infrastructure.k1ValidatorModule, deployer.address]
150-
);
146+
// Using simplified signature: just pass the mainModule (Nexus implementation)
147+
const mainModule = infrastructure.nexus;
151148

152149
// Generate deployment salt
153150
const salt = hre.ethers.utils.formatBytes32String(`nexus-${Date.now()}`);
154151

155-
console.log(`[${network}] 📋 InitData: [entryPoint, validator, owner]`);
152+
console.log(`[${network}] 📋 MainModule (Nexus Implementation): ${mainModule}`);
156153
console.log(`[${network}] 📋 Owner: ${deployer.address}`);
157154
console.log(`[${network}] 📋 Salt: ${salt}`);
158155

159156
// Predict wallet address (CFA compatibility)
160-
const predictedAddress = await factory.computeAccountAddress(initData, salt);
157+
const predictedAddress = await factory.computeAccountAddress(mainModule, salt);
161158
console.log(`[${network}] 🔮 Predicted address: ${predictedAddress}`);
162159

163160
// Check if wallet already exists
@@ -170,7 +167,7 @@ async function deployWalletWithNexusFactory(infrastructure, deployer, network) {
170167
// Deploy wallet
171168
console.log(`[${network}] 🔨 Deploying Nexus wallet...`);
172169

173-
const deployTx = await factory.createAccount(initData, salt, {
170+
const deployTx = await factory.createAccount(mainModule, salt, {
174171
gasLimit: 10000000,
175172
maxFeePerGas: hre.ethers.utils.parseUnits('20', 'gwei'),
176173
maxPriorityFeePerGas: hre.ethers.utils.parseUnits('2', 'gwei')
@@ -202,7 +199,8 @@ async function deployWalletWithNexusFactory(infrastructure, deployer, network) {
202199
const codeSize = Math.floor(deployedCode.length / 2);
203200
console.log(`[${network}] 📏 Deployed code size: ${codeSize} bytes`);
204201

205-
if (codeSize < 100) {
202+
// WalletProxy.yul has 53 bytes, which is correct for a minimal proxy
203+
if (codeSize < 50) {
206204
throw new Error(`Wallet deployment failed - code too small (${codeSize} bytes)`);
207205
}
208206

scripts/biconomy/steps/step0.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"create2DeployerAddress": "0xa82fF9aFd8f496c3d6ac40E2a0F282E47488CFc9",
2+
"create2DeployerAddress": "0x3a622DB2db50f463dF562Dc5F341545A64C580fc",
33
"owner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
44
"network": "localhost",
5-
"deployedAt": "2025-10-02T00:36:02.752Z",
5+
"deployedAt": "2025-10-02T21:54:03.034Z",
66
"codeSize": 3125
77
}

scripts/biconomy/steps/step1.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"walletImplLocatorAdmin": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
3-
"walletImplChangerAdmin": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
4-
"latestWalletImplLocator": "0xEb05D441ac924763943fca653E39D8b5CE00bf5D"
2+
"walletImplLocatorAdmin": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
3+
"walletImplChangerAdmin": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
4+
"latestWalletImplLocator": "0xEC1f7A4dE5b28B89a0cC3e50456D99Ad5583E9a6"
55
}

scripts/biconomy/steps/step2.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"walletImplLocatorAddress": "0xEb05D441ac924763943fca653E39D8b5CE00bf5D",
3-
"startupWalletImpl": "0xf5059a5D33d5853360D16C683c16e67980206f36"
2+
"walletImplLocatorAddress": "0xEC1f7A4dE5b28B89a0cC3e50456D99Ad5583E9a6",
3+
"startupWalletImpl": "0x7A28cf37763279F774916b85b5ef8b64AB421f79"
44
}

scripts/biconomy/steps/step3.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"entryPoint": "0x95401dc811bb5740090279Ba06cfA8fcF6113778",
3-
"source": "deployed_v07",
4-
"codeSize": 19652
2+
"entryPoint": "0x2BB8B93F585B43b06F3d523bf30C203d3B6d4BD4",
3+
"source": "deployed_v07",
4+
"codeSize": 19652
55
}

scripts/biconomy/steps/step4.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{
2-
"factoryAddress": "0x70E5370b8981Abc6e14C91F4AcE823954EFC8eA3",
3-
"startupWalletImplAddress": "0xf5059a5D33d5853360D16C683c16e67980206f36",
4-
"entryPointAddress": "0x95401dc811bb5740090279Ba06cfA8fcF6113778",
2+
"startupWalletImplAddress": "0x7A28cf37763279F774916b85b5ef8b64AB421f79",
3+
"entryPointAddress": "0x2BB8B93F585B43b06F3d523bf30C203d3B6d4BD4",
54
"validator": {
6-
"address": "0xC1f25e96F8A3597a5eE98ec4bFa21463C33Abee2",
5+
"address": "0x61Bd4b3B8B99cd0ab450a8581495937B8FfBfFbD",
76
"owner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
87
},
9-
"nexus": "0x3D0b49f735B02eB5126aFb5944d837149C443fA8"
8+
"nexus": "0x8aD5Ee9206Fd5aebE36850281337cA5c67Aef98C"
109
}

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": "0x4826533B4897376654Bb4d4AD88B7faFD0C98528"
5+
"immutableSigner": "0x2d13826359803522cCe7a4Cfa2c1b582303DD0B4"
66
}

scripts/biconomy/steps/step6.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"nexusImplAddress": "0x3D0b49f735B02eB5126aFb5944d837149C443fA8",
3-
"walletImplLocatorContractAddress": "0xEb05D441ac924763943fca653E39D8b5CE00bf5D",
4-
"transactionHash": "0xad58d910e05c2d5b1c1200a63df7545f0c570fffd166b3d489c5eeddce6ef2e8"
2+
"nexusImplAddress": "0x8aD5Ee9206Fd5aebE36850281337cA5c67Aef98C",
3+
"walletImplLocatorContractAddress": "0xEC1f7A4dE5b28B89a0cC3e50456D99Ad5583E9a6",
4+
"transactionHash": "0x41d8da5ded43bf3143319b0bcb485bb5e6b81bd694271175fa88bf495d662a6d"
55
}

scripts/biconomy/steps/step7.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"multiCallAdminPubKey": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
3-
"factoryAdminPubKey": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
4-
"multiCallDeploy": "0xA21DDc1f17dF41589BC6A5209292AED2dF61Cc94",
5-
"nexusBootstrap": "0x2A590C461Db46bca129E8dBe5C3998A8fF402e76",
6-
"nexusAccountFactory": "0x158d291D8b47F056751cfF47d1eEcd19FDF9B6f8",
7-
"factory": "0x158d291D8b47F056751cfF47d1eEcd19FDF9B6f8",
8-
"validatorAddress": "0xC1f25e96F8A3597a5eE98ec4bFa21463C33Abee2"
2+
"multiCallAdminPubKey": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
3+
"factoryAdminPubKey": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
4+
"multiCallDeploy": "0xc3023a2c9f7B92d1dd19F488AF6Ee107a78Df9DB",
5+
"nexusBootstrap": "0x124dDf9BdD2DdaD012ef1D5bBd77c00F05C610DA",
6+
"nexusAccountFactory": "0xe044814c9eD1e6442Af956a817c161192cBaE98F",
7+
"factory": "0xe044814c9eD1e6442Af956a817c161192cBaE98F",
8+
"validatorAddress": "0x61Bd4b3B8B99cd0ab450a8581495937B8FfBfFbD"
99
}

scripts/biconomy/steps/step8.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"timestamp": "2025-10-02T03:35:44.005Z",
2+
"timestamp": "2025-10-02T21:54:19.541Z",
33
"network": "localhost",
44
"deployer": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
55
"step": 8,
66
"description": "K1ValidatorFactory (Complete Factory)",
7-
"k1ValidatorFactory": "0x21dF544947ba3E8b3c32561399E88B52Dc8b2823",
8-
"accountImplementation": "0x1F8165fEb0B7Ca66F98D6C590F86692302ef8060",
9-
"k1ValidatorModule": "0xFFefF1dF7C9104e0D3Eea5d4Cf76ab1cE82aA355",
10-
"bootstrapper": "0x0E801D84Fa97b50751Dbf25036d067dCf18858bF",
7+
"k1ValidatorFactory": "0xaB837301d12cDc4b97f1E910FC56C9179894d9cf",
8+
"accountImplementation": "0x8aD5Ee9206Fd5aebE36850281337cA5c67Aef98C",
9+
"k1ValidatorModule": "0x61Bd4b3B8B99cd0ab450a8581495937B8FfBfFbD",
10+
"bootstrapper": "0x124dDf9BdD2DdaD012ef1D5bBd77c00F05C610DA",
1111
"registry": "0x0000000000000000000000000000000000000000",
1212
"codeSize": 6677,
1313
"configurationVerified": true,

0 commit comments

Comments
 (0)