four-flap-meme-sdk 1.6.38 → 1.6.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -697,14 +697,17 @@ export class AADexSwapExecutor {
|
|
|
697
697
|
for (let h = 0; h < effectiveHopCount; h++) {
|
|
698
698
|
const prefundedHop = prefundedHopWallets[hopIdx];
|
|
699
699
|
const wallet = new ethers.Wallet(prefundedHop.privateKey, provider);
|
|
700
|
+
// ✅ 关键修复:根据真实 nonce 判断是否已部署
|
|
701
|
+
// 如果 nonce > 0,说明钱包已经被使用过,肯定已部署,initCode 必须为 '0x'
|
|
702
|
+
const realNonce = hopNonces[hopIdx] ?? 0n;
|
|
703
|
+
const isDeployed = realNonce > 0n || prefundedHop.deployed;
|
|
704
|
+
const effectiveInitCode = isDeployed ? '0x' : prefundedHop.initCode;
|
|
700
705
|
chainHops.push({
|
|
701
706
|
wallet,
|
|
702
707
|
sender: prefundedHop.senderAddress,
|
|
703
|
-
deployed:
|
|
704
|
-
initCode:
|
|
708
|
+
deployed: isDeployed,
|
|
709
|
+
initCode: effectiveInitCode,
|
|
705
710
|
});
|
|
706
|
-
// ✅ 使用从链上获取的真实 nonce(而非硬编码 0)
|
|
707
|
-
const realNonce = hopNonces[hopIdx] ?? 0n;
|
|
708
711
|
nonceMap.init(prefundedHop.senderAddress, realNonce);
|
|
709
712
|
hopIdx++;
|
|
710
713
|
}
|
|
@@ -504,14 +504,17 @@ export class AAPortalSwapExecutor {
|
|
|
504
504
|
for (let h = 0; h < effectiveHopCount; h++) {
|
|
505
505
|
const prefundedHop = prefundedHopWallets[hopIdx];
|
|
506
506
|
const wallet = new ethers.Wallet(prefundedHop.privateKey, provider);
|
|
507
|
+
// ✅ 关键修复:根据真实 nonce 判断是否已部署
|
|
508
|
+
// 如果 nonce > 0,说明钱包已经被使用过,肯定已部署,initCode 必须为 '0x'
|
|
509
|
+
const realNonce = hopNonces[hopIdx] ?? 0n;
|
|
510
|
+
const isDeployed = realNonce > 0n || prefundedHop.deployed;
|
|
511
|
+
const effectiveInitCode = isDeployed ? '0x' : prefundedHop.initCode;
|
|
507
512
|
chainHops.push({
|
|
508
513
|
wallet,
|
|
509
514
|
sender: prefundedHop.senderAddress,
|
|
510
|
-
deployed:
|
|
511
|
-
initCode:
|
|
515
|
+
deployed: isDeployed,
|
|
516
|
+
initCode: effectiveInitCode,
|
|
512
517
|
});
|
|
513
|
-
// ✅ 使用从链上获取的真实 nonce(而非硬编码 0)
|
|
514
|
-
const realNonce = hopNonces[hopIdx] ?? 0n;
|
|
515
518
|
nonceMap.init(prefundedHop.senderAddress, realNonce);
|
|
516
519
|
hopIdx++;
|
|
517
520
|
}
|