diff --git a/.changeset/wave-c-polygon-hyperliquid-wrapped.md b/.changeset/wave-c-polygon-hyperliquid-wrapped.md new file mode 100644 index 0000000..c846167 --- /dev/null +++ b/.changeset/wave-c-polygon-hyperliquid-wrapped.md @@ -0,0 +1,5 @@ +--- +"@avaprotocol/protocols": minor +--- + +Add Polygon PoS (137) and Hyperliquid EVM (999) to `Chains`, and map `wrapped.weth` to the canonical native wrappers: WPOL `0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270` (legacy WMATIC) and WHYPE `0x5555555555555555555555555555555555555555`. No Uniswap/AAVE on HyperEVM in this change; Polygon protocol maps are a follow-up. diff --git a/README.md b/README.md index 37459de..a303f10 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ const sig = Protocols.aaveV3.eventTopics.Borrow; | **Spark** | SparkLend Pool (AAVE V3 fork — reuse AAVE Pool ABI) | Mainnet | | **Superfluid** | CFAv1Forwarder + setFlowrate/createFlow ABI | Mainnet, Base, **BNB** | | **Uniswap V3** | SwapRouter02, QuoterV2, Permit2, Factory, NFT Position Manager, Universal Router + ABIs | Mainnet, Sepolia, **Optimism**, Base, Base Sepolia, **BNB**, **Arbitrum**, **Unichain**, **Robinhood** | -| **Wrapped Ether** | Canonical wrapper of native gas + WETH9 ABI (WBNB on BNB) | Mainnet, Sepolia, **Optimism**, Base, Base Sepolia, **BNB**, **Arbitrum**, **Unichain**, **Robinhood** | +| **Wrapped Ether** | Canonical wrapper of native gas + WETH9 ABI (WBNB on BNB, WPOL on Polygon, WHYPE on Hyperliquid EVM) | Mainnet, Sepolia, **Optimism**, Base, Base Sepolia, **BNB**, **Arbitrum**, **Unichain**, **Robinhood**, **Polygon**, **Hyperliquid** | | **ERC-20** | Standard `approve` ABI fragment | n/a | Shared ABIs (consumed by multiple protocol modules): diff --git a/src/chains.ts b/src/chains.ts index 476ffdd..71c4a22 100644 --- a/src/chains.ts +++ b/src/chains.ts @@ -17,6 +17,8 @@ export const Chains = Object.freeze({ BnbMainnet: 56 as const, ArbitrumOne: 42_161 as const, RobinhoodMainnet: 4_663 as const, + PolygonMainnet: 137 as const, + HyperliquidMainnet: 999 as const, }); export type ChainId = (typeof Chains)[keyof typeof Chains] | number; diff --git a/src/protocols/wrapped.ts b/src/protocols/wrapped.ts index 12dcb46..4748c56 100644 --- a/src/protocols/wrapped.ts +++ b/src/protocols/wrapped.ts @@ -3,7 +3,8 @@ // Sepolia) this is the WETH9 (or OP-stack predeploy at 0x4200…0006) // contract. On chains with a different native gas token, the field // maps to the equivalent canonical wrapper — e.g. **WBNB** on BNB -// Chain. The field name stays `weth` so chain-agnostic consumers can +// Chain, **WPOL** on Polygon, **WHYPE** on Hyperliquid EVM. The field +// name stays `weth` so chain-agnostic consumers can // write `Protocols.wrapped.weth[chainId]` without branching by chain. // // The bridged-from-Ethereum WETH on BNB @@ -27,6 +28,12 @@ const weth: AddressByChain = { [Chains.UnichainMainnet]: "0x4200000000000000000000000000000000000006", // https://docs.robinhood.com/chain/contracts/ [Chains.RobinhoodMainnet]: "0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73", + // Polygon PoS native is POL. Canonical wrapper is the former WMATIC + // contract, now WPOL: https://polygonscan.com/token/0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270 + [Chains.PolygonMainnet]: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270", + // HyperEVM native is HYPE. Canonical WHYPE system contract: + // https://www.hyperscan.com/token/0x5555555555555555555555555555555555555555 + [Chains.HyperliquidMainnet]: "0x5555555555555555555555555555555555555555", }; /** diff --git a/tests/catalog.test.ts b/tests/catalog.test.ts index db18087..217d1bf 100644 --- a/tests/catalog.test.ts +++ b/tests/catalog.test.ts @@ -342,6 +342,14 @@ describe("Uniswap V3 catalog", () => { expect(Protocols.wrapped.weth[Chains.RobinhoodMainnet]).toBe( "0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73", ); + // Polygon WPOL (legacy WMATIC) / HyperEVM WHYPE — native wrappers, + // not bridged ETH. Field name stays `weth` for chain-agnostic callers. + expect(Protocols.wrapped.weth[Chains.PolygonMainnet]).toBe( + "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270", + ); + expect(Protocols.wrapped.weth[Chains.HyperliquidMainnet]).toBe( + "0x5555555555555555555555555555555555555555", + ); }); it("ships exactInputSingle in the SwapRouter02 ABI", () => {