Add OrvexCL PancakeInfinity fork to Robinhood - #621
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🛡️ Immunefi PR ReviewsWe 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: Once submitted, we'll take care of assigning a reviewer and follow up here. |
duncancmt
left a comment
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
When possible, types should be widened to a full word to avoid solc's wasteful cleaning of short types
No description provided.