Skip to content

feat: add Pancake Infinity on Robinhood - #649

Open
svccentaur wants to merge 1 commit into
masterfrom
centaur/add-pancake-infinity-robinhood-20260911
Open

svccentaur wants to merge 1 commit into
masterfrom
centaur/add-pancake-infinity-robinhood-20260911

Conversation

@svccentaur

@svccentaur svccentaur commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add Pancake Infinity's Robinhood Vault and CLPoolManager as chain-specific manager ID 2
  • preserve the existing Orvex integration as manager ID 0, including its separate Vault
  • select the appropriate trusted Vault from the first fill's decoded manager ID and route chain-specific CL managers through a dedicated resolver
  • add a real Robinhood WETH/USDG fork test covering standard, VIP, meta-transaction, and AllowanceHolder VIP execution

Deployment reference: PancakeSwap v4 - Robinhood Mainnet

Public corroboration: infinity-core Robinhood config, infinity-periphery Robinhood config, and PancakeSwap Infinity contract addresses.

Deployment verification

The deployment addresses were independently corroborated against PancakeSwap's public Robinhood configuration and contract-address documentation:

Component Address
CREATE3 factory 0x38Ab3f2CE00973A51d3A2A04d634C9bcbf20e4e1
Vault 0x4F922d5B15e6691e0469663E4F5C4177f23c5FaF
CLPoolManager 0xeE04c68742e6Bf434bE8039580D2e89BBE55bc6f
Pool owner 0x7e283FDEe79d0D06973316e74EaEf58c2854f6AA
Manager owner contract 0x52544649ED200E222d3B377ea1A5f68D48c56A27
Protocol fee controller 0x6ceE884e614388819BF96b5e2c716FE231d162f8

No BinPoolManager is configured for Robinhood.

Deterministic deployment and creation bytecode

  • Vault deployment transaction 0xfbd4…ad26 succeeded at block 56,732,884.
    • salt: keccak256("INFINITY-CORE/VAULT/1.0.0") = 0x617e7acf5e1dcffa09da0a69265d6ee6a4ed234247cc85a87a9d3a8aa12d523d
    • the factory's computeAddress result is exactly 0x4F922d5B15e6691e0469663E4F5C4177f23c5FaF
    • the 9,387-byte transaction creation payload exactly matches a local build of PancakeSwap infinity-core commit 891259f
    • creation-code hash: 0xb51fc0b2a847148a8e21e9c218aa9d3b166cc158861dc97c80c8632fef1c1cd1, equal to the hash supplied to the CREATE3 factory
  • CLPoolManager deployment transaction 0xbfcc…080a succeeded at block 56,743,018.
    • salt: keccak256("INFINITY-CORE/CLPoolManager/1.0.0") = 0x1ce097c42cfd92b6f569ca1f93494471fa6d073a600e2a0dbf560f22790035ae
    • the factory's computeAddress result is exactly 0xeE04c68742e6Bf434bE8039580D2e89BBE55bc6f
    • the 21,141-byte transaction creation payload exactly matches the same source build plus the ABI-encoded Vault constructor argument
    • creation-code hash: 0xb6c453f70b68443c3cf7465176b9ef0707b4820a3d0139f2eb4a88b9e1a88b68, equal to the hash supplied to the CREATE3 factory

The reproduction used Solidity 0.8.26+commit.8a97fa7a, via IR, optimizer runs 25,666, Cancun EVM, and no metadata bytecode hash, matching the upstream repository configuration.

Runtime bytecode

  • Robinhood Vault: 9,260 bytes, keccak256 = 0x79d6412f6d93607104d7c2fa76d4e5f5d77c29002187d818f24f04e54127e90b; exact match to the locally compiled deployed bytecode.
  • Robinhood CLPoolManager: 20,885 bytes, keccak256 = 0xc7a718bdecefbe9d1a1708097bc856f9c13d87701f050cedbafcafe01fd42064; exact match after linking the Vault immutable at all five compiler-reported immutable offsets, with zero differing bytes.
  • BNB and Base use byte-identical canonical Vault and CLPoolManager deployments across those chains. The Robinhood CLPoolManager becomes byte-identical to their runtime after replacing only the five Vault immutable occurrences.
  • Robinhood's Vault is intentionally newer than the BNB/Base Vault. The source difference is explained by PancakeSwap commit 61cd131, which introduced transient application-deficit accounting and an end-of-lock deficit check. The Robinhood runtime exactly matches the post-fix source rather than an unexplained fork.

