Skip to content

[VPD-1241]: Certik reaudit upgrade Core Pool, Liquidator and Leverage Manager#716

Open
GitGuru7 wants to merge 9 commits into
mainfrom
feat/vpd-1241
Open

[VPD-1241]: Certik reaudit upgrade Core Pool, Liquidator and Leverage Manager#716
GitGuru7 wants to merge 9 commits into
mainfrom
feat/vpd-1241

Conversation

@GitGuru7

@GitGuru7 GitGuru7 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Applies the Certik "Venus Labs – Core Feature Reaudit" fixes to the BNB Chain Core Pool stack — recompiled, audited bytecode for the Comptroller diamond, ComptrollerLens, Liquidator, the standard VBep20 delegate, the LeverageStrategiesManager, and the E-brake Executor.

What changes

  • Core Pool Comptroller (diamond recut) — replaces the Diamond implementation and all five facets (Market, Policy, Reward, Setter, FlashLoan) with recompiled audited bytecode, preserving the function-to-facet mapping. The RewardFacet gains two market-filtered overloads — claimVenusAsCollateral(address,address[]) and seizeVenus(address[],address,address[]) — and enforces vXVS-market entry when claiming as collateral under a shortfall.
  • ACM — grants call permission for the new seizeVenus(address[],address,address[]) to the Normal / Fast-track / Critical timelocks and the critical guardian.
  • ComptrollerLens — solvency hypothetical now skips entered markets with neither supply nor debt (prevents a dead oracle on an empty entered market from bricking the liquidity calc).
  • Liquidator — accrues VAI interest before the force-VAI-liquidation gate; honors the per-borrower forced-liquidation flag.
  • VBep20Delegate — repoints the selected Core Pool markets to the recompiled delegate (37 markets on mainnet; native vBNB and markets on bespoke/legacy delegates excluded).
  • LeverageStrategiesManager — dust returned via operation deltas; new owner-only sweepToken(address).
  • Executor (E-brake V2) — implementation-only upgrade; cap-exceeding emergency halts now fail closed (emit HaltedWithoutCapCheck) if the cap read reverts, instead of using a stale reading.

Testing

  • Fork simulations for all three (simulations/vip-999/{bscmainnet,bsctestnet,bsctestnet-addendum}.ts), ABIs sourced from the deployed implementations.
  • Mainnet sim asserts pre-VIP state, facet-selector deep-equality (no orphaned selectors), storage preservation across the recut, all proxy upgrades, the new ACM grant, plus end-to-end flows — mint/redeem on the new delegate, supply→borrow→liquidate→repay→redeem, the new seizeVenus/claimVenusAsCollateral overloads, LSM sweepToken, and a cross-asset leverage round-trip via the RelativePositionManager.

Note

CorrelatedTokenOracle (setSnapshot) — intentionally deferred. The oracle fix from the same reaudit is not part of this VIP. setSnapshot is a governance-gated function and the fix only adds an input-validation safeguard (max-rate / timestamp bounds), so the residual risk is minimal. The deployed contract is left unchanged for now; any new oracle deployments can adopt the updated implementation directly.
vFIL and vBUSD markets have been intentionally included in the upgrade list due to their strong available liquidity.

@GitGuru7 GitGuru7 changed the title feat: upgrade Core Pool, Liquidator and Leverage Manager [VPD-1241]: Certik reaudit upgrade Core Pool, Liquidator and Leverage Manager Jun 22, 2026
@GitGuru7 GitGuru7 self-assigned this Jun 23, 2026
@GitGuru7 GitGuru7 marked this pull request as ready for review June 23, 2026 08:31
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.

1 participant