@black-market/sdk 0.11.0 → 0.13.0
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.
- package/README.md +96 -79
- package/dist/lifecycle/abi.d.ts +1 -0
- package/dist/lifecycle/abi.d.ts.map +1 -1
- package/dist/lifecycle/abi.js +1 -0
- package/dist/lifecycle/abi.js.map +1 -1
- package/dist/lifecycle/deployments/ufg-dynamic-pool-20261021.d.ts +71 -0
- package/dist/lifecycle/deployments/ufg-dynamic-pool-20261021.d.ts.map +1 -0
- package/dist/lifecycle/deployments/ufg-dynamic-pool-20261021.js +73 -0
- package/dist/lifecycle/deployments/ufg-dynamic-pool-20261021.js.map +1 -0
- package/dist/lifecycle/deployments/ufg-fixed-pool-20261021.d.ts +71 -0
- package/dist/lifecycle/deployments/ufg-fixed-pool-20261021.d.ts.map +1 -0
- package/dist/lifecycle/deployments/ufg-fixed-pool-20261021.js +73 -0
- package/dist/lifecycle/deployments/ufg-fixed-pool-20261021.js.map +1 -0
- package/dist/lifecycle/index.d.ts +1 -0
- package/dist/lifecycle/index.d.ts.map +1 -1
- package/dist/lifecycle/index.js +1 -0
- package/dist/lifecycle/index.js.map +1 -1
- package/dist/lifecycle/markets.d.ts +3 -1
- package/dist/lifecycle/markets.d.ts.map +1 -1
- package/dist/lifecycle/markets.js +20 -3
- package/dist/lifecycle/markets.js.map +1 -1
- package/dist/lifecycle/planner.d.ts.map +1 -1
- package/dist/lifecycle/planner.js +101 -46
- package/dist/lifecycle/planner.js.map +1 -1
- package/dist/lifecycle/presets.d.ts +4 -2
- package/dist/lifecycle/presets.d.ts.map +1 -1
- package/dist/lifecycle/presets.js +11 -4
- package/dist/lifecycle/presets.js.map +1 -1
- package/dist/lifecycle/progress.d.ts +3 -1
- package/dist/lifecycle/progress.d.ts.map +1 -1
- package/dist/lifecycle/progress.js +145 -59
- package/dist/lifecycle/progress.js.map +1 -1
- package/dist/lifecycle/rpc.d.ts +8 -2
- package/dist/lifecycle/rpc.d.ts.map +1 -1
- package/dist/lifecycle/rpc.js +165 -9
- package/dist/lifecycle/rpc.js.map +1 -1
- package/dist/lifecycle/simulation.d.ts +1 -1
- package/dist/lifecycle/simulation.d.ts.map +1 -1
- package/dist/lifecycle/simulation.js +15 -11
- package/dist/lifecycle/simulation.js.map +1 -1
- package/dist/lifecycle/types.d.ts +23 -1
- package/dist/lifecycle/types.d.ts.map +1 -1
- package/dist/lifecycle/types.js.map +1 -1
- package/dist/lifecycle/ufg-abi.d.ts +2386 -0
- package/dist/lifecycle/ufg-abi.d.ts.map +1 -0
- package/dist/lifecycle/ufg-abi.js +171 -0
- package/dist/lifecycle/ufg-abi.js.map +1 -0
- package/dist/lifecycle/ufg-config.d.ts +38 -0
- package/dist/lifecycle/ufg-config.d.ts.map +1 -0
- package/dist/lifecycle/ufg-config.js +75 -0
- package/dist/lifecycle/ufg-config.js.map +1 -0
- package/dist/lifecycle/ufg.d.ts +21 -0
- package/dist/lifecycle/ufg.d.ts.map +1 -0
- package/dist/lifecycle/ufg.js +98 -0
- package/dist/lifecycle/ufg.js.map +1 -0
- package/docs/launch-lifecycle.md +611 -1363
- package/docs/reference.md +332 -0
- package/examples/.env.example +3 -2
- package/examples/README.md +172 -539
- package/examples/launch-example-support.ts +11 -3
- package/examples/launch-example.ts +1 -1
- package/examples/launch-lifecycle-smoke.ts +1 -1
- package/examples/ufg-launch-config.ts +31 -0
- package/package.json +1 -1
- package/src/lifecycle/abi.ts +1 -0
- package/src/lifecycle/deployments/ufg-dynamic-pool-20261021.ts +74 -0
- package/src/lifecycle/deployments/ufg-fixed-pool-20261021.ts +74 -0
- package/src/lifecycle/index.ts +1 -0
- package/src/lifecycle/markets.ts +16 -3
- package/src/lifecycle/planner.ts +95 -45
- package/src/lifecycle/presets.ts +11 -4
- package/src/lifecycle/progress.ts +131 -51
- package/src/lifecycle/rpc.ts +158 -10
- package/src/lifecycle/simulation.ts +14 -10
- package/src/lifecycle/types.ts +15 -2
- package/src/lifecycle/ufg-abi.ts +173 -0
- package/src/lifecycle/ufg-config.ts +77 -0
- package/src/lifecycle/ufg.ts +86 -0
|
@@ -9,7 +9,9 @@ export declare enum KnownLifecycleProfile {
|
|
|
9
9
|
V4FixedFeePool = "v4-fixed-fee-pool",
|
|
10
10
|
V4DynamicFeePool = "v4-dynamic-fee-pool",
|
|
11
11
|
V4HmmFixedPool = "v4-hmm-fixed-pool",
|
|
12
|
-
V4HmmDynamicPool = "v4-hmm-dynamic-pool"
|
|
12
|
+
V4HmmDynamicPool = "v4-hmm-dynamic-pool",
|
|
13
|
+
V4UfgFixedPool = "v4-ufg-fixed-pool",
|
|
14
|
+
V4UfgDynamicPool = "v4-ufg-dynamic-pool"
|
|
13
15
|
}
|
|
14
16
|
export declare enum KnownLifecycleHook {
|
|
15
17
|
FixedFeePoolV1 = "fixed-fee-pool-v1",
|
|
@@ -67,7 +69,7 @@ export declare function getKnownLifecycleProfile(options: KnownLifecycleDeployme
|
|
|
67
69
|
profileId: Hex;
|
|
68
70
|
key?: never;
|
|
69
71
|
})): LifecycleProfilePreset | undefined;
|
|
70
|
-
/** Stable, frozen order: Abyss variants
|
|
72
|
+
/** Stable, frozen order: Abyss variants, fixed/dynamic V4, HMM, then UFG fixed/dynamic. */
|
|
71
73
|
export declare function listKnownLifecycleProfiles(options: KnownLifecycleDeploymentIdentity): readonly LifecycleProfilePreset[];
|
|
72
74
|
export {};
|
|
73
75
|
//# sourceMappingURL=presets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../src/lifecycle/presets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,EAC+B,YAAY,EACtD,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"presets.d.ts","s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,GAAG,SAAS,sBAAsB,EAAE,CAEvH"}
|
|
@@ -3,6 +3,9 @@ import { dynamicFeePoolHookV1CreationCode } from "./deployments/dynamic-fee-pool
|
|
|
3
3
|
import { hmmFixedEnvelope, hmmFixedAdapter, hmmFixedRegistration, hmmFixedCreationCode } from "./deployments/hmm-fixed-pool-hook-v2-20261017.js";
|
|
4
4
|
import { hmmDynamicEnvelope, hmmDynamicAdapter, hmmDynamicRegistration, hmmDynamicCreationCode } from "./deployments/hmm-dynamic-pool-hook-v2-20261017.js";
|
|
5
5
|
import { HMM_FIXED_PROFILE_ID, HMM_DYNAMIC_PROFILE_ID, isHmmProfile } from "./hmm.js";
|
|
6
|
+
import { ufgFixedEnvelope, ufgFixedAdapter, ufgFixedRegistration } from "./deployments/ufg-fixed-pool-20261021.js";
|
|
7
|
+
import { ufgDynamicEnvelope, ufgDynamicAdapter, ufgDynamicRegistration } from "./deployments/ufg-dynamic-pool-20261021.js";
|
|
8
|
+
import { UFG_FIXED_PROFILE_ID, UFG_DYNAMIC_PROFILE_ID } from "./ufg-config.js";
|
|
6
9
|
export var KnownLifecycleProfile;
|
|
7
10
|
(function (KnownLifecycleProfile) {
|
|
8
11
|
KnownLifecycleProfile["Abyss0"] = "abyss-0";
|
|
@@ -13,6 +16,8 @@ export var KnownLifecycleProfile;
|
|
|
13
16
|
KnownLifecycleProfile["V4DynamicFeePool"] = "v4-dynamic-fee-pool";
|
|
14
17
|
KnownLifecycleProfile["V4HmmFixedPool"] = "v4-hmm-fixed-pool";
|
|
15
18
|
KnownLifecycleProfile["V4HmmDynamicPool"] = "v4-hmm-dynamic-pool";
|
|
19
|
+
KnownLifecycleProfile["V4UfgFixedPool"] = "v4-ufg-fixed-pool";
|
|
20
|
+
KnownLifecycleProfile["V4UfgDynamicPool"] = "v4-ufg-dynamic-pool";
|
|
16
21
|
})(KnownLifecycleProfile || (KnownLifecycleProfile = {}));
|
|
17
22
|
export var KnownLifecycleHook;
|
|
18
23
|
(function (KnownLifecycleHook) {
|
|
@@ -240,7 +245,7 @@ export function hmmV2ForwardingReserve(plan) {
|
|
|
240
245
|
count += 1;
|
|
241
246
|
return count === 0 ? 0n : HMM_V2_FORWARDING_BASE_GAS + HMM_V2_FORWARDING_EXTRA_MARKET_GAS * BigInt(count - 1);
|
|
242
247
|
}
|
|
243
|
-
function
|
|
248
|
+
function poolBoundPreset(key, id, envelope, adapter, registration, creationCode) {
|
|
244
249
|
return Object.freeze({
|
|
245
250
|
key, supported: true,
|
|
246
251
|
profile: Object.freeze({
|
|
@@ -271,8 +276,10 @@ const knownDeployment = Object.freeze({
|
|
|
271
276
|
abyssPreset(KnownLifecycleProfile.Abyss3, "0xe1bd95e086469e6afd9791ccc957e4d22b735012cb3db4a747f703673c62c306"),
|
|
272
277
|
fixedFeePoolPreset,
|
|
273
278
|
dynamicFeePoolPreset,
|
|
274
|
-
|
|
275
|
-
|
|
279
|
+
poolBoundPreset(KnownLifecycleProfile.V4HmmFixedPool, HMM_FIXED_PROFILE_ID, hmmFixedEnvelope, hmmFixedAdapter, hmmFixedRegistration, hmmFixedCreationCode),
|
|
280
|
+
poolBoundPreset(KnownLifecycleProfile.V4HmmDynamicPool, HMM_DYNAMIC_PROFILE_ID, hmmDynamicEnvelope, hmmDynamicAdapter, hmmDynamicRegistration, hmmDynamicCreationCode),
|
|
281
|
+
poolBoundPreset(KnownLifecycleProfile.V4UfgFixedPool, UFG_FIXED_PROFILE_ID, ufgFixedEnvelope, ufgFixedAdapter, ufgFixedRegistration, fixedFeePoolHookV1CreationCode),
|
|
282
|
+
poolBoundPreset(KnownLifecycleProfile.V4UfgDynamicPool, UFG_DYNAMIC_PROFILE_ID, ufgDynamicEnvelope, ufgDynamicAdapter, ufgDynamicRegistration, dynamicFeePoolHookV1CreationCode),
|
|
276
283
|
]),
|
|
277
284
|
provenance: Object.freeze({ sourceCommit: "e174ce695c7010f50ca9211b07b9f178c990beac", deploymentBlock: 82880546n }),
|
|
278
285
|
});
|
|
@@ -304,7 +311,7 @@ export function getKnownLifecycleProfile(options) {
|
|
|
304
311
|
}
|
|
305
312
|
return undefined;
|
|
306
313
|
}
|
|
307
|
-
/** Stable, frozen order: Abyss variants
|
|
314
|
+
/** Stable, frozen order: Abyss variants, fixed/dynamic V4, HMM, then UFG fixed/dynamic. */
|
|
308
315
|
export function listKnownLifecycleProfiles(options) {
|
|
309
316
|
return getKnownLifecycleDeployment(options)?.profiles ?? noProfiles;
|
|
310
317
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presets.js","sourceRoot":"","sources":["../../src/lifecycle/presets.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,8BAA8B,EAAE,MAAM,kDAAkD,CAAC;AAClG,OAAO,EAAE,gCAAgC,EAAE,MAAM,oDAAoD,CAAC;AACtG,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AACjJ,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,oDAAoD,CAAC;AAC3J,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"presets.js","sourceRoot":"","sources":["../../src/lifecycle/presets.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,8BAA8B,EAAE,MAAM,kDAAkD,CAAC;AAClG,OAAO,EAAE,gCAAgC,EAAE,MAAM,oDAAoD,CAAC;AACtG,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AACjJ,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,oDAAoD,CAAC;AAC3J,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACtF,OAAO,EA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,CAAC,EAAE,CAAC,CAAC;AAExE,0FAA0F;AAC1F,MAAM,UAAU,2BAA2B,CAAC,OAAyC;IACnF,IAAI,CAAC,OAAO,CAAC,OAAO,KAAK,eAAe,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,KAAK,gBAAgB,CAAC;QACrF,OAAO,CAAC,YAAY,CAAC,WAAW,EAAE,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACvE,OAAO,eAAe,CAAC;AACzB,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,wBAAwB,CAAC,OAC8C;IACrF,MAAM,UAAU,GAAG,2BAA2B,CAAC,OAAO,CAAC,CAAC;IACxD,IAAI,UAAU,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC/C,IAAI,OAAO,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;QAC9B,KAAK,MAAM,MAAM,IAAI,UAAU,CAAC,QAAQ;YAAE,IAAI,MAAM,CAAC,GAAG,KAAK,OAAO,CAAC,GAAG;gBAAE,OAAO,MAAM,CAAC;IAC1F,CAAC;SAAM,CAAC;QACN,MAAM,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;QAC3C,KAAK,MAAM,MAAM,IAAI,UAAU,CAAC,QAAQ;YAAE,IAAI,MAAM,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE;gBAAE,OAAO,MAAM,CAAC;IACxF,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,0BAA0B,CAAC,OAAyC;IAClF,OAAO,2BAA2B,CAAC,OAAO,CAAC,EAAE,QAAQ,IAAI,UAAU,CAAC;AACtE,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { type Address, type Hex } from "viem";
|
|
2
|
-
import { type LaunchPlanV1, type MarketIdentityV1, type LaunchEnvelopeV2 } from "./schema.js";
|
|
2
|
+
import { type LaunchPlanV1, type LaunchProgressV1, type MarketIdentityV1, type LaunchEnvelopeV2 } from "./schema.js";
|
|
3
3
|
import { type CanonicalLaunchProgress, type LifecycleBlock, type LifecycleProfile, type LifecycleRpcClient, type PoolBoundHookDeployment, type ReadLaunchProgressOptions } from "./types.js";
|
|
4
4
|
export declare const ABYSS_LIFECYCLE_CONFIG_SCHEMA: `0x${string}`;
|
|
5
5
|
/** The known immutable factory accepts only launch identity and token config,
|
|
6
6
|
* avoiding full-plan prediction reads after salts or buy minima change. */
|
|
7
7
|
export declare function readLifecycleTokenAtBlock(client: LifecycleRpcClient, plan: LaunchPlanV1, block: LifecycleBlock): Promise<Address>;
|
|
8
|
+
/** Internal pinned head observation. Known cores do not inspect msg.sender. */
|
|
9
|
+
export declare function readLifecycleHeadProgress(client: LifecycleRpcClient, plan: LaunchPlanV1, account: Address, block: LifecycleBlock): Promise<LaunchProgressV1>;
|
|
8
10
|
export declare function predictLifecycleToken(options: {
|
|
9
11
|
client: LifecycleRpcClient;
|
|
10
12
|
plan: LaunchPlanV1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/lifecycle/progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgI,KAAK,OAAO,EAAa,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAGvL,OAAO,EAA0U,KAAK,YAAY,
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/lifecycle/progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgI,KAAK,OAAO,EAAa,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAGvL,OAAO,EAA0U,KAAK,YAAY,EAAE,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAqG,KAAK,gBAAgB,EAAgC,MAAM,aAAa,CAAC;AAE9jB,OAAO,EAA0B,KAAK,uBAAuB,EAAE,KAAK,cAAc,EAAgC,KAAK,gBAAgB,EAA+D,KAAK,kBAAkB,EAAE,KAAK,uBAAuB,EAA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A;CAAE,EAAE,WAAW,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAWlM;AAED,kHAAkH;AAClH,wBAAsB,uCAAuC,CAAC,OAAO,EAAE;IAAE,MAAM,EAAE,kBAAkB,CAAC;IAAC,IAAI,EAAE,YAAY,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,GAAG,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,uBAAuB,CAAA;CAAE,CAAC,CAavO;AAED,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAYzI;AAuHD,2GAA2G;AAC3G,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,EAAE,WAAW,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAQ3I"}
|
|
@@ -2,10 +2,12 @@ import { concatHex, decodeFunctionData, encodeAbiParameters, encodeFunctionData,
|
|
|
2
2
|
import { launchLifecycleAbi, lifecycleAdapterAbi, lifecycleDirectoryAbi, lifecycleErc20Abi, lifecycleOracleFactoryAbi, lifecycleRegistryAbi, poolFeeCollectorFactoryV1Abi, poolFeeCollectorFactoryConfigV6Abi, lifecycleV4HookAbi, lifecycleV4LockerAbi, poolHookDeployerV1Abi, poolHookDeployerConfigV6Abi, sharedHookDeployerV1Abi, fixedFeePoolHookV1Abi, fixedFeePoolHookConfigV6Abi, poolMarketAdapterV1Abi, sharedMarketAdapterV1Abi } from "./abi.js";
|
|
3
3
|
import { buildPoolBoundHookParameters, decodePoolBoundV4LifecycleMarketConfig, encodePoolBoundHookParameters, hasLifecycleV4HookPermissions, isPoolBoundV4ConfigVersion, poolBoundHookInitCodeHash, predictPoolBoundHookAddress, validateV4LifecycleMarket, V4_LIFECYCLE_CONFIG_SCHEMA, V4_POOL_BOUND_LIFECYCLE_CONFIG_SCHEMA_V5, V4_POOL_BOUND_LIFECYCLE_CONFIG_SCHEMA_V6 } from "./markets.js";
|
|
4
4
|
import { hashLaunchIdentity, hashLaunchPlan, hashLaunchBounds, hashLaunchDependencies, hashLifecycleProfile, lifecycleTokenComponents, launchProgressV1Components, LifecycleMode, LifecyclePhase, LifecycleVenue, LIFECYCLE_REQUIRED_CAPABILITIES, LIFECYCLE_ERC404_CAPABILITY, LIFECYCLE_MULTI_POSITION_CAPABILITY } from "./schema.js";
|
|
5
|
-
import { assertLifecycleBlock, assertLifecycleReadClientOpen, lifecycleFailureReason, lifecyclePinnedRpc, lifecycleStaticRpc, lifecycleRpc, lifecycleStage, readLifecycleBlock, readLifecycleChainId, readLifecycleContract, readLifecycleStaticContract, readLifecycleProfileTopology, rpcHex, rpcObject, rpcQuantity, withLifecycleReadClient } from "./rpc.js";
|
|
5
|
+
import { assertLifecycleBlock, assertLifecycleReadClientOpen, lifecycleFailureReason, lifecyclePinnedRpc, lifecycleStaticRpc, lifecycleRpc, lifecycleStage, readLifecycleBlock, readLifecycleChainId, readLifecycleContract, readLifecycleImmutable, readLifecycleStaticContract, readLifecycleProfileTopology, rpcHex, rpcObject, rpcQuantity, withLifecycleReadClient } from "./rpc.js";
|
|
6
6
|
import { LifecyclePlanningError } from "./types.js";
|
|
7
7
|
import { deriveKnownPoolBoundHookDeployment } from "./calibration.js";
|
|
8
8
|
import { getKnownLifecycleDeployment, getKnownLifecycleProfile } from "./presets.js";
|
|
9
|
+
import { ufgLaunchProxyV1Abi } from "./ufg-abi.js";
|
|
10
|
+
import { assertUfgLaunchAccount, hashUfgLaunchConfig, UFG_LAUNCH_PROXY_ADDRESS } from "./ufg-config.js";
|
|
9
11
|
export const ABYSS_LIFECYCLE_CONFIG_SCHEMA = keccak256(stringToHex("(uint8,uint24,bytes32,uint160,(int24,int24,uint128,uint256)[])"));
|
|
10
12
|
const lifecycleTokenPredictionAbi = [{
|
|
11
13
|
type: "function", name: "predictToken", stateMutability: "view",
|
|
@@ -16,9 +18,17 @@ const lifecycleTokenPredictionAbi = [{
|
|
|
16
18
|
* avoiding full-plan prediction reads after salts or buy minima change. */
|
|
17
19
|
export async function readLifecycleTokenAtBlock(client, plan, block) {
|
|
18
20
|
const deployment = getKnownLifecycleDeployment({ chainId: plan.chainId, orchestrator: plan.orchestrator });
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
if (deployment === undefined)
|
|
22
|
+
return readLifecycleContract(client, plan.orchestrator, launchLifecycleAbi, "predictToken", [plan], block);
|
|
23
|
+
const launchId = hashLaunchIdentity(plan);
|
|
24
|
+
const data = encodeFunctionData({ abi: lifecycleTokenPredictionAbi, functionName: "predictToken", args: [launchId, plan.token] });
|
|
25
|
+
const key = `${plan.chainId}:${plan.orchestrator.toLowerCase()}:${deployment.tokenFactory.toLowerCase()}:${deployment.tokenFactoryCodeHash}:${data}`;
|
|
26
|
+
return readLifecycleImmutable(client, key, () => readLifecycleContract(client, deployment.tokenFactory, lifecycleTokenPredictionAbi, "predictToken", [launchId, plan.token], block, undefined, false, true));
|
|
27
|
+
}
|
|
28
|
+
/** Internal pinned head observation. Known cores do not inspect msg.sender. */
|
|
29
|
+
export function readLifecycleHeadProgress(client, plan, account, block) {
|
|
30
|
+
const known = getKnownLifecycleDeployment({ chainId: plan.chainId, orchestrator: plan.orchestrator }) !== undefined;
|
|
31
|
+
return readLifecycleContract(client, plan.orchestrator, launchLifecycleAbi, "readLaunchProgress", [hashLaunchIdentity(plan)], block, account, false, known);
|
|
22
32
|
}
|
|
23
33
|
export async function predictLifecycleToken(options) {
|
|
24
34
|
return withLifecycleReadClient(options.client, async (client) => {
|
|
@@ -236,7 +246,7 @@ export async function validateV4LifecycleOracle(options) {
|
|
|
236
246
|
}
|
|
237
247
|
export async function readLifecycleProfiles(options, pinnedBlock) {
|
|
238
248
|
return withLifecycleReadClient(options.client, (client) => lifecycleStage(client, "profile.certification", async () => {
|
|
239
|
-
const chainIdPromise =
|
|
249
|
+
const chainIdPromise = readLifecycleChainId(client);
|
|
240
250
|
// Block-bound discovery does not depend on chain identity. Join both branches
|
|
241
251
|
// immediately so a failed chain read cannot become detached or a profile refusal.
|
|
242
252
|
const [chainId, { block, profiles }] = await Promise.all([
|
|
@@ -328,7 +338,7 @@ async function readPoolBoundHookDeploymentDetails(options, block, commitment) {
|
|
|
328
338
|
throw new LifecyclePlanningError("INVALID_BOUND_MARKET", "Market index must select explicit pool-bound config version 5 or 6");
|
|
329
339
|
let chainId;
|
|
330
340
|
try {
|
|
331
|
-
chainId =
|
|
341
|
+
chainId = await readLifecycleChainId(client);
|
|
332
342
|
}
|
|
333
343
|
finally {
|
|
334
344
|
assertDerivedReadClientOpen(client);
|
|
@@ -465,7 +475,7 @@ async function readPoolBoundHookDeploymentDetailsFresh(options, block, chainId)
|
|
|
465
475
|
export async function readPoolBoundHookDeployment(options, pinnedBlock) {
|
|
466
476
|
const commitment = hashLaunchPlan(options.plan);
|
|
467
477
|
const block = pinnedBlock ?? await readLifecycleBlock(options.client);
|
|
468
|
-
|
|
478
|
+
const result = await withLifecycleReadClient(options.client, async (client) => {
|
|
469
479
|
const { deployment } = await readPoolBoundHookDeploymentDetails({ ...options, client }, block, commitment);
|
|
470
480
|
if (hashLaunchPlan(options.plan) !== commitment)
|
|
471
481
|
throw new LifecyclePlanningError("PLAN_MUTATED", "Economic plan changed while reading hook deployment metadata");
|
|
@@ -473,12 +483,15 @@ export async function readPoolBoundHookDeployment(options, pinnedBlock) {
|
|
|
473
483
|
await assertLifecycleBlock(client, block, options.plan.chainId);
|
|
474
484
|
return { ...deployment };
|
|
475
485
|
});
|
|
486
|
+
if (hashLaunchPlan(options.plan) !== commitment)
|
|
487
|
+
throw new LifecyclePlanningError("PLAN_MUTATED", "Economic plan changed during the final hook deployment guard");
|
|
488
|
+
return result;
|
|
476
489
|
}
|
|
477
490
|
/** Optional permissionless predeployment calldata; no token deployment, pool registration or wallet broadcast. */
|
|
478
491
|
export async function buildPoolBoundHookDeploymentTransaction(options) {
|
|
479
492
|
const commitment = hashLaunchPlan(options.plan);
|
|
480
493
|
const block = await readLifecycleBlock(options.client);
|
|
481
|
-
|
|
494
|
+
const result = await withLifecycleReadClient(options.client, async (client) => {
|
|
482
495
|
const { deployment, parameters, configVersion } = await readPoolBoundHookDeploymentDetails({ ...options, client }, block, commitment);
|
|
483
496
|
if (!hasLifecycleV4HookPermissions(deployment.predictedHook))
|
|
484
497
|
throw new LifecyclePlanningError("INVALID_HOOK_BITS", "Finalize a salt with the exact lifecycle hook permissions before predeployment");
|
|
@@ -488,6 +501,9 @@ export async function buildPoolBoundHookDeploymentTransaction(options) {
|
|
|
488
501
|
const abi = configVersion === 5 ? poolHookDeployerV1Abi : poolHookDeployerConfigV6Abi;
|
|
489
502
|
return { to: deployment.deployer, data: encodeFunctionData({ abi, functionName: "deploy", args: [parameters, deployment.salt] }), value: 0n, deployment: { ...deployment } };
|
|
490
503
|
});
|
|
504
|
+
if (hashLaunchPlan(options.plan) !== commitment)
|
|
505
|
+
throw new LifecyclePlanningError("PLAN_MUTATED", "Economic plan changed during the final hook transaction guard");
|
|
506
|
+
return result;
|
|
491
507
|
}
|
|
492
508
|
export function validateLifecycleMarketIdentity(identity, plan, token, marketIndex) {
|
|
493
509
|
const market = plan.markets[marketIndex];
|
|
@@ -507,7 +523,7 @@ export function validateLifecycleMarketIdentity(identity, plan, token, marketInd
|
|
|
507
523
|
else if (identity.venue !== LifecycleVenue.Abyss || identity.pool === zeroAddress || identity.factory === zeroAddress)
|
|
508
524
|
throw new LifecyclePlanningError("MARKET_IDENTITY", "Abyss canonical factory/pool identity is missing");
|
|
509
525
|
}
|
|
510
|
-
async function transactionMatchesLaunch(transaction, options,
|
|
526
|
+
async function transactionMatchesLaunch(transaction, options, readBlock) {
|
|
511
527
|
const { planned } = options;
|
|
512
528
|
const from = rpcHex(transaction.from, "receipt transaction account");
|
|
513
529
|
if (from.toLowerCase() !== planned.account.toLowerCase())
|
|
@@ -516,13 +532,19 @@ async function transactionMatchesLaunch(transaction, options, block) {
|
|
|
516
532
|
throw new LifecyclePlanningError("RECEIPT_CHAIN", "Receipt transaction belongs to a different chain");
|
|
517
533
|
const to = transaction.to === null ? zeroAddress : rpcHex(transaction.to, "receipt transaction target");
|
|
518
534
|
const input = rpcHex(transaction.input ?? transaction.data, "receipt transaction calldata");
|
|
519
|
-
|
|
535
|
+
const target = planned.ufg === undefined ? planned.plan.orchestrator : UFG_LAUNCH_PROXY_ADDRESS;
|
|
536
|
+
if (to.toLowerCase() === target.toLowerCase()) {
|
|
520
537
|
try {
|
|
521
|
-
const decoded = decodeFunctionData({ abi: launchLifecycleAbi, data: input });
|
|
538
|
+
const decoded = decodeFunctionData({ abi: planned.ufg === undefined ? launchLifecycleAbi : ufgLaunchProxyV1Abi, data: input });
|
|
522
539
|
if (!["launchAtomic", "beginLaunch", "prepareMarkets", "activateLaunch", "cancelLaunch"].includes(decoded.functionName) || !Array.isArray(decoded.args))
|
|
523
540
|
return false;
|
|
524
541
|
// Decoded plan layout is validated by the exact ABI, not trusted raw RPC JSON.
|
|
525
542
|
const plan = decoded.args[0];
|
|
543
|
+
if (planned.ufg !== undefined && (decoded.functionName === "launchAtomic" || decoded.functionName === "beginLaunch")) {
|
|
544
|
+
const config = decoded.args[decoded.functionName === "launchAtomic" ? 1 : 2];
|
|
545
|
+
if (hashUfgLaunchConfig(config) !== planned.ufg.configHash)
|
|
546
|
+
return false;
|
|
547
|
+
}
|
|
526
548
|
return hashLaunchPlan(plan).toLowerCase() === planned.planHash.toLowerCase();
|
|
527
549
|
}
|
|
528
550
|
catch {
|
|
@@ -542,61 +564,112 @@ async function transactionMatchesLaunch(transaction, options, block) {
|
|
|
542
564
|
catch {
|
|
543
565
|
return false;
|
|
544
566
|
}
|
|
545
|
-
const
|
|
567
|
+
const known = getKnownLifecycleDeployment({ chainId: planned.plan.chainId, orchestrator: planned.plan.orchestrator });
|
|
568
|
+
const escrow = planned.ufg !== undefined ? UFG_LAUNCH_PROXY_ADDRESS : known?.fundingEscrow ??
|
|
569
|
+
await readLifecycleContract(options.client, planned.plan.orchestrator, launchLifecycleAbi, "fundingEscrow", [], await readBlock());
|
|
546
570
|
return spender.toLowerCase() === escrow.toLowerCase();
|
|
547
571
|
}
|
|
548
|
-
async function readReceipt(reference, options, block) {
|
|
572
|
+
async function readReceipt(reference, options, block, readIdentityBlock) {
|
|
549
573
|
const effectiveHash = reference.replacementHash ?? reference.transactionHash;
|
|
550
574
|
const base = { transactionHash: reference.transactionHash, effectiveHash, replaced: reference.replacementHash !== undefined && reference.replacementHash.toLowerCase() !== reference.transactionHash.toLowerCase() };
|
|
551
|
-
const
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
575
|
+
const pins = [];
|
|
576
|
+
const observedNumber = reference.observedBlockNumber, observedHash = reference.observedBlockHash;
|
|
577
|
+
if (observedNumber !== undefined && observedHash !== undefined)
|
|
578
|
+
pins.push({ number: observedNumber, hash: observedHash });
|
|
579
|
+
const finish = (result, failure) => ({
|
|
580
|
+
pins,
|
|
581
|
+
finish(headers) {
|
|
582
|
+
for (const pin of pins) {
|
|
583
|
+
if (failure !== undefined && (pin.number !== observedNumber || pin.hash !== observedHash))
|
|
584
|
+
continue;
|
|
585
|
+
if (headers.get(pin.number)?.toLowerCase() !== pin.hash.toLowerCase())
|
|
586
|
+
return { ...base, status: "reorged", blockNumber: pin.number, blockHash: pin.hash };
|
|
587
|
+
}
|
|
588
|
+
if (failure !== undefined)
|
|
589
|
+
throw failure.error;
|
|
590
|
+
return result;
|
|
591
|
+
},
|
|
592
|
+
});
|
|
593
|
+
try {
|
|
594
|
+
const [receiptValue, transactionValue] = await Promise.all([
|
|
595
|
+
lifecycleRpc(options.client, "eth_getTransactionReceipt", [effectiveHash]),
|
|
596
|
+
lifecycleRpc(options.client, "eth_getTransactionByHash", [effectiveHash]),
|
|
597
|
+
]);
|
|
598
|
+
if (receiptValue === null)
|
|
599
|
+
return finish({ ...base, status: "pending", blockNumber: observedNumber, blockHash: observedHash });
|
|
600
|
+
if (transactionValue === null)
|
|
601
|
+
throw new LifecyclePlanningError("INVALID_RPC_RESPONSE", "Receipt exists without its canonical transaction");
|
|
602
|
+
const receipt = rpcObject(receiptValue, "receipt");
|
|
603
|
+
const blockNumber = rpcQuantity(receipt.blockNumber, "receipt block number");
|
|
604
|
+
const blockHash = rpcHex(receipt.blockHash, "receipt block hash");
|
|
605
|
+
pins.push({ number: blockNumber, hash: blockHash });
|
|
606
|
+
const matches = await transactionMatchesLaunch(rpcObject(transactionValue, "receipt transaction"), options, () => readIdentityBlock(blockNumber));
|
|
607
|
+
const confirmations = block.number >= blockNumber ? block.number - blockNumber + 1n : 0n;
|
|
608
|
+
const required = reference.confirmations ?? 1;
|
|
609
|
+
if (!Number.isSafeInteger(required) || required < 1)
|
|
610
|
+
throw new LifecyclePlanningError("INVALID_CONFIRMATIONS", "Receipt confirmations must be a positive integer");
|
|
611
|
+
const observation = finish({
|
|
612
|
+
...base, blockNumber, blockHash, confirmations,
|
|
613
|
+
status: confirmations < BigInt(required) ? "unconfirmed" : !matches ? "replacement-cancelled" :
|
|
614
|
+
rpcQuantity(receipt.status, "receipt status") !== 1n ? "reverted" : "confirmed",
|
|
615
|
+
});
|
|
616
|
+
return {
|
|
617
|
+
pins,
|
|
618
|
+
finish(headers) {
|
|
619
|
+
const result = observation.finish(headers);
|
|
620
|
+
if (result.status !== "reorged" && !matches && !base.replaced)
|
|
621
|
+
throw new LifecyclePlanningError("RECEIPT_IDENTITY", "Receipt calldata does not belong to the exact committed launch");
|
|
622
|
+
return result;
|
|
623
|
+
},
|
|
624
|
+
};
|
|
556
625
|
}
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
// reorg: the transaction is simply not (yet) mined. A missing/changed
|
|
564
|
-
// canonical block above already reported the real reorg.
|
|
565
|
-
if (reference.observedBlockHash !== undefined)
|
|
566
|
-
return { ...base, status: "pending", blockNumber: observedNumber, blockHash: reference.observedBlockHash };
|
|
567
|
-
return { ...base, status: "pending" };
|
|
626
|
+
catch (error) {
|
|
627
|
+
if (error instanceof Error && error.name === "AbortError")
|
|
628
|
+
throw error;
|
|
629
|
+
// A changed retained observation is a reorg even if the orphan's transaction
|
|
630
|
+
// or identity read is now unavailable. Otherwise preserve the original error.
|
|
631
|
+
return finish({ ...base, status: "pending" }, { error });
|
|
568
632
|
}
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
const
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
const
|
|
583
|
-
const
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
633
|
+
}
|
|
634
|
+
async function readReceipts(options, block, confirmationDepth) {
|
|
635
|
+
if (options.receipts === undefined || options.receipts.length === 0)
|
|
636
|
+
return [];
|
|
637
|
+
const identityBlocks = new Map();
|
|
638
|
+
const readIdentityBlock = (number) => {
|
|
639
|
+
let pending = identityBlocks.get(number);
|
|
640
|
+
if (pending === undefined) {
|
|
641
|
+
pending = readLifecycleBlock(options.client, toHex(number));
|
|
642
|
+
identityBlocks.set(number, pending);
|
|
643
|
+
}
|
|
644
|
+
return pending;
|
|
645
|
+
};
|
|
646
|
+
const observations = await Promise.all((options.receipts ?? []).map((reference) => readReceipt({ ...reference, confirmations: Math.max(reference.confirmations ?? 1, confirmationDepth) }, options, block, readIdentityBlock)));
|
|
647
|
+
const headers = new Map();
|
|
648
|
+
for (const observation of observations)
|
|
649
|
+
for (const pin of observation.pins)
|
|
650
|
+
headers.set(pin.number, undefined);
|
|
651
|
+
// All asynchronous identity reads have settled. Equal observed/inclusion blocks
|
|
652
|
+
// and multiple receipts now share one fresh canonical header, never a stale cache.
|
|
653
|
+
await Promise.all([...headers.keys()].map(async (number) => {
|
|
654
|
+
const value = await lifecycleRpc(options.client, "eth_getBlockByNumber", [toHex(number), false]);
|
|
655
|
+
const hash = value === null ? undefined : rpcHex(rpcObject(value, "receipt canonical block").hash, "receipt canonical hash");
|
|
656
|
+
if (hash !== undefined && hash.length !== 66)
|
|
657
|
+
throw new LifecyclePlanningError("INVALID_RPC_RESPONSE", "Receipt canonical block hash must have 32 bytes");
|
|
658
|
+
headers.set(number, hash);
|
|
659
|
+
}));
|
|
660
|
+
return observations.map((observation) => observation.finish(headers));
|
|
593
661
|
}
|
|
594
662
|
/** Reads confirmation-bound canonical state and receipt provenance; local step counters are never used. */
|
|
595
663
|
export async function readLaunchProgress(options, pinnedBlock) {
|
|
596
664
|
if (options.signal?.aborted)
|
|
597
665
|
throw Object.assign(new Error("Lifecycle progress read cancelled"), { name: "AbortError" });
|
|
598
|
-
const
|
|
599
|
-
|
|
666
|
+
const planHash = options.planned.planHash, launchId = options.planned.launchId;
|
|
667
|
+
const result = await withLifecycleReadClient(options.client, async (client) => readLaunchProgressAtBlock(options, client, pinnedBlock ?? await readLifecycleBlock(client), pinnedBlock === undefined));
|
|
668
|
+
if (hashLaunchPlan(options.planned.plan) !== planHash || hashLaunchIdentity(options.planned.plan) !== launchId)
|
|
669
|
+
throw new LifecyclePlanningError("PLAN_MUTATED", "Economic plan changed during the final canonical progress guard");
|
|
670
|
+
if (options.signal?.aborted)
|
|
671
|
+
throw Object.assign(new Error("Lifecycle progress read cancelled"), { name: "AbortError" });
|
|
672
|
+
return result;
|
|
600
673
|
}
|
|
601
674
|
async function readLaunchProgressAtBlock(options, client, block, checkBlock) {
|
|
602
675
|
const { planned } = options;
|
|
@@ -617,12 +690,17 @@ async function readLaunchProgressAtBlock(options, client, block, checkBlock) {
|
|
|
617
690
|
const chainId = chainIdValue;
|
|
618
691
|
if (chainId !== planned.plan.chainId)
|
|
619
692
|
throw new LifecyclePlanningError("CHAIN_MISMATCH", "RPC chain differs from the committed launch");
|
|
620
|
-
if (planned.
|
|
693
|
+
if (planned.ufg !== undefined) {
|
|
694
|
+
assertUfgLaunchAccount(planned.plan, planned.account);
|
|
695
|
+
if (hashUfgLaunchConfig(planned.ufg.config) !== planned.ufg.configHash)
|
|
696
|
+
throw new LifecyclePlanningError("PLAN_MUTATED", "UFG config differs from its finalized commitment");
|
|
697
|
+
}
|
|
698
|
+
else if (planned.account.toLowerCase() !== planned.plan.creator.toLowerCase())
|
|
621
699
|
throw new LifecyclePlanningError("ACCOUNT_MISMATCH", "Execution account must be the committed creator/payer/refund account");
|
|
622
700
|
if (hashLaunchPlan(planned.plan).toLowerCase() !== planned.planHash.toLowerCase() || hashLaunchIdentity(planned.plan).toLowerCase() !== planned.launchId.toLowerCase())
|
|
623
701
|
throw new LifecyclePlanningError("PLAN_MUTATED", "Stored economic plan no longer matches its commitment");
|
|
624
702
|
const [head, confirmedProgress, token, confirmedNonce, headNonce, pendingNonce] = await Promise.all([
|
|
625
|
-
|
|
703
|
+
readLifecycleHeadProgress(client, planned.plan, planned.account, block),
|
|
626
704
|
confirmedNumber === block.number ? undefined : readLifecycleContract(client, planned.plan.orchestrator, launchLifecycleAbi, "readLaunchProgress", [planned.launchId], confirmedBlock, planned.account),
|
|
627
705
|
readLifecycleTokenAtBlock(client, planned.plan, block),
|
|
628
706
|
lifecycleRpc(client, "eth_getTransactionCount", [planned.account, toHex(confirmedBlock.number)]),
|
|
@@ -635,19 +713,27 @@ async function readLaunchProgressAtBlock(options, client, block, checkBlock) {
|
|
|
635
713
|
throw new LifecyclePlanningError("TOKEN_IDENTITY", "Predicted token changed for the committed token configuration");
|
|
636
714
|
for (const progress of [canonical, head])
|
|
637
715
|
if (progress.phase !== LifecyclePhase.None) {
|
|
638
|
-
if (progress.planHash.toLowerCase() !== planned.planHash.toLowerCase() || progress.launchId.toLowerCase() !== planned.launchId.toLowerCase() || progress.creator.toLowerCase() !== planned.
|
|
716
|
+
if (progress.planHash.toLowerCase() !== planned.planHash.toLowerCase() || progress.launchId.toLowerCase() !== planned.launchId.toLowerCase() || progress.creator.toLowerCase() !== planned.plan.creator.toLowerCase() || progress.nonce !== planned.plan.nonce || progress.token.toLowerCase() !== token.toLowerCase() || progress.marketCount !== planned.plan.markets.length || progress.buyCount !== planned.plan.buys.length || progress.deadline !== planned.plan.deadline)
|
|
639
717
|
throw new LifecyclePlanningError("PLAN_REPLAY", "This creator nonce is already bound to a different economic launch");
|
|
640
718
|
if (progress.mode !== (planned.mode === "atomic" ? LifecycleMode.Atomic : LifecycleMode.Staged))
|
|
641
719
|
throw new LifecyclePlanningError("MODE_MISMATCH", "Execution mode differs from the already recorded launch");
|
|
642
720
|
if (progress.preparedMarkets > progress.marketCount || progress.phase === LifecyclePhase.Activating || (progress.phase === LifecyclePhase.Ready && progress.preparedMarkets !== progress.marketCount))
|
|
643
721
|
throw new LifecyclePlanningError("INVALID_PROGRESS", "Canonical progress violates the committed ordered state machine");
|
|
644
722
|
}
|
|
723
|
+
if (planned.ufg !== undefined && head.phase !== LifecyclePhase.None) {
|
|
724
|
+
const [principal, configHash] = await Promise.all([
|
|
725
|
+
readLifecycleContract(client, UFG_LAUNCH_PROXY_ADDRESS, ufgLaunchProxyV1Abi, "principalOf", [planned.launchId], block),
|
|
726
|
+
readLifecycleContract(client, UFG_LAUNCH_PROXY_ADDRESS, ufgLaunchProxyV1Abi, "launchConfigHash", [planned.launchId], block),
|
|
727
|
+
]);
|
|
728
|
+
if (principal.toLowerCase() !== planned.account.toLowerCase() || configHash.toLowerCase() !== planned.ufg.configHash.toLowerCase())
|
|
729
|
+
throw new LifecyclePlanningError("PLAN_REPLAY", "UFG proxy principal or launch config differs from the stored launch");
|
|
730
|
+
}
|
|
645
731
|
const confirmedAccountNonce = rpcQuantity(confirmedNonce, "confirmed account nonce");
|
|
646
732
|
const headAccountNonce = headNonce === undefined ? confirmedAccountNonce : rpcQuantity(headNonce, "head account nonce");
|
|
647
733
|
const pendingAccountNonce = rpcQuantity(pendingNonce, "pending account nonce");
|
|
648
734
|
const progressParameters = [{ type: "tuple", components: launchProgressV1Components }];
|
|
649
735
|
const confirmationSafe = confirmedAccountNonce === headAccountNonce && pendingAccountNonce === headAccountNonce && keccak256(encodeAbiParameters(progressParameters, [canonical])) === keccak256(encodeAbiParameters(progressParameters, [head]));
|
|
650
|
-
const receipts = await
|
|
736
|
+
const receipts = await readReceipts({ ...options, client }, block, confirmationDepth);
|
|
651
737
|
assertActive();
|
|
652
738
|
let markets = [];
|
|
653
739
|
if (canonical.preparedMarkets > 0) {
|