@reptilianhq/launch-on-block-sdk 0.4.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/LICENSE +674 -0
  3. package/README.md +116 -0
  4. package/dist/abis.d.ts +2 -0
  5. package/dist/abis.d.ts.map +1 -0
  6. package/dist/abis.js +2 -0
  7. package/dist/abis.js.map +1 -0
  8. package/dist/compatibility.d.ts +50 -0
  9. package/dist/compatibility.d.ts.map +1 -0
  10. package/dist/compatibility.js +244 -0
  11. package/dist/compatibility.js.map +1 -0
  12. package/dist/deployments.d.ts +294 -0
  13. package/dist/deployments.d.ts.map +1 -0
  14. package/dist/deployments.js +122 -0
  15. package/dist/deployments.js.map +1 -0
  16. package/dist/economics.d.ts +23 -0
  17. package/dist/economics.d.ts.map +1 -0
  18. package/dist/economics.js +111 -0
  19. package/dist/economics.js.map +1 -0
  20. package/dist/errors.d.ts +18 -0
  21. package/dist/errors.d.ts.map +1 -0
  22. package/dist/errors.js +30 -0
  23. package/dist/errors.js.map +1 -0
  24. package/dist/generated/abis.d.ts +1652 -0
  25. package/dist/generated/abis.d.ts.map +1 -0
  26. package/dist/generated/abis.js +2243 -0
  27. package/dist/generated/abis.js.map +1 -0
  28. package/dist/generated/deployments.d.ts +212 -0
  29. package/dist/generated/deployments.d.ts.map +1 -0
  30. package/dist/generated/deployments.js +237 -0
  31. package/dist/generated/deployments.js.map +1 -0
  32. package/dist/index.d.ts +8 -0
  33. package/dist/index.d.ts.map +1 -0
  34. package/dist/index.js +8 -0
  35. package/dist/index.js.map +1 -0
  36. package/dist/receipts.d.ts +84 -0
  37. package/dist/receipts.d.ts.map +1 -0
  38. package/dist/receipts.js +104 -0
  39. package/dist/receipts.js.map +1 -0
  40. package/dist/transactions.d.ts +115 -0
  41. package/dist/transactions.d.ts.map +1 -0
  42. package/dist/transactions.js +395 -0
  43. package/dist/transactions.js.map +1 -0
  44. package/package.json +88 -0
package/README.md ADDED
@@ -0,0 +1,116 @@
1
+ # Launch On Block SDK
2
+
3
+ Public TypeScript SDK, contract interfaces, ABIs, and deployment metadata for integrating with the
4
+ Launch On Block protocol on Robinhood Chain.
5
+
6
+ The package is runtime-neutral. It provides deterministic transaction requests and verification tools,
7
+ but it does not select a wallet, RPC provider, gas policy, nonce policy, application backend, or user
8
+ authorization model.
9
+
10
+ ## What it provides
11
+
12
+ - Narrow, generated ABI subsets with literal `as const` types.
13
+ - Typed, chain-scoped deployment metadata and replay boundaries.
14
+ - Transaction builders and calldata verification.
15
+ - Receipt verification tied to the expected contract and transaction envelope.
16
+ - Deployment compatibility checks for runtime bytecode, proxies, and cross-contract wiring.
17
+ - Stable SDK error codes and deterministic protocol arithmetic.
18
+
19
+ ## Installation
20
+
21
+ The successor package is `@reptilianhq/launch-on-block-sdk`. Registry publication is fail-closed until
22
+ the public npm scope, public GitHub source, protected release environment, and npm trusted publisher are
23
+ configured. Until then, repository checks produce a complete npm tarball that consumers can evaluate
24
+ without publishing it. See [`docs/RELEASING.md`](docs/RELEASING.md).
25
+
26
+ Version `0.4.0` establishes the initial public package API in this dedicated repository.
27
+
28
+ ## Usage
29
+
30
+ Import ABIs from narrow package subpaths so TypeScript preserves their literal types:
31
+
32
+ ```ts
33
+ import { launchpadAbi, launchTokenAbi } from "@reptilianhq/launch-on-block-sdk/abis";
34
+ ```
35
+
36
+ Build and verify transactions without binding the SDK to a wallet implementation:
37
+
38
+ ```ts
39
+ import {
40
+ buildCurveBuyTransaction,
41
+ getDeployment,
42
+ verifyBuyReceipt,
43
+ } from "@reptilianhq/launch-on-block-sdk";
44
+
45
+ const deployment = getDeployment(4663);
46
+ const request = buildCurveBuyTransaction(deployment.contracts.launchpad, {
47
+ token,
48
+ minTokensOut,
49
+ value,
50
+ });
51
+
52
+ const hash = await walletClient.sendTransaction(request);
53
+ const receipt = await publicClient.waitForTransactionReceipt({ hash });
54
+ const buy = verifyBuyReceipt(receipt, deployment.contracts.launchpad, { token });
55
+ ```
56
+
57
+ Builders return `{ to, data, value }`. Consumers remain responsible for wallet selection, simulation,
58
+ gas estimation, submission, confirmation depth, and reorg policy.
59
+
60
+ Before enabling writes, prove that the selected RPC serves the deployment described by the SDK:
61
+
62
+ ```ts
63
+ import { assertCompatibleDeployment } from "@reptilianhq/launch-on-block-sdk/compatibility";
64
+ import { robinhoodMainnet } from "@reptilianhq/launch-on-block-sdk/deployments";
65
+
66
+ await assertCompatibleDeployment(publicClient, robinhoodMainnet);
67
+ ```
68
+
69
+ Compatibility checks prove deployment identity and wiring. They do not prove current operational health,
70
+ pause state, balances, finality, or external governance safety.
71
+
72
+ SDK validation errors expose stable codes:
73
+
74
+ ```ts
75
+ import { isSdkError } from "@reptilianhq/launch-on-block-sdk/errors";
76
+
77
+ try {
78
+ verifyCurveBuyTransaction(transaction, launchpad, account, expectedBuy);
79
+ } catch (error) {
80
+ if (isSdkError(error) && error.code === "CALLDATA_MISMATCH") {
81
+ // Map application behavior by code; messages may evolve.
82
+ }
83
+ throw error;
84
+ }
85
+ ```
86
+
87
+ ## Development
88
+
89
+ Consumers require Node.js 22 or newer. Repository development and release automation use Node.js 24
90
+ with npm and the committed lockfile.
91
+
92
+ ```sh
93
+ npm ci
94
+ npm test
95
+ ```
96
+
97
+ `npm test` verifies the imported artifact hashes, builds the package, runs the unit suite, and packs the
98
+ exact public exports from a clean `dist` directory.
99
+
100
+ Do not import Foundry artifact JSON or copy ABI fragments into consumer applications. Foundry artifacts
101
+ contain deployment bytecode and compiler metadata that application bundles do not need, while copied
102
+ fragments drift independently from the SDK's compatibility checks.
103
+
104
+ ## Contract artifact boundary
105
+
106
+ The Launch On Block contract repository remains authoritative for Solidity source, deployment scripts,
107
+ and production activation. It exports reviewed ABI and deployment inputs through the handoff documented
108
+ in [`docs/ARTIFACT_HANDOFF.md`](docs/ARTIFACT_HANDOFF.md).
109
+
110
+ This repository never reads a sibling contract checkout during build or release. Generated inputs are
111
+ committed, hash-bound to their producer identity, reviewed here, and then published as part of an SDK
112
+ release.
113
+
114
+ ## License
115
+
116
+ GPL-3.0-only. See [`LICENSE`](LICENSE).
package/dist/abis.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { ABI_REVISION, abiSignatures, feeControllerAbi, graduationPoolAbi, launchpadAbi, launchTokenAbi, lbFactoryIdentityAbi, lbRouterIdentityAbi, routerAbi, } from "./generated/abis.js";
2
+ //# sourceMappingURL=abis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abis.d.ts","sourceRoot":"","sources":["../src/abis.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,SAAS,GACV,MAAM,qBAAqB,CAAC"}
package/dist/abis.js ADDED
@@ -0,0 +1,2 @@
1
+ export { ABI_REVISION, abiSignatures, feeControllerAbi, graduationPoolAbi, launchpadAbi, launchTokenAbi, lbFactoryIdentityAbi, lbRouterIdentityAbi, routerAbi, } from "./generated/abis.js";
2
+ //# sourceMappingURL=abis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abis.js","sourceRoot":"","sources":["../src/abis.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,SAAS,GACV,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { type Address, type PublicClient } from "viem";
2
+ import type { Deployment, ProtocolContracts } from "./deployments.js";
3
+ import { SdkError, type SdkErrorCode } from "./errors.js";
4
+ export type DeploymentCompatibilityErrorCode = Extract<SdkErrorCode, "ADMIN_MISMATCH" | "ABI_REVISION_MISMATCH" | "CHAIN_MISMATCH" | "CODE_MISSING" | "CODE_HASH_MISMATCH" | "IMPLEMENTATION_MISMATCH" | "POINTER_MISMATCH">;
5
+ export declare class DeploymentCompatibilityError extends SdkError {
6
+ readonly path: string;
7
+ readonly expected: string;
8
+ readonly actual: string;
9
+ readonly code: DeploymentCompatibilityErrorCode;
10
+ constructor(code: DeploymentCompatibilityErrorCode, path: string, expected: string, actual: string);
11
+ }
12
+ export interface DeploymentCompatibilityReport {
13
+ chainId: number;
14
+ blockNumber: bigint;
15
+ releaseId: string;
16
+ abiRevision: string;
17
+ codeHashes: ProtocolContracts["runtimeCodeHashes"];
18
+ pointers: {
19
+ launchpadFeeController: Address;
20
+ launchpadWNative: Address;
21
+ launchpadGovernance: Address;
22
+ launchpadGraduationPoolDeployer: Address;
23
+ launchpadEscrowDeployer: Address;
24
+ launchpadDefaultCurveId: number;
25
+ launchpadDefaultCurve: Address;
26
+ escrowImplementation: Address;
27
+ feeControllerLaunchpad: Address;
28
+ feeControllerLbFactory: Address;
29
+ feeControllerProxyAdmin: Address;
30
+ feeControllerProxyAdminOwner: Address;
31
+ proxyUpgradeGateTimelock: Address;
32
+ routerLaunchpad: Address;
33
+ routerLbFactory: Address;
34
+ routerWNative: Address;
35
+ lbFactoryFeeRecipient: Address;
36
+ lbFactoryPairImplementation: Address;
37
+ lbRouterFactory: Address;
38
+ lbRouterWNative: Address;
39
+ };
40
+ }
41
+ /**
42
+ * Proves that an RPC is serving the manifest-bound release before a consumer trusts it.
43
+ * This checks identity and wiring, not operational state such as pause status or balances.
44
+ */
45
+ export declare function assertCompatibleDeployment(client: PublicClient, deployment: Deployment & {
46
+ contracts: ProtocolContracts;
47
+ }, options?: {
48
+ blockNumber?: bigint;
49
+ }): Promise<DeploymentCompatibilityReport>;
50
+ //# sourceMappingURL=compatibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compatibility.d.ts","sourceRoot":"","sources":["../src/compatibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,OAAO,EAEZ,KAAK,YAAY,EAClB,MAAM,MAAM,CAAC;AAYd,OAAO,KAAK,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AE,OAAO,CAAC;QACzB,aAAa,EAAE,OAAO,CAAC;QACvB,qBAAqB,EAAE,OAAO,CAAC;QAC/B,2BAA2B,EAAE,OAAO,CAAC;QACrC,eAAe,EAAE,OAAO,CAAC;QACzB,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;CACH;AAED;;;GAGG;AACH,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,GAAG;IAAE,SAAS,EAAE,iBAAiB,CAAA;CAAE,EACzD,OAAO,GAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GACrC,OAAO,CAAC,6BAA6B,CAAC,CAoQxC"}
@@ -0,0 +1,244 @@
1
+ import { getAddress, keccak256, } from "viem";
2
+ import { ABI_REVISION } from "./generated/abis.js";
3
+ import { feeControllerAbi, launchpadAbi, launchEscrowDeployerAbi, lbFactoryIdentityAbi, lbRouterIdentityAbi, proxyAdminIdentityAbi, proxyUpgradeGateIdentityAbi, routerAbi, } from "./generated/abis.js";
4
+ import { SdkError } from "./errors.js";
5
+ const EIP1967_IMPLEMENTATION_SLOT = "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc";
6
+ const EIP1967_ADMIN_SLOT = "0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103";
7
+ export class DeploymentCompatibilityError extends SdkError {
8
+ path;
9
+ expected;
10
+ actual;
11
+ constructor(code, path, expected, actual) {
12
+ super(code, `${path} is incompatible: expected ${expected}, got ${actual}`, {
13
+ path,
14
+ expected,
15
+ actual,
16
+ });
17
+ this.path = path;
18
+ this.expected = expected;
19
+ this.actual = actual;
20
+ this.name = "DeploymentCompatibilityError";
21
+ }
22
+ }
23
+ /**
24
+ * Proves that an RPC is serving the manifest-bound release before a consumer trusts it.
25
+ * This checks identity and wiring, not operational state such as pause status or balances.
26
+ */
27
+ export async function assertCompatibleDeployment(client, deployment, options = {}) {
28
+ const contracts = deployment.contracts;
29
+ if (contracts.abiRevision !== ABI_REVISION) {
30
+ throw new DeploymentCompatibilityError("ABI_REVISION_MISMATCH", "contracts.abiRevision", ABI_REVISION, contracts.abiRevision);
31
+ }
32
+ const chainId = await client.getChainId();
33
+ if (chainId !== deployment.chainId) {
34
+ throw new DeploymentCompatibilityError("CHAIN_MISMATCH", "chainId", String(deployment.chainId), String(chainId));
35
+ }
36
+ const blockNumber = options.blockNumber ?? (await client.getBlock({ blockTag: "safe" })).number;
37
+ if (blockNumber === null) {
38
+ throw new DeploymentCompatibilityError("CODE_MISSING", "blockNumber", "a numbered safe block", "null");
39
+ }
40
+ const codeTargets = [
41
+ ["launchpad", contracts.launchpad, contracts.runtimeCodeHashes.launchpad],
42
+ ["feeController", contracts.feeController, contracts.runtimeCodeHashes.feeController],
43
+ ["router", contracts.router, contracts.runtimeCodeHashes.router],
44
+ ["lbFactory", contracts.lbFactory, contracts.runtimeCodeHashes.lbFactory],
45
+ ["lbPairImplementation", contracts.lbPairImplementation, contracts.runtimeCodeHashes.lbPairImplementation],
46
+ ["lbRouter", contracts.lbRouter, contracts.runtimeCodeHashes.lbRouter],
47
+ ["defaultCurve", contracts.defaultCurve.address, contracts.defaultCurve.runtimeCodeHash],
48
+ ["graduationPoolDeployer", contracts.graduationPoolDeployer.address, contracts.graduationPoolDeployer.runtimeCodeHash],
49
+ ["launchEscrowDeployer", contracts.launchEscrowDeployer.address, contracts.launchEscrowDeployer.runtimeCodeHash],
50
+ ["launchEscrowDeployer.implementation", contracts.launchEscrowDeployer.implementation.address,
51
+ contracts.launchEscrowDeployer.implementation.runtimeCodeHash],
52
+ ["proxyUpgradeGate", contracts.proxyUpgradeGate.address, contracts.proxyUpgradeGate.runtimeCodeHash],
53
+ ["feeControllerAdmin", contracts.feeControllerAdmin.address, contracts.feeControllerAdmin.runtimeCodeHash],
54
+ ];
55
+ await Promise.all(codeTargets.map(([path, address, expectedHash]) => assertCodeHash(client, `contracts.${path}`, address, expectedHash, blockNumber)));
56
+ if (contracts.launchpadType !== "immutable") {
57
+ throw new DeploymentCompatibilityError("IMPLEMENTATION_MISMATCH", "contracts.launchpadType", "immutable", contracts.launchpadType);
58
+ }
59
+ const launchpadImplementation = contracts.implementations.launchpad;
60
+ if (launchpadImplementation !== null) {
61
+ throw new DeploymentCompatibilityError("IMPLEMENTATION_MISMATCH", "contracts.launchpad.implementation", "immutable launchpad with no implementation", launchpadImplementation.address);
62
+ }
63
+ const feeControllerImplementation = contracts.implementations.feeController;
64
+ if (feeControllerImplementation === null) {
65
+ throw new DeploymentCompatibilityError("IMPLEMENTATION_MISMATCH", "contracts.feeController.implementation", "a pinned implementation", "missing implementation metadata");
66
+ }
67
+ await Promise.all([
68
+ assertImplementationIdentity(client, "contracts.launchpad", contracts.launchpad, contracts.implementations.launchpad, blockNumber),
69
+ assertImplementationIdentity(client, "contracts.feeController", contracts.feeController, feeControllerImplementation, blockNumber),
70
+ assertAdminIdentity(client, "contracts.launchpad", contracts.launchpad, null, blockNumber),
71
+ assertAdminIdentity(client, "contracts.feeController", contracts.feeController, contracts.feeControllerAdmin.address, blockNumber),
72
+ ]);
73
+ if (deployment.addresses.wNative === null) {
74
+ throw new DeploymentCompatibilityError("CODE_MISSING", "addresses.wNative", "a configured contract", "null");
75
+ }
76
+ const wNativeCode = await client.getBytecode({ address: deployment.addresses.wNative, blockNumber });
77
+ if (!wNativeCode || wNativeCode === "0x") {
78
+ throw new DeploymentCompatibilityError("CODE_MISSING", "addresses.wNative", "deployed bytecode", "0x");
79
+ }
80
+ const [launchpadFeeController, launchpadWNative, launchpadGovernance, launchpadGraduationPoolDeployer, launchpadEscrowDeployer, launchpadDefaultCurveId, launchpadDefaultCurve, escrowImplementation, feeControllerLaunchpad, feeControllerLbFactory, feeControllerProxyAdminOwner, proxyUpgradeGateTimelock, routerLaunchpad, routerLbFactory, routerWNative, lbFactoryFeeRecipient, lbFactoryPairImplementation, lbRouterFactory, lbRouterWNative,] = await Promise.all([
81
+ client.readContract({ address: contracts.launchpad, abi: launchpadAbi, functionName: "feeController", blockNumber }),
82
+ client.readContract({ address: contracts.launchpad, abi: launchpadAbi, functionName: "wNative", blockNumber }),
83
+ client.readContract({ address: contracts.launchpad, abi: launchpadAbi, functionName: "governance", blockNumber }),
84
+ client.readContract({
85
+ address: contracts.launchpad,
86
+ abi: launchpadAbi,
87
+ functionName: "graduationPoolDeployer",
88
+ blockNumber,
89
+ }),
90
+ client.readContract({
91
+ address: contracts.launchpad,
92
+ abi: launchpadAbi,
93
+ functionName: "launchEscrowDeployer",
94
+ blockNumber,
95
+ }),
96
+ client.readContract({ address: contracts.launchpad, abi: launchpadAbi, functionName: "DEFAULT_CURVE_ID", blockNumber }),
97
+ client.readContract({
98
+ address: contracts.launchpad,
99
+ abi: launchpadAbi,
100
+ functionName: "curveImplementation",
101
+ args: [contracts.defaultCurve.id],
102
+ blockNumber,
103
+ }),
104
+ client.readContract({
105
+ address: contracts.launchEscrowDeployer.address,
106
+ abi: launchEscrowDeployerAbi,
107
+ functionName: "implementation",
108
+ blockNumber,
109
+ }),
110
+ client.readContract({ address: contracts.feeController, abi: feeControllerAbi, functionName: "launchpad", blockNumber }),
111
+ client.readContract({ address: contracts.feeController, abi: feeControllerAbi, functionName: "lbFactory", blockNumber }),
112
+ client.readContract({
113
+ address: contracts.feeControllerAdmin.address,
114
+ abi: proxyAdminIdentityAbi,
115
+ functionName: "owner",
116
+ blockNumber,
117
+ }),
118
+ client.readContract({
119
+ address: contracts.proxyUpgradeGate.address,
120
+ abi: proxyUpgradeGateIdentityAbi,
121
+ functionName: "timelock",
122
+ blockNumber,
123
+ }),
124
+ client.readContract({ address: contracts.router, abi: routerAbi, functionName: "launchpad", blockNumber }),
125
+ client.readContract({ address: contracts.router, abi: routerAbi, functionName: "lbFactory", blockNumber }),
126
+ client.readContract({ address: contracts.router, abi: routerAbi, functionName: "wNative", blockNumber }),
127
+ client.readContract({
128
+ address: contracts.lbFactory,
129
+ abi: lbFactoryIdentityAbi,
130
+ functionName: "getFeeRecipient",
131
+ blockNumber,
132
+ }),
133
+ client.readContract({
134
+ address: contracts.lbFactory,
135
+ abi: lbFactoryIdentityAbi,
136
+ functionName: "getLBPairImplementation",
137
+ blockNumber,
138
+ }),
139
+ client.readContract({
140
+ address: contracts.lbRouter,
141
+ abi: lbRouterIdentityAbi,
142
+ functionName: "getFactory",
143
+ blockNumber,
144
+ }),
145
+ client.readContract({
146
+ address: contracts.lbRouter,
147
+ abi: lbRouterIdentityAbi,
148
+ functionName: "getWNATIVE",
149
+ blockNumber,
150
+ }),
151
+ ]);
152
+ const expectedWNative = deployment.addresses.wNative;
153
+ const pointers = {
154
+ launchpadFeeController,
155
+ launchpadWNative,
156
+ launchpadGovernance,
157
+ launchpadGraduationPoolDeployer,
158
+ launchpadEscrowDeployer,
159
+ launchpadDefaultCurveId,
160
+ launchpadDefaultCurve,
161
+ escrowImplementation,
162
+ feeControllerLaunchpad,
163
+ feeControllerLbFactory,
164
+ feeControllerProxyAdmin: contracts.feeControllerAdmin.address,
165
+ feeControllerProxyAdminOwner,
166
+ proxyUpgradeGateTimelock,
167
+ routerLaunchpad,
168
+ routerLbFactory,
169
+ routerWNative,
170
+ lbFactoryFeeRecipient,
171
+ lbFactoryPairImplementation,
172
+ lbRouterFactory,
173
+ lbRouterWNative,
174
+ };
175
+ assertAddress("pointers.launchpadFeeController", launchpadFeeController, contracts.feeController);
176
+ assertAddress("pointers.launchpadWNative", launchpadWNative, expectedWNative);
177
+ assertAddress("pointers.launchpadGraduationPoolDeployer", launchpadGraduationPoolDeployer, contracts.graduationPoolDeployer.address);
178
+ assertAddress("pointers.launchpadEscrowDeployer", launchpadEscrowDeployer, contracts.launchEscrowDeployer.address);
179
+ if (launchpadDefaultCurveId !== contracts.defaultCurve.id) {
180
+ throw new DeploymentCompatibilityError("POINTER_MISMATCH", "pointers.launchpadDefaultCurveId", String(contracts.defaultCurve.id), String(launchpadDefaultCurveId));
181
+ }
182
+ assertAddress("pointers.launchpadDefaultCurve", launchpadDefaultCurve, contracts.defaultCurve.address);
183
+ assertAddress("pointers.escrowImplementation", escrowImplementation, contracts.launchEscrowDeployer.implementation.address);
184
+ assertAddress("pointers.feeControllerLaunchpad", feeControllerLaunchpad, contracts.launchpad);
185
+ assertAddress("pointers.feeControllerLbFactory", feeControllerLbFactory, contracts.lbFactory);
186
+ assertAddress("pointers.feeControllerProxyAdminOwner", feeControllerProxyAdminOwner, contracts.proxyUpgradeGate.address);
187
+ assertAddress("pointers.proxyUpgradeGateTimelock", proxyUpgradeGateTimelock, launchpadGovernance);
188
+ assertAddress("pointers.routerLaunchpad", routerLaunchpad, contracts.launchpad);
189
+ assertAddress("pointers.routerLbFactory", routerLbFactory, contracts.lbFactory);
190
+ assertAddress("pointers.routerWNative", routerWNative, expectedWNative);
191
+ assertAddress("pointers.lbFactoryFeeRecipient", lbFactoryFeeRecipient, contracts.feeController);
192
+ assertAddress("pointers.lbFactoryPairImplementation", lbFactoryPairImplementation, contracts.lbPairImplementation);
193
+ assertAddress("pointers.lbRouterFactory", lbRouterFactory, contracts.lbFactory);
194
+ assertAddress("pointers.lbRouterWNative", lbRouterWNative, expectedWNative);
195
+ return {
196
+ chainId,
197
+ blockNumber,
198
+ releaseId: contracts.releaseId,
199
+ abiRevision: contracts.abiRevision,
200
+ codeHashes: contracts.runtimeCodeHashes,
201
+ pointers,
202
+ };
203
+ }
204
+ async function assertAdminIdentity(client, path, contract, expected, blockNumber) {
205
+ const actual = await readEip1967Address(client, contract, EIP1967_ADMIN_SLOT, blockNumber);
206
+ if (expected === null ? actual !== null : actual === null || actual.toLowerCase() !== expected.toLowerCase()) {
207
+ throw new DeploymentCompatibilityError("ADMIN_MISMATCH", `${path}.admin`, expected ?? "direct deployment (empty EIP-1967 admin slot)", actual ?? "missing storage");
208
+ }
209
+ }
210
+ async function assertCodeHash(client, path, address, expectedHash, blockNumber) {
211
+ const code = await client.getBytecode({ address, blockNumber });
212
+ if (!code || code === "0x") {
213
+ throw new DeploymentCompatibilityError("CODE_MISSING", path, "deployed bytecode", "0x");
214
+ }
215
+ const actualHash = keccak256(code);
216
+ if (actualHash.toLowerCase() !== expectedHash.toLowerCase()) {
217
+ throw new DeploymentCompatibilityError("CODE_HASH_MISMATCH", path, expectedHash, actualHash);
218
+ }
219
+ }
220
+ async function assertImplementationIdentity(client, path, contract, expected, blockNumber) {
221
+ const actual = await readEip1967Address(client, contract, EIP1967_IMPLEMENTATION_SLOT, blockNumber);
222
+ if (expected === null) {
223
+ if (actual !== null) {
224
+ throw new DeploymentCompatibilityError("IMPLEMENTATION_MISMATCH", `${path}.implementation`, "direct deployment (empty EIP-1967 implementation slot)", actual);
225
+ }
226
+ return;
227
+ }
228
+ if (actual === null || actual.toLowerCase() !== expected.address.toLowerCase()) {
229
+ throw new DeploymentCompatibilityError("IMPLEMENTATION_MISMATCH", `${path}.implementation`, expected.address, actual ?? "missing storage");
230
+ }
231
+ await assertCodeHash(client, `${path}.implementation`, expected.address, expected.runtimeCodeHash, blockNumber);
232
+ }
233
+ async function readEip1967Address(client, contract, slot, blockNumber) {
234
+ const storage = await client.getStorageAt({ address: contract, slot, blockNumber });
235
+ return storage && storage !== "0x" && BigInt(storage) !== 0n
236
+ ? getAddress(`0x${storage.slice(-40)}`)
237
+ : null;
238
+ }
239
+ function assertAddress(path, actual, expected) {
240
+ if (actual.toLowerCase() !== expected.toLowerCase()) {
241
+ throw new DeploymentCompatibilityError("POINTER_MISMATCH", path, expected, actual);
242
+ }
243
+ }
244
+ //# sourceMappingURL=compatibility.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compatibility.js","sourceRoot":"","sources":["../src/compatibility.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,GAIV,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,2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