Onchain configuration and live-pool checks

  • RPC chain ID is 4663.
  • CLPoolManager.vault() returns the configured Robinhood Vault.
  • Vault.isAppRegistered(CLPoolManager) returns true.
  • Vault.owner() is 0x7e283FDEe79d0D06973316e74EaEf58c2854f6AA; pendingOwner() is 0xfa206DAB60c014bEb6833004D8848910165e6047.
  • CLPoolManager.owner() is 0x52544649ED200E222d3B377ea1A5f68D48c56A27, whose owner() is the pool owner above.
  • CLPoolManager.protocolFeeController() is 0x6ceE884e614388819BF96b5e2c716FE231d162f8, whose owner() is also the pool owner above.
  • CLPoolManager.paused() is false.
  • At the read point, the Vault had no active locker, no unsettled deltas, and no application deficits.
  • Pool 0xdde13ccbbcd10c5fc3351c284eabc77114d2a88078eb1cfd20062124e939d4cf resolves to WETH/USDG, the configured CLPoolManager, zero hook, fee 90, and parameters ending in 0x10000; its liquidity at block 60,170,000 was 34,004,700,804,492.

The separate PancakeSwap V3 constants were also reviewed. Robinhood's published V3 logical factory is 0x0BFb…1865, while Settler intentionally uses deployer 0x41ff…071c9 with init hash 0x6ce8…f7e2 because V3 pool CREATE2 derivation is performed from the deployer. Pancake Infinity does not derive pools via an init hash; it identifies them by PoolManager plus PoolId.

Security properties

  • Only hardcoded chain mixin resolvers can select a Vault or manager; calldata cannot supply an arbitrary target.
  • Unknown manager IDs still revert through revertUnknownPoolManagerId.
  • Manager ID 0 retains the existing Orvex manager and Vault, while ID 2 selects Pancake Infinity's manager and Vault.
  • The first fill's compact packing key is decoded before locating its manager byte, supporting every valid packing-key shape rather than assuming a fixed token count.
  • A route cannot successfully mix managers belonging to different Vaults: each manager accounts deltas against its registered Vault, and the transaction reverts atomically if that Vault is not the active locker.
  • Callback authorization remains enforced by Settler's existing transient operator/callback mechanism, and all external protocol targets remain trusted constants.

Tests

  • exact Solidity 0.8.34 compilation of the Robinhood production contracts
  • exact Solidity 0.8.34 compilation of the Robinhood integration test
  • exhaustive production build: 157 contracts across Solidity 0.8.34 and 0.8.25
  • Robinhood WETH/USDG fork suite at block 60,170,000: 8 passed, 0 failed, 10 intentionally skipped
    • standard Pancake Infinity
    • Pancake Infinity VIP
    • Pancake Infinity meta-transaction
    • Pancake Infinity VIP through AllowanceHolder
    • inherited AllowanceHolder/RFQ regression cases
  • VIP action-signature compatibility check
  • whitespace/error check with git diff --check

Gas Optimization

The manager and Vault selection reads the already-encoded first fill directly in memory and does not add an ABI field or storage access. New WETH/USDG gas snapshots:

Path Snapshot gas
Standard 251,773
VIP 224,129
Meta-transaction VIP 229,107
AllowanceHolder VIP 215,597

The Robinhood taker-submitted Settler runtime is 20,245 bytes, leaving 4,331 bytes below the EIP-170 limit. MetaTxn is 18,184 bytes and Intent is 18,991 bytes.

Prompted by: duncancmt

@immunefi-magnus

Copy link
Copy Markdown

🛡️ Immunefi PR Reviews

We noticed that your project isn't set up for automatic code reviews. If you'd like this PR reviewed by the Immunefi team, you can request it manually using the link below:

🔗 Send this PR in for review

Once submitted, we'll take care of assigning a reviewer and follow up here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants