Skip to content

Add OrvexCL PancakeInfinity fork to Robinhood - #621

Open
e1Ru1o wants to merge 3 commits into
masterfrom
e1Ru1o/orvex
Open

Add OrvexCL PancakeInfinity fork to Robinhood#621
e1Ru1o wants to merge 3 commits into
masterfrom
e1Ru1o/orvex

Conversation

@e1Ru1o

@e1Ru1o e1Ru1o commented Aug 7, 2026

Copy link
Copy Markdown
Member

No description provided.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@e1Ru1o
e1Ru1o requested a review from jparklev August 7, 2026 18:41
@e1Ru1o e1Ru1o self-assigned this Aug 7, 2026
@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.

@jparklev jparklev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@duncancmt duncancmt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, but the flexibility of the pattern (inversion of control) makes me worry about whether this introduces the possibility of future footguns. I think a defensively-programmed variation may also improve gas efficiency, but this is just a hunch.

revert(0x1c, 0x24)
}
}
_pancakeInfinitySettleDelta(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The risk with this pattern is that it invites more flexibility in the mixin than in required to get this feature functional. Instead of allowing the mixin arbitrary flexibility in _pancakeInfinitySettleDelta to call back into the base's swapToClManager and swapToBinManager (inversion of control) having a virtual pure function that simply returns the address of the CL manager or Bin manager (or revert) removes the footgun and (potentially, should be measured) improves solc's ability to optimize.

I would expect that that change would also improve the amount of boilerplate required, potentially allowing us to move the vault/manager address selection into the chain-specific mixin. Of course, that totally breaks everything if there are 2 PancakeInfinity forks on the same chain


abstract contract OrvexCL is PancakeInfinityBase {
function _PANCAKE_INFINITY_VAULT() internal pure override returns (address) {
return orvexVault;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should check if solc is smart enough to optimize this constant or whether it needs this to be a literal in order to optimize.

// types simply omits that route, which also omits the corresponding swap code from the
// compiled contract.
function _dispatchPancakeInfinity(
uint8 poolManagerId,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When possible, types should be widened to a full word to avoid solc's wasteful cleaning of short types

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.

3 participants