Skip to content

Commit 089bfb8

Browse files
codybornclaude
andauthored
feat: add Ink (57073) support (#694)
Phase 3 of the Ink DutchV3 rollout. The reactor and OrderQuoter are deployed and verified (Uniswap/UniswapX#375) and the SDK mappings are published in @uniswap/uniswapx-sdk 3.1.0 (Uniswap/sdks#682). - ChainId.INK added to SUPPORTED_CHAINS (lib/util/chain.ts). Each entry needs an RPC resolvable by getRpcUrl(chainId), which appends the chainId to RPC_PREFIX_URL — no per-chain env var required. - OLDEST_BLOCK_BY_CHAIN[INK] = 52464000. The V3 reactor (0x000000007A1C8e570011EeDF86A2A35593013cBA) was created in block 52464395 on Ink; verified on-chain that the address has 0 bytes of code at 52464000 and 17206 bytes at 52464395, so the seed sits just below the earliest block any UniswapX fill could appear on, per the map's convention. - swagger.json's ChainId enum gains 57073, which test/unit/swagger.test.ts asserts stays in sync with SUPPORTED_CHAINS. - @uniswap/uniswapx-sdk bumped 3.0.10 -> 3.1.0. The SDK bump ships with the chain entry because 3.0.10 has no 57073 mappings: order parsing/validation would throw MissingConfiguration out of getPermit2/getReactor rather than degrade. No PRIORITY_ORDER_TARGET_BLOCK_BUFFER or HYBRID_ORDER_TARGET_BLOCK_BUFFER entry is needed. Both are Partial<Record<ChainId, number>> and OffChainUniswapXOrderValidator.validateReactorAddress rejects priority/hybrid orders for chains absent from the SDK's reactor mapping before the buffers are consulted, so a missing entry is unreachable rather than a build break. No block-time constant either: BLOCKS_IN_24_HOURS derives from sdk-core's getAverageBlockTimeSecs, which registers Ink at 1s. Tests: 547 pass. The 14 remaining failures are pre-existing — clean main reports the identical 14 (field-validator cosigner, order-validator v3). Before the swagger fix this branch showed 15, i.e. exactly the one legitimate new failure, now resolved. tsc build clean. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 5c1c497 commit 089bfb8

5 files changed

Lines changed: 26 additions & 7 deletions

File tree

lib/util/chain.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ export const SUPPORTED_CHAINS = [
2626
ChainId.ZORA,
2727
ChainId.ROBINHOOD,
2828
ChainId.ARC,
29+
ChainId.INK,
2930
]

lib/util/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export const OLDEST_BLOCK_BY_CHAIN = {
3333
[ChainId.ZORA]: 45736000,
3434
[ChainId.ROBINHOOD]: 53000,
3535
[ChainId.ARC]: 4852000,
36+
[ChainId.INK]: 52464000,
3637
}
3738
export const BLOCKS_IN_24_HOURS = (chainId: ChainId): number => {
3839
return Math.floor(ONE_DAY_IN_SECONDS / getAverageBlockTimeSecs(chainId))

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"@uniswap/permit2-sdk": "^1.4.0",
7070
"@uniswap/sdk-core": "^7.18.0",
7171
"@uniswap/signer": "^0.0.4",
72-
"@uniswap/uniswapx-sdk": "3.0.10",
72+
"@uniswap/uniswapx-sdk": "3.1.0",
7373
"@uniswap/universal-router-sdk": "^4.18.1",
7474
"aws-cdk-lib": "2.200.1",
7575
"aws-embedded-metrics": "^4.1.0",

swagger.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@
362362
"ChainId": {
363363
"type": "number",
364364
"description": "Chains supported by UniswapX.",
365-
"enum": [1, 10, 56, 130, 137, 143, 196, 480, 1301, 1868, 4217, 4663, 5042, 8453, 42161, 42220, 43114, 81457, 7777777, 11155111],
365+
"enum": [1, 10, 56, 130, 137, 143, 196, 480, 1301, 1868, 4217, 4663, 5042, 8453, 42161, 42220, 43114, 57073, 81457, 7777777, 11155111],
366366
"example": 1
367367
},
368368
"OrderStatus": {

yarn.lock

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4702,6 +4702,23 @@
47024702
toformat "^2.0.0"
47034703
tslib "^2.3.0"
47044704

4705+
"@uniswap/sdk-core@^7.19.1":
4706+
version "7.19.1"
4707+
resolved "https://registry.yarnpkg.com/@uniswap/sdk-core/-/sdk-core-7.19.1.tgz#2a91e1eb777efa5af159802ed14cf4c60bbbf8fc"
4708+
integrity sha512-3M8T1JXjy3Ypz/yKC9w75PH5EwpVgFIU5E7V8dI7+CBaZ2wr2RZeVlBrhJljdyGWYLjHT7owtA+SrOcwnhN2fA==
4709+
dependencies:
4710+
"@ethersproject/address" "^5.0.2"
4711+
"@ethersproject/bignumber" "^5.5.0"
4712+
"@ethersproject/bytes" "^5.7.0"
4713+
"@ethersproject/keccak256" "5.7.0"
4714+
"@ethersproject/strings" "5.7.0"
4715+
big.js "^5.2.2"
4716+
decimal.js-light "^2.5.0"
4717+
jsbi "^3.1.4"
4718+
tiny-invariant "^1.1.0"
4719+
toformat "^2.0.0"
4720+
tslib "^2.3.0"
4721+
47054722
"@uniswap/sdk-core@^7.5.0":
47064723
version "7.7.2"
47074724
resolved "https://registry.npmjs.org/@uniswap/sdk-core/-/sdk-core-7.7.2.tgz#dc3a9b63b343640754860dce05d06972815eaee6"
@@ -4738,16 +4755,16 @@
47384755
dotenv "^14.2.0"
47394756
hardhat-watcher "^2.1.1"
47404757

4741-
"@uniswap/uniswapx-sdk@3.0.10":
4742-
version "3.0.10"
4743-
resolved "https://registry.yarnpkg.com/@uniswap/uniswapx-sdk/-/uniswapx-sdk-3.0.10.tgz#6fdb915b06fa98b4bccd11aa4a1df3c3ffb1d099"
4744-
integrity sha512-SBEAKsNQFFm3WB9sZs6bqAFnyOLVV0YNqBTknYm/4tJdtBYXUKdRMaHjk20Xh9gzf/QFhM+IsxBhv0pnuHpBFQ==
4758+
"@uniswap/uniswapx-sdk@3.1.0":
4759+
version "3.1.0"
4760+
resolved "https://registry.yarnpkg.com/@uniswap/uniswapx-sdk/-/uniswapx-sdk-3.1.0.tgz#ca8aa7eef979e41dfa391992f1f024cf65bdd133"
4761+
integrity sha512-scWOSHC+bJosuZYGIX3rGTlApsEuwVKEdJ1PdHDzIpdJhOe14s4hSv3zAcbPBk9fk8b1oBjEerZeuLhI/HgcDQ==
47454762
dependencies:
47464763
"@ethersproject/abi" "^5.5.0"
47474764
"@ethersproject/bytes" "^5.7.0"
47484765
"@ethersproject/providers" "^5.7.0"
47494766
"@uniswap/permit2-sdk" "^1.4.0"
4750-
"@uniswap/sdk-core" "^7.18.0"
4767+
"@uniswap/sdk-core" "^7.19.1"
47514768
ethers "^5.7.0"
47524769
tiny-invariant "^1.1.0"
47534770

0 commit comments

Comments
 (0)