@reptilianhq/uniswap-sdk 0.7.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 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
- The v4 `reviewedDeployment` contains chainId, PoolManager, StateView and Quoter addresses.
76
- There are no implicit v4 Robinhood or Arc deployments. Hosts own endpoint selection,
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: a contract that
88
- returns the expected pointer is not necessarily the reviewed implementation.
89
- Source/code verification and hook-specific compatibility remain release gates.
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 both exported deployments against
150
- their public RPCs. `UNISWAP_MAINNET_RPC_URL` and `UNISWAP_TESTNET_RPC_URL` may
151
- override those read-only endpoints.
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 surface is capital-moving protocol support: it prepares unsigned calldata
156
- and verifies protocol-specific transaction and receipt facts. It does not grant
157
- authorization or submit transactions. The v4 surface remains read-only and does
158
- not claim Arc deployment or custom-hook compatibility. Never treat a local test
159
- or a successful wiring check as source verification.
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 both deployment records. Runtime code identity is not source verification or
69
- custom-hook compatibility. Arc details remain unavailable.
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";
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQ/B,CAAC;AAEH,cAAc,cAAc,CAAC"}
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"]}
@@ -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;AAExF,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGnF,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,SA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AAC;IAChC,4BAA4B,EAAE,OAAO,CAAC;IACtC,8BAA8B,EAAE,OAAO,CAAC;IACxC,kCAAkC,EAAE,MAAM,CAAC;CAC5C;AAED;;GAEG;AACH,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,mBAAmB,GAC9B,OAAO,CAAC,4BAA4B,CAAC,CAoCvC;AAED;;;;GAIG;AACH,wBAAsB,+BAA+B,CACnD,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,sBAAsB,GACjC,OAAO,CAAC,+BAA+B,CAAC,CA+F1C"}
@@ -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,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oB,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;;GA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S,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"]}
@@ -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;AAI1D,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;I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AC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,GAAG,CAAA;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"}
@@ -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))