@reptilianhq/uniswap-sdk 0.8.0 → 0.9.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 +22 -18
- package/RELEASING.md +5 -2
- package/dist/abis.d.ts +40 -0
- package/dist/abis.d.ts.map +1 -1
- package/dist/abis.js +5 -0
- package/dist/abis.js.map +1 -1
- package/dist/compatibility.d.ts +21 -1
- package/dist/compatibility.d.ts.map +1 -1
- package/dist/compatibility.js +86 -0
- package/dist/compatibility.js.map +1 -1
- package/dist/deployments.d.ts +51 -0
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +112 -0
- package/dist/deployments.js.map +1 -1
- package/dist/v4.d.ts +4 -0
- package/dist/v4.d.ts.map +1 -1
- package/dist/v4.js +2 -0
- package/dist/v4.js.map +1 -1
- package/docs/ARC_V4_PROVENANCE.md +62 -0
- package/package.json +7 -4
- package/provenance/arc-mainnet-v4.json +111 -0
- package/scripts/verify-v4-deployments.mjs +12 -0
- package/scripts/verify-v4-retained-artifacts.mjs +303 -0
package/README.md
CHANGED
|
@@ -8,7 +8,8 @@ It never owns keys, authorization policy, transaction submission, persistence, o
|
|
|
8
8
|
## Capabilities and ownership
|
|
9
9
|
|
|
10
10
|
- `./v4`: full pool identity, Initialize-log normalization, pool state,
|
|
11
|
-
exact-input Quoter simulation, ordered quote batches, initialized tick windows
|
|
11
|
+
exact-input Quoter simulation, ordered quote batches, initialized tick windows,
|
|
12
|
+
reviewed Arc infrastructure, and unsigned position-mint material with strict review.
|
|
12
13
|
- `./v3`: Robinhood v3 deployment identity, compatibility checks, unsigned
|
|
13
14
|
position transaction builders, strict calldata review, and receipt evidence.
|
|
14
15
|
- `./deployments`, `./compatibility`, `./transactions`, `./receipts`: stable
|
|
@@ -72,8 +73,10 @@ A complete deterministic consumer example is available in
|
|
|
72
73
|
the published package subpaths and demonstrates a pool observation, a partial
|
|
73
74
|
tick result, and branching on `isUniswapSdkError`.
|
|
74
75
|
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
Generic v4 reads still require an explicit `reviewedDeployment`. Arc hosts may select
|
|
77
|
+
`arcUniswapV4Mainnet` and must run `verifyArcUniswapV4Compatibility` before relying on
|
|
78
|
+
its pinned shared Uniswap infrastructure. This does not authenticate Argus Portal,
|
|
79
|
+
hook, locker, splitter, tracker, or fee semantics. Hosts own endpoint selection,
|
|
77
80
|
finality, capability policy and secret storage. For multicall consumers, use
|
|
78
81
|
`quoteV4WithBatch`, `v4PoolStateCalls`, `decodeV4PoolState`,
|
|
79
82
|
`readV4PoolStatesWithBatch`, and `readV4TicksWithBatch` from `./batch`.
|
|
@@ -84,9 +87,11 @@ the host must check chain/deployment identity and Quoter multicall compatibility
|
|
|
84
87
|
|
|
85
88
|
The direct-client RPC operations check chain identity (the `./batch` host owns that check). Pool/tick reads check StateView's
|
|
86
89
|
PoolManager pointer; quotes check the Quoter pointer at the observation block.
|
|
87
|
-
`verifyV4DeploymentWiring` checks both pointers. This proves wiring only
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
`verifyV4DeploymentWiring` checks both pointers. This proves wiring only. Arc's stronger
|
|
91
|
+
compatibility check pins the canonical block, exact runtime hashes, and immutable manager
|
|
92
|
+
wiring; the separate retained-artifact verifier validates the official manifest and
|
|
93
|
+
reproduces the generated deployment artifacts. It does not freshly compile Solidity.
|
|
94
|
+
Hook-specific compatibility remains an adapter release gate.
|
|
90
95
|
|
|
91
96
|
All state calls in an operation use one block number. Quote batches use up to
|
|
92
97
|
four concurrent individual eth_calls by default (maximum 16; at most 256 quotes).
|
|
@@ -146,21 +151,20 @@ package-subpath consumer example. `npm run test:fork` additionally executes an
|
|
|
146
151
|
SDK-built and reviewed full position close against the pinned Anvil fork
|
|
147
152
|
documented in [docs/FORK_TESTING.md](./docs/FORK_TESTING.md).
|
|
148
153
|
|
|
149
|
-
`npm run test:live-compatibility` rechecks
|
|
150
|
-
their public RPCs. `UNISWAP_MAINNET_RPC_URL
|
|
151
|
-
override those read-only
|
|
154
|
+
`npm run test:live-compatibility` rechecks the two Robinhood deployments and the Arc v4
|
|
155
|
+
deployment against their public RPCs. `UNISWAP_MAINNET_RPC_URL`,
|
|
156
|
+
`UNISWAP_TESTNET_RPC_URL`, and `UNISWAP_ARC_RPC_URL` may override those read-only
|
|
157
|
+
endpoints. Retained-artifact reproduction is documented in
|
|
158
|
+
[docs/ARC_V4_PROVENANCE.md](./docs/ARC_V4_PROVENANCE.md).
|
|
152
159
|
|
|
153
160
|
Releases use the versioned Reptilian publisher, exact main-ancestry tags,
|
|
154
161
|
immutable archive verification, and retained evidence; see [RELEASING.md](./RELEASING.md).
|
|
155
|
-
The v3
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
Next: supply Arc contract/RPC details, verify code and hook/custody semantics,
|
|
162
|
-
then add its adapter and a tested managed-position lifecycle. Existing v3-only
|
|
163
|
-
application capability gates remain appropriate until that adapter is verified.
|
|
162
|
+
The v3 and v4 transaction surfaces prepare unsigned calldata and verify protocol-specific
|
|
163
|
+
facts. They do not grant authorization or submit transactions. Arc shared Uniswap source
|
|
164
|
+
and runtime identity are reviewed; Argus custom-hook, fee, custody, and permanently locked
|
|
165
|
+
launch-principal semantics are not claimed here. Keep application write capability gated
|
|
166
|
+
until the launcher adapter proves those semantics with exact-router simulation and pinned
|
|
167
|
+
fork evidence.
|
|
164
168
|
|
|
165
169
|
## Protocol provider composition
|
|
166
170
|
|
package/RELEASING.md
CHANGED
|
@@ -65,8 +65,11 @@ conformance rules. Run `npm run test:fork` separately with an
|
|
|
65
65
|
archive-capable `SDK_FORK_EIP155_4663_RPC_URL`; it simulates and executes the
|
|
66
66
|
reviewed close path on a pinned Anvil fork, then requires the collected receipt
|
|
67
67
|
amounts to match the simulation. Run `npm run test:live-compatibility` before release to
|
|
68
|
-
recheck
|
|
69
|
-
custom-hook compatibility. Arc
|
|
68
|
+
recheck all three deployment records. Runtime code identity is not source verification or
|
|
69
|
+
custom-hook compatibility. Arc's shared Uniswap deployment is runtime-pinned and its
|
|
70
|
+
official manifest plus retained generated artifacts are reproducible as documented in
|
|
71
|
+
`docs/ARC_V4_PROVENANCE.md`; this is not a fresh source compilation and does not establish
|
|
72
|
+
Argus launcher semantics.
|
|
70
73
|
|
|
71
74
|
Set one exact version such as `<version>` in package.json and package-lock.json,
|
|
72
75
|
land the source on main, then push its immutable tag `uniswap-sdk-v<version>`.
|
package/dist/abis.d.ts
CHANGED
|
@@ -158,6 +158,46 @@ export declare const v4PoolManagerAbi: readonly [{
|
|
|
158
158
|
}];
|
|
159
159
|
}];
|
|
160
160
|
export declare const v4PositionManagerAbi: readonly [{
|
|
161
|
+
readonly name: "poolManager";
|
|
162
|
+
readonly type: "function";
|
|
163
|
+
readonly stateMutability: "view";
|
|
164
|
+
readonly inputs: readonly [];
|
|
165
|
+
readonly outputs: readonly [{
|
|
166
|
+
readonly type: "address";
|
|
167
|
+
}];
|
|
168
|
+
}, {
|
|
169
|
+
readonly name: "permit2";
|
|
170
|
+
readonly type: "function";
|
|
171
|
+
readonly stateMutability: "view";
|
|
172
|
+
readonly inputs: readonly [];
|
|
173
|
+
readonly outputs: readonly [{
|
|
174
|
+
readonly type: "address";
|
|
175
|
+
}];
|
|
176
|
+
}, {
|
|
177
|
+
readonly name: "WETH9";
|
|
178
|
+
readonly type: "function";
|
|
179
|
+
readonly stateMutability: "view";
|
|
180
|
+
readonly inputs: readonly [];
|
|
181
|
+
readonly outputs: readonly [{
|
|
182
|
+
readonly type: "address";
|
|
183
|
+
}];
|
|
184
|
+
}, {
|
|
185
|
+
readonly name: "tokenDescriptor";
|
|
186
|
+
readonly type: "function";
|
|
187
|
+
readonly stateMutability: "view";
|
|
188
|
+
readonly inputs: readonly [];
|
|
189
|
+
readonly outputs: readonly [{
|
|
190
|
+
readonly type: "address";
|
|
191
|
+
}];
|
|
192
|
+
}, {
|
|
193
|
+
readonly name: "unsubscribeGasLimit";
|
|
194
|
+
readonly type: "function";
|
|
195
|
+
readonly stateMutability: "view";
|
|
196
|
+
readonly inputs: readonly [];
|
|
197
|
+
readonly outputs: readonly [{
|
|
198
|
+
readonly type: "uint256";
|
|
199
|
+
}];
|
|
200
|
+
}, {
|
|
161
201
|
readonly name: "initializePool";
|
|
162
202
|
readonly type: "function";
|
|
163
203
|
readonly stateMutability: "payable";
|
package/dist/abis.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abis.d.ts","sourceRoot":"","sources":["../src/abis.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMzB,CAAC;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKtB,CAAC;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE3B,CAAC;AACH,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"abis.d.ts","sourceRoot":"","sources":["../src/abis.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMzB,CAAC;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKtB,CAAC;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE3B,CAAC;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAa/B,CAAC;AAEH,cAAc,cAAc,CAAC"}
|
package/dist/abis.js
CHANGED
|
@@ -18,6 +18,11 @@ export const v4PoolManagerAbi = parseAbi([
|
|
|
18
18
|
'event Initialize(bytes32 indexed id, address indexed currency0, address indexed currency1, uint24 fee, int24 tickSpacing, address hooks, uint160 sqrtPriceX96, int24 tick)',
|
|
19
19
|
]);
|
|
20
20
|
export const v4PositionManagerAbi = parseAbi([
|
|
21
|
+
'function poolManager() view returns (address)',
|
|
22
|
+
'function permit2() view returns (address)',
|
|
23
|
+
'function WETH9() view returns (address)',
|
|
24
|
+
'function tokenDescriptor() view returns (address)',
|
|
25
|
+
'function unsubscribeGasLimit() view returns (uint256)',
|
|
21
26
|
'struct PoolKey { address currency0; address currency1; uint24 fee; int24 tickSpacing; address hooks; }',
|
|
22
27
|
'struct AllowanceTransferDetails { address token; uint160 amount; uint48 expiration; uint48 nonce; }',
|
|
23
28
|
'struct AllowanceTransferPermitBatch { AllowanceTransferDetails[] details; address spender; uint256 sigDeadline; }',
|
package/dist/abis.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abis.js","sourceRoot":"","sources":["../src/abis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAEhC,+EAA+E;AAC/E,oEAAoE;AACpE,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC;IACrC,+CAA+C;IAC/C,qHAAqH;IACrH,wEAAwE;IACxE,2EAA2E;IAC3E,kHAAkH;CACnH,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC;IAClC,+CAA+C;IAC/C,wGAAwG;IACxG,0GAA0G;IAC1G,gHAAgH;CACjH,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACvC,4KAA4K;CAC7K,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAC;IAC3C,wGAAwG;IACxG,qGAAqG;IACrG,mHAAmH;IACnH,oFAAoF;IACpF,wEAAwE;IACxE,oEAAoE;IACpE,4HAA4H;CAC7H,CAAC,CAAC;AAEH,cAAc,cAAc,CAAC","sourcesContent":["import { parseAbi } from 'viem';\n\n// Standard v4-core/periphery selectors; extracted from the bot's read surface.\n// They do not attest compatibility of a supplied custom deployment.\nexport const v4StateViewAbi = parseAbi([\n 'function poolManager() view returns (address)',\n 'function getSlot0(bytes32 poolId) view returns (uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 lpFee)',\n 'function getLiquidity(bytes32 poolId) view returns (uint128 liquidity)',\n 'function getTickBitmap(bytes32 poolId, int16 word) view returns (uint256)',\n 'function getTickLiquidity(bytes32 poolId, int24 tick) view returns (uint128 liquidityGross, int128 liquidityNet)',\n]);\nexport const v4QuoterAbi = parseAbi([\n 'function poolManager() view returns (address)',\n 'struct PoolKey { address currency0; address currency1; uint24 fee; int24 tickSpacing; address hooks; }',\n 'struct QuoteExactSingleParams { PoolKey poolKey; bool zeroForOne; uint128 exactAmount; bytes hookData; }',\n 'function quoteExactInputSingle(QuoteExactSingleParams params) returns (uint256 amountOut, uint256 gasEstimate)',\n]);\nexport const v4PoolManagerAbi = parseAbi([\n 'event Initialize(bytes32 indexed id, address indexed currency0, address indexed currency1, uint24 fee, int24 tickSpacing, address hooks, uint160 sqrtPriceX96, int24 tick)',\n]);\nexport const v4PositionManagerAbi = parseAbi([\n 'struct PoolKey { address currency0; address currency1; uint24 fee; int24 tickSpacing; address hooks; }',\n 'struct AllowanceTransferDetails { address token; uint160 amount; uint48 expiration; uint48 nonce; }',\n 'struct AllowanceTransferPermitBatch { AllowanceTransferDetails[] details; address spender; uint256 sigDeadline; }',\n 'function initializePool(PoolKey key, uint160 sqrtPriceX96) payable returns (int24)',\n 'function modifyLiquidities(bytes unlockData, uint256 deadline) payable',\n 'function multicall(bytes[] data) payable returns (bytes[] results)',\n 'function permitBatch(address owner, AllowanceTransferPermitBatch permitBatch, bytes signature) payable returns (bytes err)',\n]);\n\nexport * from './v3-abis.js';\n"]}
|
|
1
|
+
{"version":3,"file":"abis.js","sourceRoot":"","sources":["../src/abis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAEhC,+EAA+E;AAC/E,oEAAoE;AACpE,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC;IACrC,+CAA+C;IAC/C,qHAAqH;IACrH,wEAAwE;IACxE,2EAA2E;IAC3E,kHAAkH;CACnH,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC;IAClC,+CAA+C;IAC/C,wGAAwG;IACxG,0GAA0G;IAC1G,gHAAgH;CACjH,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACvC,4KAA4K;CAC7K,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAC;IAC3C,+CAA+C;IAC/C,2CAA2C;IAC3C,yCAAyC;IACzC,mDAAmD;IACnD,uDAAuD;IACvD,wGAAwG;IACxG,qGAAqG;IACrG,mHAAmH;IACnH,oFAAoF;IACpF,wEAAwE;IACxE,oEAAoE;IACpE,4HAA4H;CAC7H,CAAC,CAAC;AAEH,cAAc,cAAc,CAAC","sourcesContent":["import { parseAbi } from 'viem';\n\n// Standard v4-core/periphery selectors; extracted from the bot's read surface.\n// They do not attest compatibility of a supplied custom deployment.\nexport const v4StateViewAbi = parseAbi([\n 'function poolManager() view returns (address)',\n 'function getSlot0(bytes32 poolId) view returns (uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 lpFee)',\n 'function getLiquidity(bytes32 poolId) view returns (uint128 liquidity)',\n 'function getTickBitmap(bytes32 poolId, int16 word) view returns (uint256)',\n 'function getTickLiquidity(bytes32 poolId, int24 tick) view returns (uint128 liquidityGross, int128 liquidityNet)',\n]);\nexport const v4QuoterAbi = parseAbi([\n 'function poolManager() view returns (address)',\n 'struct PoolKey { address currency0; address currency1; uint24 fee; int24 tickSpacing; address hooks; }',\n 'struct QuoteExactSingleParams { PoolKey poolKey; bool zeroForOne; uint128 exactAmount; bytes hookData; }',\n 'function quoteExactInputSingle(QuoteExactSingleParams params) returns (uint256 amountOut, uint256 gasEstimate)',\n]);\nexport const v4PoolManagerAbi = parseAbi([\n 'event Initialize(bytes32 indexed id, address indexed currency0, address indexed currency1, uint24 fee, int24 tickSpacing, address hooks, uint160 sqrtPriceX96, int24 tick)',\n]);\nexport const v4PositionManagerAbi = parseAbi([\n 'function poolManager() view returns (address)',\n 'function permit2() view returns (address)',\n 'function WETH9() view returns (address)',\n 'function tokenDescriptor() view returns (address)',\n 'function unsubscribeGasLimit() view returns (uint256)',\n 'struct PoolKey { address currency0; address currency1; uint24 fee; int24 tickSpacing; address hooks; }',\n 'struct AllowanceTransferDetails { address token; uint160 amount; uint48 expiration; uint48 nonce; }',\n 'struct AllowanceTransferPermitBatch { AllowanceTransferDetails[] details; address spender; uint256 sigDeadline; }',\n 'function initializePool(PoolKey key, uint160 sqrtPriceX96) payable returns (int24)',\n 'function modifyLiquidities(bytes unlockData, uint256 deadline) payable',\n 'function multicall(bytes[] data) payable returns (bytes[] results)',\n 'function permitBatch(address owner, AllowanceTransferPermitBatch permitBatch, bytes signature) payable returns (bytes err)',\n]);\n\nexport * from './v3-abis.js';\n"]}
|
package/dist/compatibility.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Address, type Hex, type PublicClient } from 'viem';
|
|
2
|
-
import type { UniswapV3ContractName, UniswapV3Deployment } from './deployments.js';
|
|
2
|
+
import type { ArcUniswapV4ContractName, ArcUniswapV4Deployment, UniswapV3ContractName, UniswapV3Deployment } from './deployments.js';
|
|
3
3
|
export interface UniswapV3CompatibilityReport {
|
|
4
4
|
chainId: number;
|
|
5
5
|
abiRevision: string;
|
|
@@ -8,8 +8,28 @@ export interface UniswapV3CompatibilityReport {
|
|
|
8
8
|
positionManagerFactory: Address;
|
|
9
9
|
positionManagerWrappedNative: Address;
|
|
10
10
|
}
|
|
11
|
+
export interface ArcUniswapV4CompatibilityReport {
|
|
12
|
+
chainId: number;
|
|
13
|
+
blockNumber: bigint;
|
|
14
|
+
blockHash: Hex;
|
|
15
|
+
contractsWithCode: readonly Address[];
|
|
16
|
+
runtimeCodeHashes: Readonly<Record<ArcUniswapV4ContractName, Hex>>;
|
|
17
|
+
stateViewPoolManager: Address;
|
|
18
|
+
quoterPoolManager: Address;
|
|
19
|
+
positionManagerPoolManager: Address;
|
|
20
|
+
positionManagerPermit2: Address;
|
|
21
|
+
positionManagerWrappedNative: Address;
|
|
22
|
+
positionManagerTokenDescriptor: Address;
|
|
23
|
+
positionManagerUnsubscribeGasLimit: bigint;
|
|
24
|
+
}
|
|
11
25
|
/**
|
|
12
26
|
* Checks chain identity, exact runtime code hashes, and position-manager wiring.
|
|
13
27
|
*/
|
|
14
28
|
export declare function verifyUniswapV3Compatibility(client: PublicClient, deployment: UniswapV3Deployment): Promise<UniswapV3CompatibilityReport>;
|
|
29
|
+
/**
|
|
30
|
+
* Rechecks the exact Arc block, runtime bytecode, and v4 immutable wiring.
|
|
31
|
+
* Retained upstream generated initcode is verified separately by
|
|
32
|
+
* verify-v4-retained-artifacts.mjs; that check is not a fresh source compilation.
|
|
33
|
+
*/
|
|
34
|
+
export declare function verifyArcUniswapV4Compatibility(client: PublicClient, deployment: ArcUniswapV4Deployment): Promise<ArcUniswapV4CompatibilityReport>;
|
|
15
35
|
//# sourceMappingURL=compatibility.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compatibility.d.ts","sourceRoot":"","sources":["../src/compatibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,YAAY,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"compatibility.d.ts","s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AAC,+BAA+B,CAAC,CA+F1C"}
|
package/dist/compatibility.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getAddress, keccak256 } from 'viem';
|
|
2
|
+
import { v4PositionManagerAbi, v4QuoterAbi, v4StateViewAbi } from './abis.js';
|
|
2
3
|
import { V3_ABI_REVISION, v3PositionManagerAbi } from './v3-abis.js';
|
|
3
4
|
import { rpc, UniswapSdkError } from './errors.js';
|
|
4
5
|
/**
|
|
@@ -43,6 +44,91 @@ export async function verifyUniswapV3Compatibility(client, deployment) {
|
|
|
43
44
|
};
|
|
44
45
|
});
|
|
45
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Rechecks the exact Arc block, runtime bytecode, and v4 immutable wiring.
|
|
49
|
+
* Retained upstream generated initcode is verified separately by
|
|
50
|
+
* verify-v4-retained-artifacts.mjs; that check is not a fresh source compilation.
|
|
51
|
+
*/
|
|
52
|
+
export async function verifyArcUniswapV4Compatibility(client, deployment) {
|
|
53
|
+
return rpc(async () => {
|
|
54
|
+
for (const name of ['poolManager', 'stateView', 'quoter']) {
|
|
55
|
+
if (deployment[name].toLowerCase() !== deployment.contracts[name].toLowerCase()) {
|
|
56
|
+
mismatch(name, deployment.contracts[name], deployment[name]);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const chainId = await client.getChainId();
|
|
60
|
+
if (chainId !== deployment.chainId)
|
|
61
|
+
mismatch('chainId', deployment.chainId, chainId);
|
|
62
|
+
const block = await client.getBlock({ blockNumber: deployment.referenceBlock.number });
|
|
63
|
+
if (block.hash !== deployment.referenceBlock.hash) {
|
|
64
|
+
mismatch('referenceBlock.hash', deployment.referenceBlock.hash, block.hash);
|
|
65
|
+
}
|
|
66
|
+
const contractNames = Object.keys(deployment.contracts);
|
|
67
|
+
const checked = contractNames.map(name => deployment.contracts[name]);
|
|
68
|
+
const runtimeCodeHashes = {};
|
|
69
|
+
for (const name of contractNames) {
|
|
70
|
+
const address = deployment.contracts[name];
|
|
71
|
+
const bytecode = await client.getBytecode({ address, blockNumber: deployment.referenceBlock.number });
|
|
72
|
+
if (!bytecode || bytecode === '0x')
|
|
73
|
+
mismatch(`contracts.${name}`, 'deployed bytecode', bytecode ?? 'undefined');
|
|
74
|
+
const runtimeCodeHash = keccak256(bytecode);
|
|
75
|
+
if (runtimeCodeHash !== deployment.runtimeCodeHashes[name]) {
|
|
76
|
+
mismatch(`runtimeCodeHashes.${name}`, deployment.runtimeCodeHashes[name], runtimeCodeHash);
|
|
77
|
+
}
|
|
78
|
+
runtimeCodeHashes[name] = runtimeCodeHash;
|
|
79
|
+
}
|
|
80
|
+
const blockNumber = deployment.referenceBlock.number;
|
|
81
|
+
const [stateViewPoolManagerValue, quoterPoolManagerValue, positionManagerPoolManagerValue, positionManagerPermit2Value, positionManagerWrappedNativeValue, positionManagerTokenDescriptorValue, positionManagerUnsubscribeGasLimit,] = await Promise.all([
|
|
82
|
+
client.readContract({ address: deployment.contracts.stateView, abi: v4StateViewAbi, functionName: 'poolManager', blockNumber }),
|
|
83
|
+
client.readContract({ address: deployment.contracts.quoter, abi: v4QuoterAbi, functionName: 'poolManager', blockNumber }),
|
|
84
|
+
client.readContract({ address: deployment.contracts.positionManager, abi: v4PositionManagerAbi, functionName: 'poolManager', blockNumber }),
|
|
85
|
+
client.readContract({ address: deployment.contracts.positionManager, abi: v4PositionManagerAbi, functionName: 'permit2', blockNumber }),
|
|
86
|
+
client.readContract({ address: deployment.contracts.positionManager, abi: v4PositionManagerAbi, functionName: 'WETH9', blockNumber }),
|
|
87
|
+
client.readContract({ address: deployment.contracts.positionManager, abi: v4PositionManagerAbi, functionName: 'tokenDescriptor', blockNumber }),
|
|
88
|
+
client.readContract({ address: deployment.contracts.positionManager, abi: v4PositionManagerAbi, functionName: 'unsubscribeGasLimit', blockNumber }),
|
|
89
|
+
]);
|
|
90
|
+
const stateViewPoolManager = getAddress(stateViewPoolManagerValue);
|
|
91
|
+
const quoterPoolManager = getAddress(quoterPoolManagerValue);
|
|
92
|
+
const positionManagerPoolManager = getAddress(positionManagerPoolManagerValue);
|
|
93
|
+
const positionManagerPermit2 = getAddress(positionManagerPermit2Value);
|
|
94
|
+
const positionManagerWrappedNative = getAddress(positionManagerWrappedNativeValue);
|
|
95
|
+
const positionManagerTokenDescriptor = getAddress(positionManagerTokenDescriptorValue);
|
|
96
|
+
for (const [path, actual] of [
|
|
97
|
+
['stateView.poolManager', stateViewPoolManager],
|
|
98
|
+
['quoter.poolManager', quoterPoolManager],
|
|
99
|
+
['positionManager.poolManager', positionManagerPoolManager],
|
|
100
|
+
]) {
|
|
101
|
+
if (actual !== deployment.contracts.poolManager)
|
|
102
|
+
mismatch(path, deployment.contracts.poolManager, actual);
|
|
103
|
+
}
|
|
104
|
+
if (positionManagerPermit2 !== deployment.contracts.permit2) {
|
|
105
|
+
mismatch('positionManager.permit2', deployment.contracts.permit2, positionManagerPermit2);
|
|
106
|
+
}
|
|
107
|
+
if (positionManagerWrappedNative !== deployment.positionManagerWiring.wrappedNative) {
|
|
108
|
+
mismatch('positionManager.WETH9', deployment.positionManagerWiring.wrappedNative, positionManagerWrappedNative);
|
|
109
|
+
}
|
|
110
|
+
if (positionManagerTokenDescriptor !== deployment.positionManagerWiring.tokenDescriptor) {
|
|
111
|
+
mismatch('positionManager.tokenDescriptor', deployment.positionManagerWiring.tokenDescriptor, positionManagerTokenDescriptor);
|
|
112
|
+
}
|
|
113
|
+
if (positionManagerUnsubscribeGasLimit !== deployment.positionManagerWiring.unsubscribeGasLimit) {
|
|
114
|
+
mismatch('positionManager.unsubscribeGasLimit', deployment.positionManagerWiring.unsubscribeGasLimit, positionManagerUnsubscribeGasLimit);
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
chainId,
|
|
118
|
+
blockNumber,
|
|
119
|
+
blockHash: block.hash,
|
|
120
|
+
contractsWithCode: checked,
|
|
121
|
+
runtimeCodeHashes,
|
|
122
|
+
stateViewPoolManager,
|
|
123
|
+
quoterPoolManager,
|
|
124
|
+
positionManagerPoolManager,
|
|
125
|
+
positionManagerPermit2,
|
|
126
|
+
positionManagerWrappedNative,
|
|
127
|
+
positionManagerTokenDescriptor,
|
|
128
|
+
positionManagerUnsubscribeGasLimit,
|
|
129
|
+
};
|
|
130
|
+
});
|
|
131
|
+
}
|
|
46
132
|
async function readAddress(client, address, functionName) {
|
|
47
133
|
const value = await client.readContract({ address, abi: v3PositionManagerAbi, functionName });
|
|
48
134
|
return getAddress(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compatibility.js","sourceRoot":"","sources":["../src/compatibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAA6C,MAAM,MAAM,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAErE,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAWnD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,MAAoB,EACpB,UAA+B;IAE/B,OAAO,GAAG,CAAC,KAAK,IAAI,EAAE;QACpB,IAAI,UAAU,CAAC,WAAW,KAAK,eAAe;YAAE,QAAQ,CAAC,wBAAwB,EAAE,eAAe,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;QAC5H,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;QAC1C,IAAI,OAAO,KAAK,UAAU,CAAC,OAAO;YAAE,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAErF,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAA4B,CAAC;QACnF,MAAM,OAAO,GAAG,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;QACtE,MAAM,iBAAiB,GAAG,EAAwC,CAAC;QACnE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,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;QAE3K,OAAO;YACL,OAAO;YACP,WAAW,EAAE,UAAU,CAAC,WAAW;YACnC,iBAAiB,EAAE,OAAO;YAC1B,iBAAiB;YACjB,sBAAsB,EAAE,OAAO;YAC/B,4BAA4B,EAAE,aAAa;SAC5C,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,WAAW,CAAC,MAAoB,EAAE,OAAgB,EAAE,YAAiC;IAClG,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,oBAAoB,EAAE,YAAY,EAAE,CAAC,CAAC;IAC9F,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY,EAAE,QAAiB,EAAE,MAAe;IAChE,MAAM,IAAI,eAAe,CAAC,qBAAqB,EAAE,GAAG,IAAI,uBAAuB,MAAM,CAAC,QAAQ,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE;QACxH,IAAI;QACJ,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;QAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;KACvB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { getAddress, keccak256, type Address, type Hex, type PublicClient } from 'viem';\nimport { V3_ABI_REVISION, v3PositionManagerAbi } from './v3-abis.js';\nimport type { UniswapV3ContractName, UniswapV3Deployment } from './deployments.js';\nimport { rpc, UniswapSdkError } from './errors.js';\n\nexport interface UniswapV3CompatibilityReport {\n chainId: number;\n abiRevision: string;\n contractsWithCode: readonly Address[];\n runtimeCodeHashes: Readonly<Record<UniswapV3ContractName, Hex>>;\n positionManagerFactory: Address;\n positionManagerWrappedNative: Address;\n}\n\n/**\n * Checks chain identity, exact runtime code hashes, and position-manager wiring.\n */\nexport async function verifyUniswapV3Compatibility(\n client: PublicClient,\n deployment: UniswapV3Deployment,\n): Promise<UniswapV3CompatibilityReport> {\n return rpc(async () => {\n if (deployment.abiRevision !== V3_ABI_REVISION) mismatch('deployment.abiRevision', V3_ABI_REVISION, deployment.abiRevision);\n const chainId = await client.getChainId();\n if (chainId !== deployment.chainId) mismatch('chainId', deployment.chainId, chainId);\n\n const contractNames = Object.keys(deployment.contracts) as UniswapV3ContractName[];\n const checked = contractNames.map(name => deployment.contracts[name]);\n const runtimeCodeHashes = {} as Record<UniswapV3ContractName, Hex>;\n for (const name of contractNames) {\n const address = deployment.contracts[name];\n const bytecode = await client.getBytecode({ address });\n if (!bytecode || bytecode === '0x') mismatch(`contracts.${address}`, 'deployed bytecode', bytecode ?? 'undefined');\n const runtimeCodeHash = keccak256(bytecode);\n if (runtimeCodeHash !== deployment.runtimeCodeHashes[name]) {\n mismatch(`runtimeCodeHashes.${name}`, deployment.runtimeCodeHashes[name], runtimeCodeHash);\n }\n runtimeCodeHashes[name] = runtimeCodeHash;\n }\n\n const [factory, wrappedNative] = await Promise.all([\n readAddress(client, deployment.contracts.nonfungiblePositionManager, 'factory'),\n readAddress(client, deployment.contracts.nonfungiblePositionManager, 'WETH9'),\n ]);\n if (factory.toLowerCase() !== deployment.contracts.factory.toLowerCase()) mismatch('positionManager.factory', deployment.contracts.factory, factory);\n if (wrappedNative.toLowerCase() !== deployment.contracts.wrappedNative.toLowerCase()) mismatch('positionManager.WETH9', deployment.contracts.wrappedNative, wrappedNative);\n\n return {\n chainId,\n abiRevision: deployment.abiRevision,\n contractsWithCode: checked,\n runtimeCodeHashes,\n positionManagerFactory: factory,\n positionManagerWrappedNative: wrappedNative,\n };\n });\n}\n\nasync function readAddress(client: PublicClient, address: Address, functionName: 'factory' | 'WETH9'): Promise<Address> {\n const value = await client.readContract({ address, abi: v3PositionManagerAbi, functionName });\n return getAddress(value);\n}\n\nfunction mismatch(path: string, expected: unknown, actual: unknown): never {\n throw new UniswapSdkError('DEPLOYMENT_MISMATCH', `${path} mismatch: expected ${String(expected)}, got ${String(actual)}`, {\n path,\n expected: String(expected),\n actual: String(actual),\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"compatibility.js","sourceRoot":"","sources":["../src/compatibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAA6C,MAAM,MAAM,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAOrE,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA0BnD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,MAAoB,EACpB,UAA+B;IAE/B,OAAO,GAAG,CAAC,KAAK,IAAI,EAAE;QACpB,IAAI,UAAU,CAAC,WAAW,KAAK,eAAe;YAAE,QAAQ,CAAC,wBAAwB,EAAE,eAAe,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;QAC5H,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;QAC1C,IAAI,OAAO,KAAK,UAAU,CAAC,OAAO;YAAE,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAErF,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAA4B,CAAC;QACnF,MAAM,OAAO,GAAG,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;QACtE,MAAM,iBAAiB,GAAG,EAAwC,CAAC;QACnE,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE,CAAC;YACjC,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAC3C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,EAAE,OAAO,EAA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L,CAAC;AAED,KAAK,UAAU,WAAW,CAAC,MAAoB,EAAE,OAAgB,EAAE,YAAiC;IAClG,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,oBAAoB,EAAE,YAAY,EAAE,CAAC,CAAC;IAC9F,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY,EAAE,QAAiB,EAAE,MAAe;IAChE,MAAM,IAAI,eAAe,CAAC,qBAAqB,EAAE,GAAG,IAAI,uBAAuB,MAAM,CAAC,QAAQ,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE;QACxH,IAAI;QACJ,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;QAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;KACvB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { getAddress, keccak256, type Address, type Hex, type PublicClient } from 'viem';\nimport { v4PositionManagerAbi, v4QuoterAbi, v4StateViewAbi } from './abis.js';\nimport { V3_ABI_REVISION, v3PositionManagerAbi } from './v3-abis.js';\nimport type {\n ArcUniswapV4ContractName,\n ArcUniswapV4Deployment,\n UniswapV3ContractName,\n UniswapV3Deployment,\n} from './deployments.js';\nimport { rpc, UniswapSdkError } from './errors.js';\n\nexport interface UniswapV3CompatibilityReport {\n chainId: number;\n abiRevision: string;\n contractsWithCode: readonly Address[];\n runtimeCodeHashes: Readonly<Record<UniswapV3ContractName, Hex>>;\n positionManagerFactory: Address;\n positionManagerWrappedNative: Address;\n}\n\nexport interface ArcUniswapV4CompatibilityReport {\n chainId: number;\n blockNumber: bigint;\n blockHash: Hex;\n contractsWithCode: readonly Address[];\n runtimeCodeHashes: Readonly<Record<ArcUniswapV4ContractName, Hex>>;\n stateViewPoolManager: Address;\n quoterPoolManager: Address;\n positionManagerPoolManager: Address;\n positionManagerPermit2: Address;\n positionManagerWrappedNative: Address;\n positionManagerTokenDescriptor: Address;\n positionManagerUnsubscribeGasLimit: bigint;\n}\n\n/**\n * Checks chain identity, exact runtime code hashes, and position-manager wiring.\n */\nexport async function verifyUniswapV3Compatibility(\n client: PublicClient,\n deployment: UniswapV3Deployment,\n): Promise<UniswapV3CompatibilityReport> {\n return rpc(async () => {\n if (deployment.abiRevision !== V3_ABI_REVISION) mismatch('deployment.abiRevision', V3_ABI_REVISION, deployment.abiRevision);\n const chainId = await client.getChainId();\n if (chainId !== deployment.chainId) mismatch('chainId', deployment.chainId, chainId);\n\n const contractNames = Object.keys(deployment.contracts) as UniswapV3ContractName[];\n const checked = contractNames.map(name => deployment.contracts[name]);\n const runtimeCodeHashes = {} as Record<UniswapV3ContractName, Hex>;\n for (const name of contractNames) {\n const address = deployment.contracts[name];\n const bytecode = await client.getBytecode({ address });\n if (!bytecode || bytecode === '0x') mismatch(`contracts.${address}`, 'deployed bytecode', bytecode ?? 'undefined');\n const runtimeCodeHash = keccak256(bytecode);\n if (runtimeCodeHash !== deployment.runtimeCodeHashes[name]) {\n mismatch(`runtimeCodeHashes.${name}`, deployment.runtimeCodeHashes[name], runtimeCodeHash);\n }\n runtimeCodeHashes[name] = runtimeCodeHash;\n }\n\n const [factory, wrappedNative] = await Promise.all([\n readAddress(client, deployment.contracts.nonfungiblePositionManager, 'factory'),\n readAddress(client, deployment.contracts.nonfungiblePositionManager, 'WETH9'),\n ]);\n if (factory.toLowerCase() !== deployment.contracts.factory.toLowerCase()) mismatch('positionManager.factory', deployment.contracts.factory, factory);\n if (wrappedNative.toLowerCase() !== deployment.contracts.wrappedNative.toLowerCase()) mismatch('positionManager.WETH9', deployment.contracts.wrappedNative, wrappedNative);\n\n return {\n chainId,\n abiRevision: deployment.abiRevision,\n contractsWithCode: checked,\n runtimeCodeHashes,\n positionManagerFactory: factory,\n positionManagerWrappedNative: wrappedNative,\n };\n });\n}\n\n/**\n * Rechecks the exact Arc block, runtime bytecode, and v4 immutable wiring.\n * Retained upstream generated initcode is verified separately by\n * verify-v4-retained-artifacts.mjs; that check is not a fresh source compilation.\n */\nexport async function verifyArcUniswapV4Compatibility(\n client: PublicClient,\n deployment: ArcUniswapV4Deployment,\n): Promise<ArcUniswapV4CompatibilityReport> {\n return rpc(async () => {\n for (const name of ['poolManager', 'stateView', 'quoter'] as const) {\n if (deployment[name].toLowerCase() !== deployment.contracts[name].toLowerCase()) {\n mismatch(name, deployment.contracts[name], deployment[name]);\n }\n }\n\n const chainId = await client.getChainId();\n if (chainId !== deployment.chainId) mismatch('chainId', deployment.chainId, chainId);\n\n const block = await client.getBlock({ blockNumber: deployment.referenceBlock.number });\n if (block.hash !== deployment.referenceBlock.hash) {\n mismatch('referenceBlock.hash', deployment.referenceBlock.hash, block.hash);\n }\n\n const contractNames = Object.keys(deployment.contracts) as ArcUniswapV4ContractName[];\n const checked = contractNames.map(name => deployment.contracts[name]);\n const runtimeCodeHashes = {} as Record<ArcUniswapV4ContractName, Hex>;\n for (const name of contractNames) {\n const address = deployment.contracts[name];\n const bytecode = await client.getBytecode({ address, blockNumber: deployment.referenceBlock.number });\n if (!bytecode || bytecode === '0x') mismatch(`contracts.${name}`, 'deployed bytecode', bytecode ?? 'undefined');\n const runtimeCodeHash = keccak256(bytecode);\n if (runtimeCodeHash !== deployment.runtimeCodeHashes[name]) {\n mismatch(`runtimeCodeHashes.${name}`, deployment.runtimeCodeHashes[name], runtimeCodeHash);\n }\n runtimeCodeHashes[name] = runtimeCodeHash;\n }\n\n const blockNumber = deployment.referenceBlock.number;\n const [\n stateViewPoolManagerValue,\n quoterPoolManagerValue,\n positionManagerPoolManagerValue,\n positionManagerPermit2Value,\n positionManagerWrappedNativeValue,\n positionManagerTokenDescriptorValue,\n positionManagerUnsubscribeGasLimit,\n ] = await Promise.all([\n client.readContract({ address: deployment.contracts.stateView, abi: v4StateViewAbi, functionName: 'poolManager', blockNumber }),\n client.readContract({ address: deployment.contracts.quoter, abi: v4QuoterAbi, functionName: 'poolManager', blockNumber }),\n client.readContract({ address: deployment.contracts.positionManager, abi: v4PositionManagerAbi, functionName: 'poolManager', blockNumber }),\n client.readContract({ address: deployment.contracts.positionManager, abi: v4PositionManagerAbi, functionName: 'permit2', blockNumber }),\n client.readContract({ address: deployment.contracts.positionManager, abi: v4PositionManagerAbi, functionName: 'WETH9', blockNumber }),\n client.readContract({ address: deployment.contracts.positionManager, abi: v4PositionManagerAbi, functionName: 'tokenDescriptor', blockNumber }),\n client.readContract({ address: deployment.contracts.positionManager, abi: v4PositionManagerAbi, functionName: 'unsubscribeGasLimit', blockNumber }),\n ]);\n\n const stateViewPoolManager = getAddress(stateViewPoolManagerValue);\n const quoterPoolManager = getAddress(quoterPoolManagerValue);\n const positionManagerPoolManager = getAddress(positionManagerPoolManagerValue);\n const positionManagerPermit2 = getAddress(positionManagerPermit2Value);\n const positionManagerWrappedNative = getAddress(positionManagerWrappedNativeValue);\n const positionManagerTokenDescriptor = getAddress(positionManagerTokenDescriptorValue);\n\n for (const [path, actual] of [\n ['stateView.poolManager', stateViewPoolManager],\n ['quoter.poolManager', quoterPoolManager],\n ['positionManager.poolManager', positionManagerPoolManager],\n ] as const) {\n if (actual !== deployment.contracts.poolManager) mismatch(path, deployment.contracts.poolManager, actual);\n }\n if (positionManagerPermit2 !== deployment.contracts.permit2) {\n mismatch('positionManager.permit2', deployment.contracts.permit2, positionManagerPermit2);\n }\n if (positionManagerWrappedNative !== deployment.positionManagerWiring.wrappedNative) {\n mismatch('positionManager.WETH9', deployment.positionManagerWiring.wrappedNative, positionManagerWrappedNative);\n }\n if (positionManagerTokenDescriptor !== deployment.positionManagerWiring.tokenDescriptor) {\n mismatch('positionManager.tokenDescriptor', deployment.positionManagerWiring.tokenDescriptor, positionManagerTokenDescriptor);\n }\n if (positionManagerUnsubscribeGasLimit !== deployment.positionManagerWiring.unsubscribeGasLimit) {\n mismatch(\n 'positionManager.unsubscribeGasLimit',\n deployment.positionManagerWiring.unsubscribeGasLimit,\n positionManagerUnsubscribeGasLimit,\n );\n }\n\n return {\n chainId,\n blockNumber,\n blockHash: block.hash,\n contractsWithCode: checked,\n runtimeCodeHashes,\n stateViewPoolManager,\n quoterPoolManager,\n positionManagerPoolManager,\n positionManagerPermit2,\n positionManagerWrappedNative,\n positionManagerTokenDescriptor,\n positionManagerUnsubscribeGasLimit,\n };\n });\n}\n\nasync function readAddress(client: PublicClient, address: Address, functionName: 'factory' | 'WETH9'): Promise<Address> {\n const value = await client.readContract({ address, abi: v3PositionManagerAbi, functionName });\n return getAddress(value);\n}\n\nfunction mismatch(path: string, expected: unknown, actual: unknown): never {\n throw new UniswapSdkError('DEPLOYMENT_MISMATCH', `${path} mismatch: expected ${String(expected)}, got ${String(actual)}`, {\n path,\n expected: String(expected),\n actual: String(actual),\n });\n}\n"]}
|
package/dist/deployments.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Address, type Hex } from 'viem';
|
|
2
|
+
import type { V4Deployment } from './pool.js';
|
|
2
3
|
export type RobinhoodUniswapV3DeploymentId = 'robinhood-mainnet-v3' | 'robinhood-testnet-v3';
|
|
3
4
|
export interface UniswapV3Contracts {
|
|
4
5
|
factory: Address;
|
|
@@ -21,7 +22,57 @@ export interface UniswapV3Deployment {
|
|
|
21
22
|
contracts: UniswapV3Contracts;
|
|
22
23
|
runtimeCodeHashes: UniswapV3RuntimeCodeHashes;
|
|
23
24
|
}
|
|
25
|
+
export type ArcUniswapV4DeploymentId = 'arc-mainnet-v4';
|
|
26
|
+
export interface ArcUniswapV4Contracts {
|
|
27
|
+
poolManager: Address;
|
|
28
|
+
stateView: Address;
|
|
29
|
+
positionManager: Address;
|
|
30
|
+
quoter: Address;
|
|
31
|
+
universalRouter: Address;
|
|
32
|
+
permit2: Address;
|
|
33
|
+
}
|
|
34
|
+
export type ArcUniswapV4ContractName = keyof ArcUniswapV4Contracts;
|
|
35
|
+
export type ArcUniswapV4RuntimeCodeHashes = Readonly<Record<ArcUniswapV4ContractName, Hex>>;
|
|
36
|
+
export type ArcUniswapV4ArtifactBackedContractName = Exclude<ArcUniswapV4ContractName, 'permit2'>;
|
|
37
|
+
export interface ArcUniswapV4RetainedArtifact {
|
|
38
|
+
repository: 'https://github.com/Uniswap/contracts';
|
|
39
|
+
sourceCommit: string;
|
|
40
|
+
sourcePackageCommit: string;
|
|
41
|
+
deployerArtifactPath: string;
|
|
42
|
+
sourceContractPath: string;
|
|
43
|
+
deploymentTransaction: Hex;
|
|
44
|
+
generatedInitcodeHash: Hex;
|
|
45
|
+
deploymentManifestInputHash: Hex;
|
|
46
|
+
proxy: false;
|
|
47
|
+
}
|
|
48
|
+
export interface ArcUniswapV4Deployment extends V4Deployment {
|
|
49
|
+
id: ArcUniswapV4DeploymentId;
|
|
50
|
+
chainId: 5_042;
|
|
51
|
+
network: 'arc-mainnet';
|
|
52
|
+
reviewedAt: string;
|
|
53
|
+
referenceBlock: Readonly<{
|
|
54
|
+
number: bigint;
|
|
55
|
+
hash: Hex;
|
|
56
|
+
}>;
|
|
57
|
+
contracts: Readonly<ArcUniswapV4Contracts>;
|
|
58
|
+
runtimeCodeHashes: ArcUniswapV4RuntimeCodeHashes;
|
|
59
|
+
retainedArtifacts: Readonly<Record<ArcUniswapV4ArtifactBackedContractName, ArcUniswapV4RetainedArtifact>>;
|
|
60
|
+
positionManagerWiring: Readonly<{
|
|
61
|
+
wrappedNative: Address;
|
|
62
|
+
tokenDescriptor: Address;
|
|
63
|
+
unsubscribeGasLimit: bigint;
|
|
64
|
+
}>;
|
|
65
|
+
limitations: readonly string[];
|
|
66
|
+
}
|
|
24
67
|
export declare const robinhoodUniswapV3Mainnet: UniswapV3Deployment;
|
|
25
68
|
export declare const robinhoodUniswapV3Testnet: UniswapV3Deployment;
|
|
69
|
+
/**
|
|
70
|
+
* Official Uniswap v4 infrastructure used by the reviewed Argus Arc flow.
|
|
71
|
+
*
|
|
72
|
+
* This proves only the shared Uniswap contracts. Argus Portal, hook, locker,
|
|
73
|
+
* splitter, and tracker compatibility remains the launcher adapter's gate.
|
|
74
|
+
*/
|
|
75
|
+
export declare const arcUniswapV4Mainnet: ArcUniswapV4Deployment;
|
|
26
76
|
export declare function getRobinhoodUniswapV3Deployment(chainId: number): UniswapV3Deployment;
|
|
77
|
+
export declare function getArcUniswapV4Deployment(chainId: number): ArcUniswapV4Deployment;
|
|
27
78
|
//# sourceMappingURL=deployments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployments.d.ts","sourceRoot":"","sources":["../src/deployments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"deployments.d.ts","sourceRoot":"","sources":["../src/deployments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAG1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C,MAAM,MAAM,8BAA8B,GAAG,sBAAsB,GAAG,sBAAsB,CAAC;AAE7F,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,0BAA0B,EAAE,OAAO,CAAC;IACpC,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,qBAAqB,GAAG,MAAM,kBAAkB,CAAC;AAC7D,MAAM,MAAM,0BAA0B,GAAG,QAAQ,CAAC,MAAM,CAAC,qBAAqB,EAAE,GAAG,CAAC,CAAC,CAAC;AAEtF,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,8BAA8B,CAAC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,yBAAyB,GAAG,yBAAyB,CAAC;IAC/D,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,UAAU,GAAG,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KAAE,CAAC,CAAC;IACxD,SAAS,EAAE,QAAQ,CAAC,qBAAqB,CAAC,CAAC;IAC3C,iBAAiB,EAAE,6BAA6B,CAAC;IACjD,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,sCAAsC,EAAE,4BAA4B,CAAC,CAAC,CAAC;IAC1G,qBAAqB,EAAE,QAAQ,CAAC;QAC9B,aAAa,EAAE,OAAO,CAAC;QACvB,eAAe,EAAE,OAAO,CAAC;QACzB,mBAAmB,EAAE,MAAM,CAAC;KAC7B,CAAC,CAAC;IACH,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC;AAID,eAAO,MAAM,yBAAyB,EAAE,mBAwBtC,CAAC;AAEH,eAAO,MAAM,yBAAyB,EAAE,mBAwBtC,CAAC;AAcH;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,sBAyFhC,CAAC;AAEH,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB,CAIpF;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,sBAAsB,CAGjF"}
|
package/dist/deployments.js
CHANGED
|
@@ -52,6 +52,113 @@ export const robinhoodUniswapV3Testnet = deepFreeze({
|
|
|
52
52
|
multicall3: '0xd5c15df687b16f2ff992fc8d767b4216323184a2bbc6ee2f9c398c318e770891',
|
|
53
53
|
},
|
|
54
54
|
});
|
|
55
|
+
const uniswapContractsRepository = 'https://github.com/Uniswap/contracts';
|
|
56
|
+
const arcV4SourceCommit = '534603a5bc10d41d57a1c9c34417d472f0dbc0d3';
|
|
57
|
+
const arcUniversalRouterSourceCommit = '02fd1760fa7c05096833c03e01a4143f963c350e';
|
|
58
|
+
const arcV4Contracts = {
|
|
59
|
+
poolManager: getAddress('0x8366a39CC670B4001A1121B8F6A443A643e40951'),
|
|
60
|
+
stateView: getAddress('0xF3334192D15450CdD385c8B70e03f9A6bD9E673b'),
|
|
61
|
+
positionManager: getAddress('0x6049c9a0e26405C0985f9E3685C87d0aE917f82B'),
|
|
62
|
+
quoter: getAddress('0x8dc178efb8111bb0973dd9d722ebeff267c98f94'),
|
|
63
|
+
universalRouter: getAddress('0x4fcA4a51Ab4F23A7447b3284fBd7D73289A89Fb1'),
|
|
64
|
+
permit2: getAddress('0x000000000022D473030F116dDEE9F6B43aC78BA3'),
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Official Uniswap v4 infrastructure used by the reviewed Argus Arc flow.
|
|
68
|
+
*
|
|
69
|
+
* This proves only the shared Uniswap contracts. Argus Portal, hook, locker,
|
|
70
|
+
* splitter, and tracker compatibility remains the launcher adapter's gate.
|
|
71
|
+
*/
|
|
72
|
+
export const arcUniswapV4Mainnet = deepFreeze({
|
|
73
|
+
id: 'arc-mainnet-v4',
|
|
74
|
+
chainId: 5_042,
|
|
75
|
+
network: 'arc-mainnet',
|
|
76
|
+
poolManager: arcV4Contracts.poolManager,
|
|
77
|
+
stateView: arcV4Contracts.stateView,
|
|
78
|
+
quoter: arcV4Contracts.quoter,
|
|
79
|
+
reviewedAt: '2026-09-27',
|
|
80
|
+
referenceBlock: {
|
|
81
|
+
number: 20889496n,
|
|
82
|
+
hash: '0xf3fd31df5afb9d37a216dda53ac751a6a6c08a9c7e96ce4c07fb0df18d40810b',
|
|
83
|
+
},
|
|
84
|
+
contracts: arcV4Contracts,
|
|
85
|
+
runtimeCodeHashes: {
|
|
86
|
+
poolManager: '0xbd3881180b547f5fe817545743cfb4343e96b1bc6640dcd70c106b0066e95626',
|
|
87
|
+
stateView: '0x7d9c591e0956fd89d98feb4ffcfe8bf1f7a62bd485edd979fa21d104b49878a6',
|
|
88
|
+
positionManager: '0x5904204586f0290499c357cfcb99489cdc13740b3cd3f26c735f7ef7f2cff1c5',
|
|
89
|
+
quoter: '0xd707b1da8cb165e5ea35a3b4450d971eb562ec171e23492aa117036b78a868f6',
|
|
90
|
+
universalRouter: '0x7f949fe75d3483670e17a9ab398a3dc71f285026bba755b48fffd1e42aefad71',
|
|
91
|
+
permit2: '0x05a793d6bdba8b8715c8f4cef0725ec3a961f567d33ebb2d360f541f19f70c8f',
|
|
92
|
+
},
|
|
93
|
+
retainedArtifacts: {
|
|
94
|
+
poolManager: {
|
|
95
|
+
repository: uniswapContractsRepository,
|
|
96
|
+
sourceCommit: arcV4SourceCommit,
|
|
97
|
+
sourcePackageCommit: '46c6834698c48bc4a463a86d8420f4eb1d7f3b75',
|
|
98
|
+
deployerArtifactPath: 'src/briefcase/deployers/v4-core/PoolManagerDeployer.sol',
|
|
99
|
+
sourceContractPath: 'src/pkgs/v4-core/src/PoolManager.sol',
|
|
100
|
+
deploymentTransaction: '0x2a3f2686d0dfc0e8bea88ec2dd006d0cb788410a5d24a946c8d638a32868341e',
|
|
101
|
+
generatedInitcodeHash: '0x1debe8d2bf707a0cea57ce3cdf7b399d61515897a5698b37050d2d5df0a95b2c',
|
|
102
|
+
deploymentManifestInputHash: '0x3bdcc016bd6b2f8a19e20bdfa136abbf66ffa7904f42dafa1f5c399e9758544c',
|
|
103
|
+
proxy: false,
|
|
104
|
+
},
|
|
105
|
+
stateView: {
|
|
106
|
+
repository: uniswapContractsRepository,
|
|
107
|
+
sourceCommit: arcV4SourceCommit,
|
|
108
|
+
sourcePackageCommit: '9dafaaecc1e2e1e824eda9d941085f96517d827b',
|
|
109
|
+
deployerArtifactPath: 'src/briefcase/deployers/v4-periphery/StateViewDeployer.sol',
|
|
110
|
+
sourceContractPath: 'src/pkgs/v4-periphery/src/lens/StateView.sol',
|
|
111
|
+
deploymentTransaction: '0xc98e1282cf14d5e63f1f8040403d476b92a5dca03bc838ba0b28bf9cfd42bd2f',
|
|
112
|
+
generatedInitcodeHash: '0xd1a3b7780b831fbddf3407643b70cd7fc1af1140b0e41ad5f10ff74aac004a82',
|
|
113
|
+
deploymentManifestInputHash: '0x0e2e13349f8e16c9ea97b0167f2747efd891690c087723e0a920356d274593d3',
|
|
114
|
+
proxy: false,
|
|
115
|
+
},
|
|
116
|
+
positionManager: {
|
|
117
|
+
repository: uniswapContractsRepository,
|
|
118
|
+
sourceCommit: arcV4SourceCommit,
|
|
119
|
+
sourcePackageCommit: '9dafaaecc1e2e1e824eda9d941085f96517d827b',
|
|
120
|
+
deployerArtifactPath: 'src/briefcase/deployers/v4-periphery/PositionManagerDeployer.sol',
|
|
121
|
+
sourceContractPath: 'src/pkgs/v4-periphery/src/PositionManager.sol',
|
|
122
|
+
deploymentTransaction: '0xf3abd73072ecc78cbaa6b23de7c2fb56e69edce1dddefa069155198295b2abd2',
|
|
123
|
+
generatedInitcodeHash: '0x991742c2de2496144a6f8dce18252393a7d50116b8a3ab320100061d8b6dcca6',
|
|
124
|
+
deploymentManifestInputHash: '0xb86b0eed6fd57117c2096f57f07f3e2b4644f2c379e1604cab08790aaa9c40bd',
|
|
125
|
+
proxy: false,
|
|
126
|
+
},
|
|
127
|
+
quoter: {
|
|
128
|
+
repository: uniswapContractsRepository,
|
|
129
|
+
sourceCommit: arcV4SourceCommit,
|
|
130
|
+
sourcePackageCommit: '9dafaaecc1e2e1e824eda9d941085f96517d827b',
|
|
131
|
+
deployerArtifactPath: 'src/briefcase/deployers/v4-periphery/V4QuoterDeployer.sol',
|
|
132
|
+
sourceContractPath: 'src/pkgs/v4-periphery/src/lens/V4Quoter.sol',
|
|
133
|
+
deploymentTransaction: '0xb8d7a967c1be562fc9de8f5284a110e631f0fea17eef552852fec6ef67e4844a',
|
|
134
|
+
generatedInitcodeHash: '0xd915642b6f3b5375c0096fd70eb15cc0676651fa7d588accd1c6002936bb19c2',
|
|
135
|
+
deploymentManifestInputHash: '0xdb731ce141d9e731a17e60e47d1c0582c9c8684bf76430794d47d1d71fac6260',
|
|
136
|
+
proxy: false,
|
|
137
|
+
},
|
|
138
|
+
universalRouter: {
|
|
139
|
+
repository: uniswapContractsRepository,
|
|
140
|
+
sourceCommit: arcUniversalRouterSourceCommit,
|
|
141
|
+
sourcePackageCommit: '999d561c3ad58fb5cab91b602911f3c75591a9c7',
|
|
142
|
+
deployerArtifactPath: 'src/briefcase/deployers/universal-router/UniversalRouterDeployer.sol',
|
|
143
|
+
sourceContractPath: 'src/pkgs/universal-router/contracts/UniversalRouter.sol',
|
|
144
|
+
deploymentTransaction: '0xf07bb4c6eaccb5b7e128625b0c4fc6bc79f727f9b647a6e81a886bde905345b8',
|
|
145
|
+
generatedInitcodeHash: '0x8f564cfb262952d7d24e1750426672ccf3a72ca9268e2ec6d97cf846eaae179c',
|
|
146
|
+
deploymentManifestInputHash: '0xe388b0b5ed9c81077f8fcd9a1724fb35b2c5792380dddd3a19fd02f5bc037f77',
|
|
147
|
+
proxy: false,
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
positionManagerWiring: {
|
|
151
|
+
wrappedNative: getAddress('0x8bcEaA40B9AcdfAedF85AdF4FF01F5Ad6517937f'),
|
|
152
|
+
tokenDescriptor: getAddress('0x516b8a945700D6bBfDeDaa6dcFc4586bA60B8707'),
|
|
153
|
+
unsubscribeGasLimit: 300000n,
|
|
154
|
+
},
|
|
155
|
+
limitations: [
|
|
156
|
+
'The retained upstream generated initcode and pinned Arc runtime are verified separately because constructor immutables change deployed runtime bytes; this is not a fresh source compilation.',
|
|
157
|
+
'The canonical Permit2 predeploy has an exact runtime pin but is not claimed as an Arc deployment produced by the retained Uniswap/contracts manifest.',
|
|
158
|
+
'Argus Portal, hook, locker, splitter, tracker, fee, custody, and locked-principal semantics are not established by this shared deployment.',
|
|
159
|
+
'The retained v4 Quoter is official infrastructure; hook-aware Argus execution must simulate the exact router call and sender rather than assuming Quoter equivalence.',
|
|
160
|
+
],
|
|
161
|
+
});
|
|
55
162
|
export function getRobinhoodUniswapV3Deployment(chainId) {
|
|
56
163
|
if (chainId === robinhoodUniswapV3Mainnet.chainId)
|
|
57
164
|
return robinhoodUniswapV3Mainnet;
|
|
@@ -59,6 +166,11 @@ export function getRobinhoodUniswapV3Deployment(chainId) {
|
|
|
59
166
|
return robinhoodUniswapV3Testnet;
|
|
60
167
|
throw new UniswapSdkError('CHAIN_MISMATCH', `Unsupported Robinhood Uniswap v3 chain ID ${chainId}`);
|
|
61
168
|
}
|
|
169
|
+
export function getArcUniswapV4Deployment(chainId) {
|
|
170
|
+
if (chainId === arcUniswapV4Mainnet.chainId)
|
|
171
|
+
return arcUniswapV4Mainnet;
|
|
172
|
+
throw new UniswapSdkError('CHAIN_MISMATCH', `Unsupported Arc Uniswap v4 chain ID ${chainId}`);
|
|
173
|
+
}
|
|
62
174
|
function deepFreeze(value) {
|
|
63
175
|
if (value !== null && typeof value === 'object' && !Object.isFrozen(value)) {
|
|
64
176
|
for (const child of Object.values(value))
|
package/dist/deployments.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployments.js","sourceRoot":"","sources":["../src/deployments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA0B,MAAM,MAAM,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA4B9C,MAAM,UAAU,GAAG,UAAU,CAAC,4CAA4C,CAAC,CAAC;AAE5E,MAAM,CAAC,MAAM,yBAAyB,GAAwB,UAAU,CAAC;IACvE,EAAE,EAAE,sBAAsB;IAC1B,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,yBAAyB;IAClC,WAAW,EAAE,eAAe;IAC5B,UAAU,EAAE,UAAU;IACtB,oBAAoB,EAAE,UAAU;IAChC,UAAU,EAAE,YAAY;IACxB,SAAS,EAAE;QACT,OAAO,EAAE,UAAU,CAAC,4CAA4C,CAAC;QACjE,0BAA0B,EAAE,UAAU,CAAC,4CAA4C,CAAC;QACpF,QAAQ,EAAE,UAAU,CAAC,4CAA4C,CAAC;QAClE,YAAY,EAAE,UAAU,CAAC,4CAA4C,CAAC;QACtE,aAAa,EAAE,UAAU,CAAC,4CAA4C,CAAC;QACvE,UAAU;KACX;IACD,iBAAiB,EAAE;QACjB,OAAO,E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AAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3E,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,KAAgC,CAAC;YAAE,UAAU,CAAC,KAAK,CAAC,CAAC;QACvF,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { getAddress, type Address, type Hex } from 'viem';\nimport { V3_ABI_REVISION } from './v3-abis.js';\nimport { UniswapSdkError } from './errors.js';\n\nexport type RobinhoodUniswapV3DeploymentId = 'robinhood-mainnet-v3' | 'robinhood-testnet-v3';\n\nexport interface UniswapV3Contracts {\n factory: Address;\n nonfungiblePositionManager: Address;\n quoterV2: Address;\n swapRouter02: Address;\n wrappedNative: Address;\n multicall3: Address;\n}\n\nexport type UniswapV3ContractName = keyof UniswapV3Contracts;\nexport type UniswapV3RuntimeCodeHashes = Readonly<Record<UniswapV3ContractName, Hex>>;\n\nexport interface UniswapV3Deployment {\n id: RobinhoodUniswapV3DeploymentId;\n chainId: number;\n network: 'robinhood-chain-mainnet' | 'robinhood-chain-testnet';\n abiRevision: string;\n provenance: 'official' | 'reviewed-testnet';\n explorerVerification: 'official' | 'partial';\n reviewedAt: string;\n contracts: UniswapV3Contracts;\n runtimeCodeHashes: UniswapV3RuntimeCodeHashes;\n}\n\nconst multicall3 = getAddress('0xca11bde05977b3631167028862be2a173976ca11');\n\nexport const robinhoodUniswapV3Mainnet: UniswapV3Deployment = deepFreeze({\n id: 'robinhood-mainnet-v3',\n chainId: 4_663,\n network: 'robinhood-chain-mainnet',\n abiRevision: V3_ABI_REVISION,\n provenance: 'official',\n explorerVerification: 'official',\n reviewedAt: '2026-09-11',\n contracts: {\n factory: getAddress('0x1f7d7550B1b028f7571E69A784071F0205FD2EfA'),\n nonfungiblePositionManager: getAddress('0x73991a25C818Bf1f1128dEAaB1492D45638DE0D3'),\n quoterV2: getAddress('0x33e885ed0ec9bf04ecfb19341582aadcb4c8a9e7'),\n swapRouter02: getAddress('0xcaf681a66d020601342297493863e78c959e5cb2'),\n wrappedNative: getAddress('0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73'),\n multicall3,\n },\n runtimeCodeHashes: {\n factory: '0xec72b1abd1f2faee020cfea9c646bd8994f9fb389054f6e574f103a895091739',\n nonfungiblePositionManager: '0x0a493d1af3d0f25fed8efa205244ebee14114267a08647fc38c515c7cd6ead4f',\n quoterV2: '0x3db0868d945e9304c9bc6a8b2181948109ea617647142f3c4083e14393496a28',\n swapRouter02: '0x6f36c378e272c6324c48f045182bcb54bd8ad654cf9ebd42e8893d52c4cb25dc',\n wrappedNative: '0x5706be52f64875fee65a2cec0d80e47a23d8793cbe85d214b48445e2d05f5353',\n multicall3: '0xd5c15df687b16f2ff992fc8d767b4216323184a2bbc6ee2f9c398c318e770891',\n },\n});\n\nexport const robinhoodUniswapV3Testnet: UniswapV3Deployment = deepFreeze({\n id: 'robinhood-testnet-v3',\n chainId: 46_630,\n network: 'robinhood-chain-testnet',\n abiRevision: V3_ABI_REVISION,\n provenance: 'reviewed-testnet',\n explorerVerification: 'partial',\n reviewedAt: '2026-09-11',\n contracts: {\n factory: getAddress('0xdf9e3D6ffaC4513dD7b053212bbECcbCD15ec932'),\n nonfungiblePositionManager: getAddress('0xFFe6CFc4f759b65f9B62c9D05A9E21a78cE93e12'),\n quoterV2: getAddress('0xDDcBe4989C8171F721c5e683C9C6339B59718213'),\n swapRouter02: getAddress('0xb79cB26e90EBBD9bC02c75267c9a86dBa1AFedB7'),\n wrappedNative: getAddress('0x7943e237c7F95DA44E0301572D358911207852Fa'),\n multicall3,\n },\n runtimeCodeHashes: {\n factory: '0x75c5bbc7989daa85188d9e4c9f989271d8bcb2abad3d47e6e47d3c0c5bff02c2',\n nonfungiblePositionManager: '0xe40cd590528ac8b67b428579035fe391e502c38271623777692c50834688e9d5',\n quoterV2: '0x724c4956e1c61fd13285a92685337df60254bc67f775e7268da2fc5cc79d5343',\n swapRouter02: '0xdce781dc17d5f98e3ea0b72d88639a5995ccbba6e11bc01f2057a9409dc8c724',\n wrappedNative: '0x5706be52f64875fee65a2cec0d80e47a23d8793cbe85d214b48445e2d05f5353',\n multicall3: '0xd5c15df687b16f2ff992fc8d767b4216323184a2bbc6ee2f9c398c318e770891',\n },\n});\n\nexport function getRobinhoodUniswapV3Deployment(chainId: number): UniswapV3Deployment {\n if (chainId === robinhoodUniswapV3Mainnet.chainId) return robinhoodUniswapV3Mainnet;\n if (chainId === robinhoodUniswapV3Testnet.chainId) return robinhoodUniswapV3Testnet;\n throw new UniswapSdkError('CHAIN_MISMATCH', `Unsupported Robinhood Uniswap v3 chain ID ${chainId}`);\n}\n\nfunction deepFreeze<T>(value: T): T {\n if (value !== null && typeof value === 'object' && !Object.isFrozen(value)) {\n for (const child of Object.values(value as Record<string, unknown>)) deepFreeze(child);\n Object.freeze(value);\n }\n return value;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"deployments.js","sourceRoot":"","sources":["../src/deployments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA0B,MAAM,MAAM,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAyE9C,MAAM,UAAU,GAAG,UAAU,CAAC,4CAA4C,CAAC,CAAC;AAE5E,MAAM,CAAC,MAAM,yBAAyB,GAAwB,UAAU,CAAC;IACvE,EAAE,EAAE,sBAAsB;IAC1B,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,yBAAyB;IAClC,WAAW,EAAE,eAAe;IAC5B,UAAU,EAAE,UAAU;IACtB,oBAAoB,EAAE,UAAU;IAChC,UAAU,EAAE,YAAY;IACxB,SAAS,EAAE;QACT,OAAO,EAAE,UAAU,CAAC,4CAA4C,CAAC;QACjE,0BAA0B,EAAE,UAAU,CAAC,4CAA4C,CAAC;QACpF,QA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,MAAM,UAAU,+BAA+B,CAAC,OAAe;IAC7D,IAAI,OAAO,KAAK,yBAAyB,CAAC,OAAO;QAAE,OAAO,yBAAyB,CAAC;IACpF,IAAI,OAAO,KAAK,yBAAyB,CAAC,OAAO;QAAE,OAAO,yBAAyB,CAAC;IACpF,MAAM,IAAI,eAAe,CAAC,gBAAgB,EAAE,6CAA6C,OAAO,EAAE,CAAC,CAAC;AACtG,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,OAAe;IACvD,IAAI,OAAO,KAAK,mBAAmB,CAAC,OAAO;QAAE,OAAO,mBAAmB,CAAC;IACxE,MAAM,IAAI,eAAe,CAAC,gBAAgB,EAAE,uCAAuC,OAAO,EAAE,CAAC,CAAC;AAChG,CAAC;AAED,SAAS,UAAU,CAAI,KAAQ;IAC7B,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3E,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,KAAgC,CAAC;YAAE,UAAU,CAAC,KAAK,CAAC,CAAC;QACvF,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { getAddress, type Address, type Hex } from 'viem';\nimport { V3_ABI_REVISION } from './v3-abis.js';\nimport { UniswapSdkError } from './errors.js';\nimport type { V4Deployment } from './pool.js';\n\nexport type RobinhoodUniswapV3DeploymentId = 'robinhood-mainnet-v3' | 'robinhood-testnet-v3';\n\nexport interface UniswapV3Contracts {\n factory: Address;\n nonfungiblePositionManager: Address;\n quoterV2: Address;\n swapRouter02: Address;\n wrappedNative: Address;\n multicall3: Address;\n}\n\nexport type UniswapV3ContractName = keyof UniswapV3Contracts;\nexport type UniswapV3RuntimeCodeHashes = Readonly<Record<UniswapV3ContractName, Hex>>;\n\nexport interface UniswapV3Deployment {\n id: RobinhoodUniswapV3DeploymentId;\n chainId: number;\n network: 'robinhood-chain-mainnet' | 'robinhood-chain-testnet';\n abiRevision: string;\n provenance: 'official' | 'reviewed-testnet';\n explorerVerification: 'official' | 'partial';\n reviewedAt: string;\n contracts: UniswapV3Contracts;\n runtimeCodeHashes: UniswapV3RuntimeCodeHashes;\n}\n\nexport type ArcUniswapV4DeploymentId = 'arc-mainnet-v4';\n\nexport interface ArcUniswapV4Contracts {\n poolManager: Address;\n stateView: Address;\n positionManager: Address;\n quoter: Address;\n universalRouter: Address;\n permit2: Address;\n}\n\nexport type ArcUniswapV4ContractName = keyof ArcUniswapV4Contracts;\nexport type ArcUniswapV4RuntimeCodeHashes = Readonly<Record<ArcUniswapV4ContractName, Hex>>;\nexport type ArcUniswapV4ArtifactBackedContractName = Exclude<ArcUniswapV4ContractName, 'permit2'>;\n\nexport interface ArcUniswapV4RetainedArtifact {\n repository: 'https://github.com/Uniswap/contracts';\n sourceCommit: string;\n sourcePackageCommit: string;\n deployerArtifactPath: string;\n sourceContractPath: string;\n deploymentTransaction: Hex;\n generatedInitcodeHash: Hex;\n deploymentManifestInputHash: Hex;\n proxy: false;\n}\n\nexport interface ArcUniswapV4Deployment extends V4Deployment {\n id: ArcUniswapV4DeploymentId;\n chainId: 5_042;\n network: 'arc-mainnet';\n reviewedAt: string;\n referenceBlock: Readonly<{ number: bigint; hash: Hex }>;\n contracts: Readonly<ArcUniswapV4Contracts>;\n runtimeCodeHashes: ArcUniswapV4RuntimeCodeHashes;\n retainedArtifacts: Readonly<Record<ArcUniswapV4ArtifactBackedContractName, ArcUniswapV4RetainedArtifact>>;\n positionManagerWiring: Readonly<{\n wrappedNative: Address;\n tokenDescriptor: Address;\n unsubscribeGasLimit: bigint;\n }>;\n limitations: readonly string[];\n}\n\nconst multicall3 = getAddress('0xca11bde05977b3631167028862be2a173976ca11');\n\nexport const robinhoodUniswapV3Mainnet: UniswapV3Deployment = deepFreeze({\n id: 'robinhood-mainnet-v3',\n chainId: 4_663,\n network: 'robinhood-chain-mainnet',\n abiRevision: V3_ABI_REVISION,\n provenance: 'official',\n explorerVerification: 'official',\n reviewedAt: '2026-09-11',\n contracts: {\n factory: getAddress('0x1f7d7550B1b028f7571E69A784071F0205FD2EfA'),\n nonfungiblePositionManager: getAddress('0x73991a25C818Bf1f1128dEAaB1492D45638DE0D3'),\n quoterV2: getAddress('0x33e885ed0ec9bf04ecfb19341582aadcb4c8a9e7'),\n swapRouter02: getAddress('0xcaf681a66d020601342297493863e78c959e5cb2'),\n wrappedNative: getAddress('0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73'),\n multicall3,\n },\n runtimeCodeHashes: {\n factory: '0xec72b1abd1f2faee020cfea9c646bd8994f9fb389054f6e574f103a895091739',\n nonfungiblePositionManager: '0x0a493d1af3d0f25fed8efa205244ebee14114267a08647fc38c515c7cd6ead4f',\n quoterV2: '0x3db0868d945e9304c9bc6a8b2181948109ea617647142f3c4083e14393496a28',\n swapRouter02: '0x6f36c378e272c6324c48f045182bcb54bd8ad654cf9ebd42e8893d52c4cb25dc',\n wrappedNative: '0x5706be52f64875fee65a2cec0d80e47a23d8793cbe85d214b48445e2d05f5353',\n multicall3: '0xd5c15df687b16f2ff992fc8d767b4216323184a2bbc6ee2f9c398c318e770891',\n },\n});\n\nexport const robinhoodUniswapV3Testnet: UniswapV3Deployment = deepFreeze({\n id: 'robinhood-testnet-v3',\n chainId: 46_630,\n network: 'robinhood-chain-testnet',\n abiRevision: V3_ABI_REVISION,\n provenance: 'reviewed-testnet',\n explorerVerification: 'partial',\n reviewedAt: '2026-09-11',\n contracts: {\n factory: getAddress('0xdf9e3D6ffaC4513dD7b053212bbECcbCD15ec932'),\n nonfungiblePositionManager: getAddress('0xFFe6CFc4f759b65f9B62c9D05A9E21a78cE93e12'),\n quoterV2: getAddress('0xDDcBe4989C8171F721c5e683C9C6339B59718213'),\n swapRouter02: getAddress('0xb79cB26e90EBBD9bC02c75267c9a86dBa1AFedB7'),\n wrappedNative: getAddress('0x7943e237c7F95DA44E0301572D358911207852Fa'),\n multicall3,\n },\n runtimeCodeHashes: {\n factory: '0x75c5bbc7989daa85188d9e4c9f989271d8bcb2abad3d47e6e47d3c0c5bff02c2',\n nonfungiblePositionManager: '0xe40cd590528ac8b67b428579035fe391e502c38271623777692c50834688e9d5',\n quoterV2: '0x724c4956e1c61fd13285a92685337df60254bc67f775e7268da2fc5cc79d5343',\n swapRouter02: '0xdce781dc17d5f98e3ea0b72d88639a5995ccbba6e11bc01f2057a9409dc8c724',\n wrappedNative: '0x5706be52f64875fee65a2cec0d80e47a23d8793cbe85d214b48445e2d05f5353',\n multicall3: '0xd5c15df687b16f2ff992fc8d767b4216323184a2bbc6ee2f9c398c318e770891',\n },\n});\n\nconst uniswapContractsRepository = 'https://github.com/Uniswap/contracts' as const;\nconst arcV4SourceCommit = '534603a5bc10d41d57a1c9c34417d472f0dbc0d3';\nconst arcUniversalRouterSourceCommit = '02fd1760fa7c05096833c03e01a4143f963c350e';\nconst arcV4Contracts: ArcUniswapV4Contracts = {\n poolManager: getAddress('0x8366a39CC670B4001A1121B8F6A443A643e40951'),\n stateView: getAddress('0xF3334192D15450CdD385c8B70e03f9A6bD9E673b'),\n positionManager: getAddress('0x6049c9a0e26405C0985f9E3685C87d0aE917f82B'),\n quoter: getAddress('0x8dc178efb8111bb0973dd9d722ebeff267c98f94'),\n universalRouter: getAddress('0x4fcA4a51Ab4F23A7447b3284fBd7D73289A89Fb1'),\n permit2: getAddress('0x000000000022D473030F116dDEE9F6B43aC78BA3'),\n};\n\n/**\n * Official Uniswap v4 infrastructure used by the reviewed Argus Arc flow.\n *\n * This proves only the shared Uniswap contracts. Argus Portal, hook, locker,\n * splitter, and tracker compatibility remains the launcher adapter's gate.\n */\nexport const arcUniswapV4Mainnet: ArcUniswapV4Deployment = deepFreeze({\n id: 'arc-mainnet-v4',\n chainId: 5_042,\n network: 'arc-mainnet',\n poolManager: arcV4Contracts.poolManager,\n stateView: arcV4Contracts.stateView,\n quoter: arcV4Contracts.quoter,\n reviewedAt: '2026-09-27',\n referenceBlock: {\n number: 20_889_496n,\n hash: '0xf3fd31df5afb9d37a216dda53ac751a6a6c08a9c7e96ce4c07fb0df18d40810b',\n },\n contracts: arcV4Contracts,\n runtimeCodeHashes: {\n poolManager: '0xbd3881180b547f5fe817545743cfb4343e96b1bc6640dcd70c106b0066e95626',\n stateView: '0x7d9c591e0956fd89d98feb4ffcfe8bf1f7a62bd485edd979fa21d104b49878a6',\n positionManager: '0x5904204586f0290499c357cfcb99489cdc13740b3cd3f26c735f7ef7f2cff1c5',\n quoter: '0xd707b1da8cb165e5ea35a3b4450d971eb562ec171e23492aa117036b78a868f6',\n universalRouter: '0x7f949fe75d3483670e17a9ab398a3dc71f285026bba755b48fffd1e42aefad71',\n permit2: '0x05a793d6bdba8b8715c8f4cef0725ec3a961f567d33ebb2d360f541f19f70c8f',\n },\n retainedArtifacts: {\n poolManager: {\n repository: uniswapContractsRepository,\n sourceCommit: arcV4SourceCommit,\n sourcePackageCommit: '46c6834698c48bc4a463a86d8420f4eb1d7f3b75',\n deployerArtifactPath: 'src/briefcase/deployers/v4-core/PoolManagerDeployer.sol',\n sourceContractPath: 'src/pkgs/v4-core/src/PoolManager.sol',\n deploymentTransaction: '0x2a3f2686d0dfc0e8bea88ec2dd006d0cb788410a5d24a946c8d638a32868341e',\n generatedInitcodeHash: '0x1debe8d2bf707a0cea57ce3cdf7b399d61515897a5698b37050d2d5df0a95b2c',\n deploymentManifestInputHash: '0x3bdcc016bd6b2f8a19e20bdfa136abbf66ffa7904f42dafa1f5c399e9758544c',\n proxy: false,\n },\n stateView: {\n repository: uniswapContractsRepository,\n sourceCommit: arcV4SourceCommit,\n sourcePackageCommit: '9dafaaecc1e2e1e824eda9d941085f96517d827b',\n deployerArtifactPath: 'src/briefcase/deployers/v4-periphery/StateViewDeployer.sol',\n sourceContractPath: 'src/pkgs/v4-periphery/src/lens/StateView.sol',\n deploymentTransaction: '0xc98e1282cf14d5e63f1f8040403d476b92a5dca03bc838ba0b28bf9cfd42bd2f',\n generatedInitcodeHash: '0xd1a3b7780b831fbddf3407643b70cd7fc1af1140b0e41ad5f10ff74aac004a82',\n deploymentManifestInputHash: '0x0e2e13349f8e16c9ea97b0167f2747efd891690c087723e0a920356d274593d3',\n proxy: false,\n },\n positionManager: {\n repository: uniswapContractsRepository,\n sourceCommit: arcV4SourceCommit,\n sourcePackageCommit: '9dafaaecc1e2e1e824eda9d941085f96517d827b',\n deployerArtifactPath: 'src/briefcase/deployers/v4-periphery/PositionManagerDeployer.sol',\n sourceContractPath: 'src/pkgs/v4-periphery/src/PositionManager.sol',\n deploymentTransaction: '0xf3abd73072ecc78cbaa6b23de7c2fb56e69edce1dddefa069155198295b2abd2',\n generatedInitcodeHash: '0x991742c2de2496144a6f8dce18252393a7d50116b8a3ab320100061d8b6dcca6',\n deploymentManifestInputHash: '0xb86b0eed6fd57117c2096f57f07f3e2b4644f2c379e1604cab08790aaa9c40bd',\n proxy: false,\n },\n quoter: {\n repository: uniswapContractsRepository,\n sourceCommit: arcV4SourceCommit,\n sourcePackageCommit: '9dafaaecc1e2e1e824eda9d941085f96517d827b',\n deployerArtifactPath: 'src/briefcase/deployers/v4-periphery/V4QuoterDeployer.sol',\n sourceContractPath: 'src/pkgs/v4-periphery/src/lens/V4Quoter.sol',\n deploymentTransaction: '0xb8d7a967c1be562fc9de8f5284a110e631f0fea17eef552852fec6ef67e4844a',\n generatedInitcodeHash: '0xd915642b6f3b5375c0096fd70eb15cc0676651fa7d588accd1c6002936bb19c2',\n deploymentManifestInputHash: '0xdb731ce141d9e731a17e60e47d1c0582c9c8684bf76430794d47d1d71fac6260',\n proxy: false,\n },\n universalRouter: {\n repository: uniswapContractsRepository,\n sourceCommit: arcUniversalRouterSourceCommit,\n sourcePackageCommit: '999d561c3ad58fb5cab91b602911f3c75591a9c7',\n deployerArtifactPath: 'src/briefcase/deployers/universal-router/UniversalRouterDeployer.sol',\n sourceContractPath: 'src/pkgs/universal-router/contracts/UniversalRouter.sol',\n deploymentTransaction: '0xf07bb4c6eaccb5b7e128625b0c4fc6bc79f727f9b647a6e81a886bde905345b8',\n generatedInitcodeHash: '0x8f564cfb262952d7d24e1750426672ccf3a72ca9268e2ec6d97cf846eaae179c',\n deploymentManifestInputHash: '0xe388b0b5ed9c81077f8fcd9a1724fb35b2c5792380dddd3a19fd02f5bc037f77',\n proxy: false,\n },\n },\n positionManagerWiring: {\n wrappedNative: getAddress('0x8bcEaA40B9AcdfAedF85AdF4FF01F5Ad6517937f'),\n tokenDescriptor: getAddress('0x516b8a945700D6bBfDeDaa6dcFc4586bA60B8707'),\n unsubscribeGasLimit: 300_000n,\n },\n limitations: [\n 'The retained upstream generated initcode and pinned Arc runtime are verified separately because constructor immutables change deployed runtime bytes; this is not a fresh source compilation.',\n 'The canonical Permit2 predeploy has an exact runtime pin but is not claimed as an Arc deployment produced by the retained Uniswap/contracts manifest.',\n 'Argus Portal, hook, locker, splitter, tracker, fee, custody, and locked-principal semantics are not established by this shared deployment.',\n 'The retained v4 Quoter is official infrastructure; hook-aware Argus execution must simulate the exact router call and sender rather than assuming Quoter equivalence.',\n ],\n});\n\nexport function getRobinhoodUniswapV3Deployment(chainId: number): UniswapV3Deployment {\n if (chainId === robinhoodUniswapV3Mainnet.chainId) return robinhoodUniswapV3Mainnet;\n if (chainId === robinhoodUniswapV3Testnet.chainId) return robinhoodUniswapV3Testnet;\n throw new UniswapSdkError('CHAIN_MISMATCH', `Unsupported Robinhood Uniswap v3 chain ID ${chainId}`);\n}\n\nexport function getArcUniswapV4Deployment(chainId: number): ArcUniswapV4Deployment {\n if (chainId === arcUniswapV4Mainnet.chainId) return arcUniswapV4Mainnet;\n throw new UniswapSdkError('CHAIN_MISMATCH', `Unsupported Arc Uniswap v4 chain ID ${chainId}`);\n}\n\nfunction deepFreeze<T>(value: T): T {\n if (value !== null && typeof value === 'object' && !Object.isFrozen(value)) {\n for (const child of Object.values(value as Record<string, unknown>)) deepFreeze(child);\n Object.freeze(value);\n }\n return value;\n}\n"]}
|
package/dist/v4.d.ts
CHANGED
|
@@ -11,4 +11,8 @@ export { buildV4MintPositionTransaction, reviewV4MintPositionCalldata } from './
|
|
|
11
11
|
export type { V4BatchPermit, V4BatchPermitDetail, V4ExpectedMint, V4MintActionParams, V4MintPositionParams, V4PoolKeyMaterial, V4PoolState, V4TransactionMaterial } from './v4-transactions.js';
|
|
12
12
|
export { buildV4MintPermitBatchTypedData } from './permit2.js';
|
|
13
13
|
export type { V4PermitBatchDetailInput, V4PermitBatchTypedData } from './permit2.js';
|
|
14
|
+
export { arcUniswapV4Mainnet, getArcUniswapV4Deployment } from './deployments.js';
|
|
15
|
+
export type { ArcUniswapV4ArtifactBackedContractName, ArcUniswapV4ContractName, ArcUniswapV4Contracts, ArcUniswapV4Deployment, ArcUniswapV4DeploymentId, ArcUniswapV4RuntimeCodeHashes, ArcUniswapV4RetainedArtifact, } from './deployments.js';
|
|
16
|
+
export { verifyArcUniswapV4Compatibility } from './compatibility.js';
|
|
17
|
+
export type { ArcUniswapV4CompatibilityReport } from './compatibility.js';
|
|
14
18
|
//# sourceMappingURL=v4.d.ts.map
|
package/dist/v4.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v4.d.ts","sourceRoot":"","sources":["../src/v4.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC9E,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,YAAY,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACnG,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACpH,OAAO,EAAE,gBAAgB,EAAE,WAAW,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,YAAY,CAAC;AAClF,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,8BAA8B,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpG,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,cAAc,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAChM,OAAO,EAAE,+BAA+B,EAAE,MAAM,cAAc,CAAC;AAC/D,YAAY,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAClF,YAAY,EACV,sCAAsC,EACtC,wBAAwB,EACxB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,6BAA6B,EAC7B,4BAA4B,GAC7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AACrE,YAAY,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/v4.js
CHANGED
|
@@ -5,4 +5,6 @@ export { decodeV4PoolInitialization } from './events.js';
|
|
|
5
5
|
export { decodeV4HookPermissions, unmodelledV4HookPermissions } from './hooks.js';
|
|
6
6
|
export { buildV4MintPositionTransaction, reviewV4MintPositionCalldata } from './v4-transactions.js';
|
|
7
7
|
export { buildV4MintPermitBatchTypedData } from './permit2.js';
|
|
8
|
+
export { arcUniswapV4Mainnet, getArcUniswapV4Deployment } from './deployments.js';
|
|
9
|
+
export { verifyArcUniswapV4Compatibility } from './compatibility.js';
|
|
8
10
|
//# sourceMappingURL=v4.js.map
|
package/dist/v4.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v4.js","sourceRoot":"","sources":["../src/v4.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,YAAY,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAEnG,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAElF,OAAO,EAAE,8BAA8B,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAEpG,OAAO,EAAE,+BAA+B,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { poolKeyFromCurrencies, getV4PoolId, poolReference } from './pool.js';\nexport type { V4Deployment, V4PoolKey, V4PoolReference } from './pool.js';\nexport { readV4Pool, quoteV4ExactInput, quoteV4Batch, verifyV4DeploymentWiring } from './reads.js';\nexport type { V4ReadClient, V4Observation, V4PoolSnapshot, V4QuoteInput, V4Quote, V4QuoteResult } from './reads.js';\nexport { readV4TickWindow, ticksInWord } from './depth.js';\nexport type { V4Tick, V4TickWindow } from './depth.js';\nexport { decodeV4PoolInitialization } from './events.js';\nexport { decodeV4HookPermissions, unmodelledV4HookPermissions } from './hooks.js';\nexport type { V4HookPermissions } from './hooks.js';\nexport { buildV4MintPositionTransaction, reviewV4MintPositionCalldata } from './v4-transactions.js';\nexport type { V4BatchPermit, V4BatchPermitDetail, V4ExpectedMint, V4MintActionParams, V4MintPositionParams, V4PoolKeyMaterial, V4PoolState, V4TransactionMaterial } from './v4-transactions.js';\nexport { buildV4MintPermitBatchTypedData } from './permit2.js';\nexport type { V4PermitBatchDetailInput, V4PermitBatchTypedData } from './permit2.js';\n"]}
|
|
1
|
+
{"version":3,"file":"v4.js","sourceRoot":"","sources":["../src/v4.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,YAAY,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAEnG,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAElF,OAAO,EAAE,8BAA8B,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAEpG,OAAO,EAAE,+BAA+B,EAAE,MAAM,cAAc,CAAC;AAE/D,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAUlF,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["export { poolKeyFromCurrencies, getV4PoolId, poolReference } from './pool.js';\nexport type { V4Deployment, V4PoolKey, V4PoolReference } from './pool.js';\nexport { readV4Pool, quoteV4ExactInput, quoteV4Batch, verifyV4DeploymentWiring } from './reads.js';\nexport type { V4ReadClient, V4Observation, V4PoolSnapshot, V4QuoteInput, V4Quote, V4QuoteResult } from './reads.js';\nexport { readV4TickWindow, ticksInWord } from './depth.js';\nexport type { V4Tick, V4TickWindow } from './depth.js';\nexport { decodeV4PoolInitialization } from './events.js';\nexport { decodeV4HookPermissions, unmodelledV4HookPermissions } from './hooks.js';\nexport type { V4HookPermissions } from './hooks.js';\nexport { buildV4MintPositionTransaction, reviewV4MintPositionCalldata } from './v4-transactions.js';\nexport type { V4BatchPermit, V4BatchPermitDetail, V4ExpectedMint, V4MintActionParams, V4MintPositionParams, V4PoolKeyMaterial, V4PoolState, V4TransactionMaterial } from './v4-transactions.js';\nexport { buildV4MintPermitBatchTypedData } from './permit2.js';\nexport type { V4PermitBatchDetailInput, V4PermitBatchTypedData } from './permit2.js';\nexport { arcUniswapV4Mainnet, getArcUniswapV4Deployment } from './deployments.js';\nexport type {\n ArcUniswapV4ArtifactBackedContractName,\n ArcUniswapV4ContractName,\n ArcUniswapV4Contracts,\n ArcUniswapV4Deployment,\n ArcUniswapV4DeploymentId,\n ArcUniswapV4RuntimeCodeHashes,\n ArcUniswapV4RetainedArtifact,\n} from './deployments.js';\nexport { verifyArcUniswapV4Compatibility } from './compatibility.js';\nexport type { ArcUniswapV4CompatibilityReport } from './compatibility.js';\n"]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Arc Uniswap v4 provenance
|
|
2
|
+
|
|
3
|
+
`arcUniswapV4Mainnet` records the shared Uniswap v4 infrastructure used by the reviewed
|
|
4
|
+
Argus Arc integration at block `20,889,496` (`0xf3fd31df…d40810b`). The compatibility
|
|
5
|
+
check fails closed on chain ID, canonical block hash, exact runtime bytecode, PoolManager
|
|
6
|
+
pointers, Permit2, wrapped-native placeholder, token descriptor, and unsubscribe gas limit.
|
|
7
|
+
|
|
8
|
+
The provenance record retains the official `Uniswap/contracts` deployment manifest, its
|
|
9
|
+
SHA-256, each deployment transaction, the generated deployer artifact, referenced source
|
|
10
|
+
contract and package commit, generated creation-code hash, and pinned runtime hash. The
|
|
11
|
+
five artifact-backed contracts are PoolManager, StateView, PositionManager, V4Quoter, and
|
|
12
|
+
Universal Router. Permit2 is retained as a canonical-predeploy runtime pin only.
|
|
13
|
+
|
|
14
|
+
This evidence reproduces retained upstream generated artifacts; it does not freshly compile
|
|
15
|
+
the referenced Solidity sources. The source paths and package gitlinks establish which source
|
|
16
|
+
Uniswap associated with each generated artifact, not independent compiler reproducibility.
|
|
17
|
+
|
|
18
|
+
## Reproduce the source/runtime match
|
|
19
|
+
|
|
20
|
+
Check out `Uniswap/contracts` twice because Arc's Universal Router was retained from an
|
|
21
|
+
earlier source commit:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
git clone https://github.com/Uniswap/contracts.git /tmp/uniswap-contracts
|
|
25
|
+
git -C /tmp/uniswap-contracts worktree add /tmp/uniswap-contracts-manifest 047d585853f89726c0fdef46bbf633bab8fc9051
|
|
26
|
+
git -C /tmp/uniswap-contracts worktree add /tmp/uniswap-contracts-v4 534603a5bc10d41d57a1c9c34417d472f0dbc0d3
|
|
27
|
+
git -C /tmp/uniswap-contracts worktree add /tmp/uniswap-contracts-router 02fd1760fa7c05096833c03e01a4143f963c350e
|
|
28
|
+
anvil --chain-id 5042 --hardfork cancun --port 8545
|
|
29
|
+
node scripts/verify-v4-retained-artifacts.mjs \
|
|
30
|
+
--deployment-manifest /tmp/uniswap-contracts-manifest \
|
|
31
|
+
--uniswap-contracts /tmp/uniswap-contracts-v4 \
|
|
32
|
+
--universal-router-contracts /tmp/uniswap-contracts-router \
|
|
33
|
+
--anvil-rpc http://127.0.0.1:8545
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The script verifies the exact manifest commit and SHA-256, matches each address, deployment
|
|
37
|
+
transaction, manifest input hash, and proxy flag, then hashes the retained generated initcode
|
|
38
|
+
plus reviewed constructor arguments.
|
|
39
|
+
With `--anvil-rpc`, it then deploys that material using an impersonated local account—no
|
|
40
|
+
private key—and requires the resulting runtime to equal the Arc runtime hash. Solidity
|
|
41
|
+
embeds `address(this)` in these runtimes. PositionManager and Universal Router also cache
|
|
42
|
+
EIP-712 domain separators derived from that address. The verifier explicitly recomputes
|
|
43
|
+
those values for the Arc deployment address and requires reviewed occurrence counts before
|
|
44
|
+
replacement; it does not mask arbitrary byte ranges.
|
|
45
|
+
|
|
46
|
+
Run `npm run test:live-compatibility` for the independent read-only Arc RPC check. The raw
|
|
47
|
+
record is exported at `@reptilianhq/uniswap-sdk/provenance/arc-mainnet-v4.json`.
|
|
48
|
+
|
|
49
|
+
## Launcher boundary
|
|
50
|
+
|
|
51
|
+
This evidence deliberately stops at shared Uniswap infrastructure. The public
|
|
52
|
+
`arguspad/argus-world` source at `c8c3d5fc2b0a4557a535bb4f7e7a3be9301c289e` contains
|
|
53
|
+
explicitly reduced interfaces and simplified logic, with no pinned compiler build capable
|
|
54
|
+
of reproducing deployed Argus bytecode. It is reference documentation, not deployment
|
|
55
|
+
provenance.
|
|
56
|
+
|
|
57
|
+
Argus Portal, hook, locker, splitter, tracker, fee collection, creator/reward payouts,
|
|
58
|
+
custody, and permanently locked launch-principal semantics remain launcher-adapter gates.
|
|
59
|
+
Their pinned-fork lifecycle belongs in the Argus SDK's capital-moving workflow, where the
|
|
60
|
+
exact router call, sender, approvals, hook data, fee configuration, claims, and
|
|
61
|
+
non-withdrawable principal can be tested together. Do not duplicate that proof in this
|
|
62
|
+
generic SDK or infer it from a successful Quoter call.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reptilianhq/uniswap-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Deployment-explicit Uniswap observations and reviewed transaction material.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
"provenance",
|
|
14
14
|
"scripts/check-conformance.mjs",
|
|
15
15
|
"scripts/verify-v3-deployments.mjs",
|
|
16
|
+
"scripts/verify-v4-deployments.mjs",
|
|
17
|
+
"scripts/verify-v4-retained-artifacts.mjs",
|
|
16
18
|
"README.md",
|
|
17
19
|
"RELEASING.md",
|
|
18
20
|
"NOTICE",
|
|
@@ -73,7 +75,8 @@
|
|
|
73
75
|
"import": "./dist/permit2.js"
|
|
74
76
|
},
|
|
75
77
|
"./provenance/mainnet.json": "./provenance/mainnet.json",
|
|
76
|
-
"./provenance/testnet.json": "./provenance/testnet.json"
|
|
78
|
+
"./provenance/testnet.json": "./provenance/testnet.json",
|
|
79
|
+
"./provenance/arc-mainnet-v4.json": "./provenance/arc-mainnet-v4.json"
|
|
77
80
|
},
|
|
78
81
|
"scripts": {
|
|
79
82
|
"build": "tsc -p tsconfig.build.json",
|
|
@@ -83,7 +86,7 @@
|
|
|
83
86
|
"test:run": "vitest run src",
|
|
84
87
|
"test:runtime": "node scripts/runtime-smoke.mjs",
|
|
85
88
|
"test:fork": "vitest run src/v3-mainnet.fork.test.ts",
|
|
86
|
-
"test:live-compatibility": "npm run build && node scripts/verify-v3-deployments.mjs",
|
|
89
|
+
"test:live-compatibility": "npm run build && node scripts/verify-v3-deployments.mjs && node scripts/verify-v4-deployments.mjs",
|
|
87
90
|
"test:consumer": "node examples/read-only-consumer.mjs",
|
|
88
91
|
"check:conformance": "node scripts/check-conformance.mjs . && node --test scripts/check-conformance.node-test.mjs",
|
|
89
92
|
"check:publisher": "node scripts/artifacts/check.mjs",
|
|
@@ -125,6 +128,6 @@
|
|
|
125
128
|
"reptilianRelease": {
|
|
126
129
|
"schemaVersion": 1,
|
|
127
130
|
"group": "uniswap-sdk",
|
|
128
|
-
"sourceSha": "
|
|
131
|
+
"sourceSha": "d080edda42054fce10727545c05464fce3f797ae"
|
|
129
132
|
}
|
|
130
133
|
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"deploymentId": "arc-mainnet-v4",
|
|
4
|
+
"chainId": 5042,
|
|
5
|
+
"network": "arc-mainnet",
|
|
6
|
+
"reviewedAt": "2026-09-27",
|
|
7
|
+
"referenceBlock": {
|
|
8
|
+
"number": "20889496",
|
|
9
|
+
"hash": "0xf3fd31df5afb9d37a216dda53ac751a6a6c08a9c7e96ce4c07fb0df18d40810b",
|
|
10
|
+
"rpc": "https://rpc.arc-scan.org"
|
|
11
|
+
},
|
|
12
|
+
"officialDeploymentManifest": {
|
|
13
|
+
"repository": "https://github.com/Uniswap/contracts",
|
|
14
|
+
"commit": "047d585853f89726c0fdef46bbf633bab8fc9051",
|
|
15
|
+
"path": "deployments/json/5042.json",
|
|
16
|
+
"sha256": "77b5e8cef3cfe81b723082b0a44918a0c33c039706c80e09dbb702b996fea301"
|
|
17
|
+
},
|
|
18
|
+
"contracts": {
|
|
19
|
+
"poolManager": {
|
|
20
|
+
"address": "0x8366a39CC670B4001A1121B8F6A443A643e40951",
|
|
21
|
+
"runtimeCodeHash": "0xbd3881180b547f5fe817545743cfb4343e96b1bc6640dcd70c106b0066e95626",
|
|
22
|
+
"runtimeCodeBytes": 24009,
|
|
23
|
+
"sourceCommit": "534603a5bc10d41d57a1c9c34417d472f0dbc0d3",
|
|
24
|
+
"sourcePackageCommit": "46c6834698c48bc4a463a86d8420f4eb1d7f3b75",
|
|
25
|
+
"deployerArtifactPath": "src/briefcase/deployers/v4-core/PoolManagerDeployer.sol",
|
|
26
|
+
"sourceContractPath": "src/pkgs/v4-core/src/PoolManager.sol",
|
|
27
|
+
"deploymentTransaction": "0x2a3f2686d0dfc0e8bea88ec2dd006d0cb788410a5d24a946c8d638a32868341e",
|
|
28
|
+
"generatedInitcodeHash": "0x1debe8d2bf707a0cea57ce3cdf7b399d61515897a5698b37050d2d5df0a95b2c",
|
|
29
|
+
"deploymentManifestInputHash": "0x3bdcc016bd6b2f8a19e20bdfa136abbf66ffa7904f42dafa1f5c399e9758544c",
|
|
30
|
+
"proxy": false
|
|
31
|
+
},
|
|
32
|
+
"stateView": {
|
|
33
|
+
"address": "0xF3334192D15450CdD385c8B70e03f9A6bD9E673b",
|
|
34
|
+
"runtimeCodeHash": "0x7d9c591e0956fd89d98feb4ffcfe8bf1f7a62bd485edd979fa21d104b49878a6",
|
|
35
|
+
"runtimeCodeBytes": 3531,
|
|
36
|
+
"sourceCommit": "534603a5bc10d41d57a1c9c34417d472f0dbc0d3",
|
|
37
|
+
"sourcePackageCommit": "9dafaaecc1e2e1e824eda9d941085f96517d827b",
|
|
38
|
+
"deployerArtifactPath": "src/briefcase/deployers/v4-periphery/StateViewDeployer.sol",
|
|
39
|
+
"sourceContractPath": "src/pkgs/v4-periphery/src/lens/StateView.sol",
|
|
40
|
+
"deploymentTransaction": "0xc98e1282cf14d5e63f1f8040403d476b92a5dca03bc838ba0b28bf9cfd42bd2f",
|
|
41
|
+
"generatedInitcodeHash": "0xd1a3b7780b831fbddf3407643b70cd7fc1af1140b0e41ad5f10ff74aac004a82",
|
|
42
|
+
"deploymentManifestInputHash": "0x0e2e13349f8e16c9ea97b0167f2747efd891690c087723e0a920356d274593d3",
|
|
43
|
+
"proxy": false
|
|
44
|
+
},
|
|
45
|
+
"positionManager": {
|
|
46
|
+
"address": "0x6049c9a0e26405C0985f9E3685C87d0aE917f82B",
|
|
47
|
+
"runtimeCodeHash": "0x5904204586f0290499c357cfcb99489cdc13740b3cd3f26c735f7ef7f2cff1c5",
|
|
48
|
+
"runtimeCodeBytes": 23877,
|
|
49
|
+
"sourceCommit": "534603a5bc10d41d57a1c9c34417d472f0dbc0d3",
|
|
50
|
+
"sourcePackageCommit": "9dafaaecc1e2e1e824eda9d941085f96517d827b",
|
|
51
|
+
"deployerArtifactPath": "src/briefcase/deployers/v4-periphery/PositionManagerDeployer.sol",
|
|
52
|
+
"sourceContractPath": "src/pkgs/v4-periphery/src/PositionManager.sol",
|
|
53
|
+
"deploymentTransaction": "0xf3abd73072ecc78cbaa6b23de7c2fb56e69edce1dddefa069155198295b2abd2",
|
|
54
|
+
"generatedInitcodeHash": "0x991742c2de2496144a6f8dce18252393a7d50116b8a3ab320100061d8b6dcca6",
|
|
55
|
+
"deploymentManifestInputHash": "0xb86b0eed6fd57117c2096f57f07f3e2b4644f2c379e1604cab08790aaa9c40bd",
|
|
56
|
+
"proxy": false
|
|
57
|
+
},
|
|
58
|
+
"quoter": {
|
|
59
|
+
"address": "0x8dc178efb8111bb0973dd9d722ebeff267c98f94",
|
|
60
|
+
"runtimeCodeHash": "0xd707b1da8cb165e5ea35a3b4450d971eb562ec171e23492aa117036b78a868f6",
|
|
61
|
+
"runtimeCodeBytes": 6118,
|
|
62
|
+
"sourceCommit": "534603a5bc10d41d57a1c9c34417d472f0dbc0d3",
|
|
63
|
+
"sourcePackageCommit": "9dafaaecc1e2e1e824eda9d941085f96517d827b",
|
|
64
|
+
"deployerArtifactPath": "src/briefcase/deployers/v4-periphery/V4QuoterDeployer.sol",
|
|
65
|
+
"sourceContractPath": "src/pkgs/v4-periphery/src/lens/V4Quoter.sol",
|
|
66
|
+
"deploymentTransaction": "0xb8d7a967c1be562fc9de8f5284a110e631f0fea17eef552852fec6ef67e4844a",
|
|
67
|
+
"generatedInitcodeHash": "0xd915642b6f3b5375c0096fd70eb15cc0676651fa7d588accd1c6002936bb19c2",
|
|
68
|
+
"deploymentManifestInputHash": "0xdb731ce141d9e731a17e60e47d1c0582c9c8684bf76430794d47d1d71fac6260",
|
|
69
|
+
"proxy": false
|
|
70
|
+
},
|
|
71
|
+
"universalRouter": {
|
|
72
|
+
"address": "0x4fcA4a51Ab4F23A7447b3284fBd7D73289A89Fb1",
|
|
73
|
+
"runtimeCodeHash": "0x7f949fe75d3483670e17a9ab398a3dc71f285026bba755b48fffd1e42aefad71",
|
|
74
|
+
"runtimeCodeBytes": 24546,
|
|
75
|
+
"sourceCommit": "02fd1760fa7c05096833c03e01a4143f963c350e",
|
|
76
|
+
"sourcePackageCommit": "999d561c3ad58fb5cab91b602911f3c75591a9c7",
|
|
77
|
+
"deployerArtifactPath": "src/briefcase/deployers/universal-router/UniversalRouterDeployer.sol",
|
|
78
|
+
"sourceContractPath": "src/pkgs/universal-router/contracts/UniversalRouter.sol",
|
|
79
|
+
"deploymentTransaction": "0xf07bb4c6eaccb5b7e128625b0c4fc6bc79f727f9b647a6e81a886bde905345b8",
|
|
80
|
+
"generatedInitcodeHash": "0x8f564cfb262952d7d24e1750426672ccf3a72ca9268e2ec6d97cf846eaae179c",
|
|
81
|
+
"deploymentManifestInputHash": "0xe388b0b5ed9c81077f8fcd9a1724fb35b2c5792380dddd3a19fd02f5bc037f77",
|
|
82
|
+
"proxy": false
|
|
83
|
+
},
|
|
84
|
+
"permit2": {
|
|
85
|
+
"address": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
|
|
86
|
+
"runtimeCodeHash": "0x05a793d6bdba8b8715c8f4cef0725ec3a961f567d33ebb2d360f541f19f70c8f",
|
|
87
|
+
"runtimeCodeBytes": 9152,
|
|
88
|
+
"assurance": "canonical-predeploy-runtime-only"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"positionManagerWiring": {
|
|
92
|
+
"poolManager": "0x8366a39CC670B4001A1121B8F6A443A643e40951",
|
|
93
|
+
"permit2": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
|
|
94
|
+
"wrappedNative": "0x8bcEaA40B9AcdfAedF85AdF4FF01F5Ad6517937f",
|
|
95
|
+
"tokenDescriptor": "0x516b8a945700D6bBfDeDaa6dcFc4586bA60B8707",
|
|
96
|
+
"unsubscribeGasLimit": "300000"
|
|
97
|
+
},
|
|
98
|
+
"argusProtocolSourceBoundary": {
|
|
99
|
+
"repository": "https://github.com/arguspad/argus-world",
|
|
100
|
+
"commit": "c8c3d5fc2b0a4557a535bb4f7e7a3be9301c289e",
|
|
101
|
+
"assurance": "documentation-and-reference-source-only",
|
|
102
|
+
"reason": "The published contracts include explicitly reduced interfaces and simplified logic and provide no pinned compiler/build configuration, so they cannot be represented as bytecode-reproducible sources for the deployed Portal, hooks, lockers, splitters, or trackers."
|
|
103
|
+
},
|
|
104
|
+
"limitations": [
|
|
105
|
+
"Retained upstream generated-initcode provenance is complete for PoolManager, StateView, PositionManager, V4Quoter, and Universal Router; runtime identity is independently pinned at the reference block. This is not a fresh compilation of the referenced Solidity source.",
|
|
106
|
+
"deploymentManifestInputHash retains the upstream manifest field named initcodeHash; Uniswap/contracts computes it from the deployment transaction input, so it is kept distinct from generatedInitcodeHash.",
|
|
107
|
+
"Permit2 is an exact runtime pin of the canonical Arc predeploy, not a deployment produced by the retained Uniswap/contracts manifest.",
|
|
108
|
+
"This record does not establish Argus launcher-contract source equivalence or hook, fee, custody, payout, or locked-principal compatibility.",
|
|
109
|
+
"The V4Quoter is retained as official infrastructure, but hook-aware Argus quotes and writes require exact-router simulation with the actual sender."
|
|
110
|
+
]
|
|
111
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { createPublicClient, http } from 'viem';
|
|
4
|
+
import { arcUniswapV4Mainnet, verifyArcUniswapV4Compatibility } from '../dist/v4.js';
|
|
5
|
+
|
|
6
|
+
const rpcUrl = process.env.UNISWAP_ARC_RPC_URL?.trim() || 'https://rpc.arc-scan.org';
|
|
7
|
+
const client = createPublicClient({ transport: http(rpcUrl) });
|
|
8
|
+
const report = await verifyArcUniswapV4Compatibility(client, arcUniswapV4Mainnet);
|
|
9
|
+
|
|
10
|
+
process.stdout.write(
|
|
11
|
+
`ok - ${arcUniswapV4Mainnet.id}: ${Object.keys(report.runtimeCodeHashes).length} runtime hashes, pinned block, and manager wiring verified\n`,
|
|
12
|
+
);
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { execFileSync } from 'node:child_process';
|
|
4
|
+
import { createHash } from 'node:crypto';
|
|
5
|
+
import { readFileSync } from 'node:fs';
|
|
6
|
+
import { resolve } from 'node:path';
|
|
7
|
+
import { concatHex, createPublicClient, encodeAbiParameters, http, keccak256, toHex } from 'viem';
|
|
8
|
+
|
|
9
|
+
const CORE_COMMIT = '534603a5bc10d41d57a1c9c34417d472f0dbc0d3';
|
|
10
|
+
const ROUTER_COMMIT = '02fd1760fa7c05096833c03e01a4143f963c350e';
|
|
11
|
+
const MANIFEST_COMMIT = '047d585853f89726c0fdef46bbf633bab8fc9051';
|
|
12
|
+
const MANIFEST_SHA256 = '77b5e8cef3cfe81b723082b0a44918a0c33c039706c80e09dbb702b996fea301';
|
|
13
|
+
|
|
14
|
+
const values = new Map();
|
|
15
|
+
for (let index = 2; index < process.argv.length; index += 2) {
|
|
16
|
+
const flag = process.argv[index];
|
|
17
|
+
const value = process.argv[index + 1];
|
|
18
|
+
if (!flag?.startsWith('--') || !value) usage();
|
|
19
|
+
values.set(flag, value);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const coreCheckout = values.get('--uniswap-contracts');
|
|
23
|
+
const routerCheckout = values.get('--universal-router-contracts') ?? coreCheckout;
|
|
24
|
+
const manifestCheckout = values.get('--deployment-manifest');
|
|
25
|
+
const anvilRpc = values.get('--anvil-rpc');
|
|
26
|
+
if (!coreCheckout || !routerCheckout || !manifestCheckout) usage();
|
|
27
|
+
|
|
28
|
+
const coreRoot = resolve(coreCheckout);
|
|
29
|
+
const routerRoot = resolve(routerCheckout);
|
|
30
|
+
const manifestRoot = resolve(manifestCheckout);
|
|
31
|
+
assertCommit(coreRoot, CORE_COMMIT);
|
|
32
|
+
assertCommit(routerRoot, ROUTER_COMMIT);
|
|
33
|
+
assertCommit(manifestRoot, MANIFEST_COMMIT);
|
|
34
|
+
const manifestPath = resolve(manifestRoot, 'deployments/json/5042.json');
|
|
35
|
+
const manifestSource = readFileSync(manifestPath, 'utf8');
|
|
36
|
+
const manifestSha256 = createHash('sha256').update(manifestSource).digest('hex');
|
|
37
|
+
if (manifestSha256 !== MANIFEST_SHA256) {
|
|
38
|
+
throw new Error(`${manifestPath} SHA-256 mismatch: expected ${MANIFEST_SHA256}, got ${manifestSha256}`);
|
|
39
|
+
}
|
|
40
|
+
const manifest = JSON.parse(manifestSource);
|
|
41
|
+
|
|
42
|
+
const poolManager = '0x8366a39CC670B4001A1121B8F6A443A643e40951';
|
|
43
|
+
const permit2 = '0x000000000022D473030F116dDEE9F6B43aC78BA3';
|
|
44
|
+
const wrappedNativeUnsupported = '0x8bcEaA40B9AcdfAedF85AdF4FF01F5Ad6517937f';
|
|
45
|
+
const positionManager = '0x6049c9a0e26405C0985f9E3685C87d0aE917f82B';
|
|
46
|
+
|
|
47
|
+
const records = [
|
|
48
|
+
{
|
|
49
|
+
name: 'poolManager', root: coreRoot,
|
|
50
|
+
manifestName: 'PoolManager',
|
|
51
|
+
address: poolManager,
|
|
52
|
+
artifact: 'src/briefcase/deployers/v4-core/PoolManagerDeployer.sol',
|
|
53
|
+
sourcePackagePath: 'src/pkgs/v4-core', sourcePackageCommit: '46c6834698c48bc4a463a86d8420f4eb1d7f3b75',
|
|
54
|
+
args: encodeAbiParameters([{ type: 'address' }], ['0x9701fb0aDe1E269c8f64Ec0C7b3cfADB31A13A52']),
|
|
55
|
+
expected: '0x1debe8d2bf707a0cea57ce3cdf7b399d61515897a5698b37050d2d5df0a95b2c',
|
|
56
|
+
deploymentTransaction: '0x2a3f2686d0dfc0e8bea88ec2dd006d0cb788410a5d24a946c8d638a32868341e',
|
|
57
|
+
deploymentManifestInputHash: '0x3bdcc016bd6b2f8a19e20bdfa136abbf66ffa7904f42dafa1f5c399e9758544c',
|
|
58
|
+
runtimeCodeHash: '0xbd3881180b547f5fe817545743cfb4343e96b1bc6640dcd70c106b0066e95626',
|
|
59
|
+
selfAddressOccurrences: 1,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'stateView', root: coreRoot,
|
|
63
|
+
manifestName: 'StateView',
|
|
64
|
+
address: '0xF3334192D15450CdD385c8B70e03f9A6bD9E673b',
|
|
65
|
+
artifact: 'src/briefcase/deployers/v4-periphery/StateViewDeployer.sol',
|
|
66
|
+
sourcePackagePath: 'src/pkgs/v4-periphery', sourcePackageCommit: '9dafaaecc1e2e1e824eda9d941085f96517d827b',
|
|
67
|
+
args: encodeAbiParameters([{ type: 'address' }], [poolManager]),
|
|
68
|
+
expected: '0xd1a3b7780b831fbddf3407643b70cd7fc1af1140b0e41ad5f10ff74aac004a82',
|
|
69
|
+
deploymentTransaction: '0xc98e1282cf14d5e63f1f8040403d476b92a5dca03bc838ba0b28bf9cfd42bd2f',
|
|
70
|
+
deploymentManifestInputHash: '0x0e2e13349f8e16c9ea97b0167f2747efd891690c087723e0a920356d274593d3',
|
|
71
|
+
runtimeCodeHash: '0x7d9c591e0956fd89d98feb4ffcfe8bf1f7a62bd485edd979fa21d104b49878a6',
|
|
72
|
+
selfAddressOccurrences: 0,
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'positionManager', root: coreRoot,
|
|
76
|
+
manifestName: 'PositionManager',
|
|
77
|
+
address: positionManager,
|
|
78
|
+
artifact: 'src/briefcase/deployers/v4-periphery/PositionManagerDeployer.sol',
|
|
79
|
+
sourcePackagePath: 'src/pkgs/v4-periphery', sourcePackageCommit: '9dafaaecc1e2e1e824eda9d941085f96517d827b',
|
|
80
|
+
args: encodeAbiParameters(
|
|
81
|
+
[{ type: 'address' }, { type: 'address' }, { type: 'uint256' }, { type: 'address' }, { type: 'address' }],
|
|
82
|
+
[poolManager, permit2, 300_000n, '0x516b8a945700D6bBfDeDaa6dcFc4586bA60B8707', wrappedNativeUnsupported],
|
|
83
|
+
),
|
|
84
|
+
expected: '0x991742c2de2496144a6f8dce18252393a7d50116b8a3ab320100061d8b6dcca6',
|
|
85
|
+
deploymentTransaction: '0xf3abd73072ecc78cbaa6b23de7c2fb56e69edce1dddefa069155198295b2abd2',
|
|
86
|
+
deploymentManifestInputHash: '0xb86b0eed6fd57117c2096f57f07f3e2b4644f2c379e1604cab08790aaa9c40bd',
|
|
87
|
+
runtimeCodeHash: '0x5904204586f0290499c357cfcb99489cdc13740b3cd3f26c735f7ef7f2cff1c5',
|
|
88
|
+
selfAddressOccurrences: 0,
|
|
89
|
+
domainSeparatorOccurrences: 1,
|
|
90
|
+
eip712DomainName: 'Uniswap v4 Positions NFT',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: 'quoter', root: coreRoot,
|
|
94
|
+
manifestName: 'V4Quoter',
|
|
95
|
+
address: '0x8dc178efb8111bb0973dd9d722ebeff267c98f94',
|
|
96
|
+
artifact: 'src/briefcase/deployers/v4-periphery/V4QuoterDeployer.sol',
|
|
97
|
+
sourcePackagePath: 'src/pkgs/v4-periphery', sourcePackageCommit: '9dafaaecc1e2e1e824eda9d941085f96517d827b',
|
|
98
|
+
args: encodeAbiParameters([{ type: 'address' }], [poolManager]),
|
|
99
|
+
expected: '0xd915642b6f3b5375c0096fd70eb15cc0676651fa7d588accd1c6002936bb19c2',
|
|
100
|
+
deploymentTransaction: '0xb8d7a967c1be562fc9de8f5284a110e631f0fea17eef552852fec6ef67e4844a',
|
|
101
|
+
deploymentManifestInputHash: '0xdb731ce141d9e731a17e60e47d1c0582c9c8684bf76430794d47d1d71fac6260',
|
|
102
|
+
runtimeCodeHash: '0xd707b1da8cb165e5ea35a3b4450d971eb562ec171e23492aa117036b78a868f6',
|
|
103
|
+
selfAddressOccurrences: 0,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: 'universalRouter', root: routerRoot,
|
|
107
|
+
manifestName: 'UniversalRouter',
|
|
108
|
+
address: '0x4fcA4a51Ab4F23A7447b3284fBd7D73289A89Fb1',
|
|
109
|
+
artifact: 'src/briefcase/deployers/universal-router/UniversalRouterDeployer.sol',
|
|
110
|
+
sourcePackagePath: 'src/pkgs/universal-router', sourcePackageCommit: '999d561c3ad58fb5cab91b602911f3c75591a9c7',
|
|
111
|
+
args: encodeAbiParameters([{
|
|
112
|
+
type: 'tuple',
|
|
113
|
+
components: [
|
|
114
|
+
{ name: 'permit2', type: 'address' },
|
|
115
|
+
{ name: 'weth9', type: 'address' },
|
|
116
|
+
{ name: 'v2Factory', type: 'address' },
|
|
117
|
+
{ name: 'v3Factory', type: 'address' },
|
|
118
|
+
{ name: 'pairInitCodeHash', type: 'bytes32' },
|
|
119
|
+
{ name: 'poolInitCodeHash', type: 'bytes32' },
|
|
120
|
+
{ name: 'v4PoolManager', type: 'address' },
|
|
121
|
+
{ name: 'v3NFTPositionManager', type: 'address' },
|
|
122
|
+
{ name: 'v4PositionManager', type: 'address' },
|
|
123
|
+
{ name: 'spokePool', type: 'address' },
|
|
124
|
+
],
|
|
125
|
+
}], [{
|
|
126
|
+
permit2,
|
|
127
|
+
weth9: wrappedNativeUnsupported,
|
|
128
|
+
v2Factory: '0x89e5DB8B5aA49aA85AC63f691524311AEB649eba',
|
|
129
|
+
v3Factory: '0xf0db7b58379503491d857dB50AC9ece64c653918',
|
|
130
|
+
pairInitCodeHash: '0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f',
|
|
131
|
+
poolInitCodeHash: '0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54',
|
|
132
|
+
v4PoolManager: poolManager,
|
|
133
|
+
v3NFTPositionManager: '0x39654A85A4C05127f5Fd6ED22CAeC077A0fB1377',
|
|
134
|
+
v4PositionManager: positionManager,
|
|
135
|
+
spokePool: wrappedNativeUnsupported,
|
|
136
|
+
}]),
|
|
137
|
+
expected: '0x8f564cfb262952d7d24e1750426672ccf3a72ca9268e2ec6d97cf846eaae179c',
|
|
138
|
+
deploymentTransaction: '0xf07bb4c6eaccb5b7e128625b0c4fc6bc79f727f9b647a6e81a886bde905345b8',
|
|
139
|
+
deploymentManifestInputHash: '0xe388b0b5ed9c81077f8fcd9a1724fb35b2c5792380dddd3a19fd02f5bc037f77',
|
|
140
|
+
runtimeCodeHash: '0x7f949fe75d3483670e17a9ab398a3dc71f285026bba755b48fffd1e42aefad71',
|
|
141
|
+
selfAddressOccurrences: 1,
|
|
142
|
+
domainSeparatorOccurrences: 1,
|
|
143
|
+
eip712DomainName: 'UniversalRouter',
|
|
144
|
+
eip712DomainVersion: '2',
|
|
145
|
+
},
|
|
146
|
+
];
|
|
147
|
+
|
|
148
|
+
let failed = false;
|
|
149
|
+
const creations = [];
|
|
150
|
+
for (const record of records) {
|
|
151
|
+
assertGitlink(record.root, record.sourcePackagePath, record.sourcePackageCommit);
|
|
152
|
+
assertManifestRecord(manifest, record);
|
|
153
|
+
const initcode = extractInitcode(resolve(record.root, record.artifact));
|
|
154
|
+
const creationCode = concatHex([initcode, record.args]);
|
|
155
|
+
const actual = keccak256(creationCode);
|
|
156
|
+
if (actual !== record.expected) {
|
|
157
|
+
process.stderr.write(`not ok - ${record.name}: expected ${record.expected}, got ${actual}\n`);
|
|
158
|
+
failed = true;
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
creations.push({ ...record, creationCode });
|
|
162
|
+
process.stdout.write(`ok - ${record.name}: ${actual}\n`);
|
|
163
|
+
}
|
|
164
|
+
if (failed) {
|
|
165
|
+
process.exitCode = 1;
|
|
166
|
+
} else if (anvilRpc) {
|
|
167
|
+
await verifyRuntimeReproduction(anvilRpc, creations);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function assertCommit(root, expected) {
|
|
171
|
+
const actual = execFileSync('git', ['rev-parse', 'HEAD'], { cwd: root, encoding: 'utf8' }).trim();
|
|
172
|
+
if (actual !== expected) throw new Error(`${root} must be checked out at ${expected}; got ${actual}`);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function assertGitlink(root, path, expected) {
|
|
176
|
+
const entry = execFileSync('git', ['ls-tree', 'HEAD', path], { cwd: root, encoding: 'utf8' }).trim();
|
|
177
|
+
const actual = entry.split(/\s+/)[2];
|
|
178
|
+
if (actual !== expected) throw new Error(`${root}:${path} must point to ${expected}; got ${actual ?? 'nothing'}`);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function extractInitcode(path) {
|
|
182
|
+
const source = readFileSync(path, 'utf8');
|
|
183
|
+
const match = source.match(/function initcode\(\)[\s\S]*?return hex'([0-9a-f]+)'/i);
|
|
184
|
+
if (!match) throw new Error(`Unable to extract generated initcode from ${path}`);
|
|
185
|
+
return `0x${match[1]}`;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function assertManifestRecord(source, record) {
|
|
189
|
+
const candidates = [source.latest, ...source.history.map(entry => entry.contracts ?? {})]
|
|
190
|
+
.map(contracts => contracts[record.manifestName])
|
|
191
|
+
.filter(Boolean);
|
|
192
|
+
const entry = candidates.find(candidate => candidate.address.toLowerCase() === record.address.toLowerCase());
|
|
193
|
+
if (!entry) throw new Error(`Manifest has no ${record.manifestName} entry for ${record.address}`);
|
|
194
|
+
const expected = {
|
|
195
|
+
deploymentTxn: record.deploymentTransaction.toLowerCase(),
|
|
196
|
+
initcodeHash: record.deploymentManifestInputHash.slice(2).toLowerCase(),
|
|
197
|
+
proxy: false,
|
|
198
|
+
};
|
|
199
|
+
for (const [field, value] of Object.entries(expected)) {
|
|
200
|
+
const actual = typeof entry[field] === 'string' ? entry[field].toLowerCase() : entry[field];
|
|
201
|
+
if (actual !== value) {
|
|
202
|
+
throw new Error(`Manifest ${record.manifestName}.${field} mismatch: expected ${value}, got ${actual}`);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
async function verifyRuntimeReproduction(rpcUrl, creationRecords) {
|
|
208
|
+
const client = createPublicClient({ transport: http(rpcUrl) });
|
|
209
|
+
const chainId = await client.getChainId();
|
|
210
|
+
if (chainId !== 5_042) throw new Error(`Anvil chain ID must be 5042; got ${chainId}`);
|
|
211
|
+
|
|
212
|
+
const account = '0x0000000000000000000000000000000000005042';
|
|
213
|
+
await client.request({ method: 'anvil_setBalance', params: [account, '0x56bc75e2d63100000'] });
|
|
214
|
+
await client.request({ method: 'anvil_impersonateAccount', params: [account] });
|
|
215
|
+
try {
|
|
216
|
+
for (const record of creationRecords) {
|
|
217
|
+
const hash = await client.request({
|
|
218
|
+
method: 'eth_sendTransaction',
|
|
219
|
+
params: [{ from: account, data: record.creationCode, gas: '0x1c9c380' }],
|
|
220
|
+
});
|
|
221
|
+
const receipt = await client.waitForTransactionReceipt({ hash });
|
|
222
|
+
if (receipt.status !== 'success' || !receipt.contractAddress) {
|
|
223
|
+
throw new Error(`${record.name} local reproduction deployment failed`);
|
|
224
|
+
}
|
|
225
|
+
const bytecode = await client.getBytecode({ address: receipt.contractAddress });
|
|
226
|
+
const normalizedBytecode = bytecode
|
|
227
|
+
? normalizeDeploymentImmutables(
|
|
228
|
+
bytecode,
|
|
229
|
+
receipt.contractAddress,
|
|
230
|
+
record.address,
|
|
231
|
+
record.eip712DomainName,
|
|
232
|
+
record.eip712DomainVersion,
|
|
233
|
+
record.selfAddressOccurrences,
|
|
234
|
+
record.domainSeparatorOccurrences ?? 0,
|
|
235
|
+
)
|
|
236
|
+
: null;
|
|
237
|
+
const actual = normalizedBytecode ? keccak256(normalizedBytecode) : null;
|
|
238
|
+
if (actual !== record.runtimeCodeHash) {
|
|
239
|
+
throw new Error(`${record.name} runtime hash mismatch: expected ${record.runtimeCodeHash}, got ${actual}`);
|
|
240
|
+
}
|
|
241
|
+
process.stdout.write(`ok - ${record.name} runtime: ${actual}\n`);
|
|
242
|
+
}
|
|
243
|
+
} finally {
|
|
244
|
+
await client.request({ method: 'anvil_stopImpersonatingAccount', params: [account] });
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
function normalizeDeploymentImmutables(
|
|
249
|
+
bytecode,
|
|
250
|
+
localAddress,
|
|
251
|
+
deployedAddress,
|
|
252
|
+
eip712DomainName,
|
|
253
|
+
eip712DomainVersion,
|
|
254
|
+
expectedSelfAddressOccurrences,
|
|
255
|
+
expectedDomainSeparatorOccurrences,
|
|
256
|
+
) {
|
|
257
|
+
const local = localAddress.slice(2).toLowerCase();
|
|
258
|
+
const deployed = deployedAddress.slice(2).toLowerCase();
|
|
259
|
+
assertOccurrences(bytecode, local, expectedSelfAddressOccurrences, 'deployment address');
|
|
260
|
+
let normalized = bytecode.slice(2).toLowerCase().replaceAll(local, deployed);
|
|
261
|
+
if (eip712DomainName) {
|
|
262
|
+
const localDomain = eip712DomainSeparator(
|
|
263
|
+
eip712DomainName,
|
|
264
|
+
localAddress,
|
|
265
|
+
eip712DomainVersion,
|
|
266
|
+
).slice(2);
|
|
267
|
+
const deployedDomain = eip712DomainSeparator(
|
|
268
|
+
eip712DomainName,
|
|
269
|
+
deployedAddress,
|
|
270
|
+
eip712DomainVersion,
|
|
271
|
+
).slice(2);
|
|
272
|
+
assertOccurrences(`0x${normalized}`, localDomain, expectedDomainSeparatorOccurrences, 'EIP-712 domain separator');
|
|
273
|
+
normalized = normalized.replaceAll(localDomain, deployedDomain);
|
|
274
|
+
} else if (expectedDomainSeparatorOccurrences !== 0) {
|
|
275
|
+
throw new Error('Expected EIP-712 domain occurrences without a domain name');
|
|
276
|
+
}
|
|
277
|
+
return `0x${normalized}`;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function assertOccurrences(bytecode, value, expected, label) {
|
|
281
|
+
const actual = bytecode.slice(2).toLowerCase().split(value).length - 1;
|
|
282
|
+
if (actual !== expected) throw new Error(`${label} occurrence mismatch: expected ${expected}, got ${actual}`);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
function eip712DomainSeparator(name, verifyingContract, version) {
|
|
286
|
+
const hasVersion = version !== undefined;
|
|
287
|
+
const typeHash = keccak256(toHex(hasVersion
|
|
288
|
+
? 'EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'
|
|
289
|
+
: 'EIP712Domain(string name,uint256 chainId,address verifyingContract)'));
|
|
290
|
+
return keccak256(encodeAbiParameters(
|
|
291
|
+
hasVersion
|
|
292
|
+
? [{ type: 'bytes32' }, { type: 'bytes32' }, { type: 'bytes32' }, { type: 'uint256' }, { type: 'address' }]
|
|
293
|
+
: [{ type: 'bytes32' }, { type: 'bytes32' }, { type: 'uint256' }, { type: 'address' }],
|
|
294
|
+
hasVersion
|
|
295
|
+
? [typeHash, keccak256(toHex(name)), keccak256(toHex(version)), 5_042n, verifyingContract]
|
|
296
|
+
: [typeHash, keccak256(toHex(name)), 5_042n, verifyingContract],
|
|
297
|
+
));
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
function usage() {
|
|
301
|
+
process.stderr.write('Usage: node scripts/verify-v4-retained-artifacts.mjs --deployment-manifest <047d585 checkout> --uniswap-contracts <534603a checkout> --universal-router-contracts <02fd176 checkout> [--anvil-rpc http://127.0.0.1:8545]\n');
|
|
302
|
+
process.exit(2);
|
|
303
|
+
}
|