Skip to content

test(bstock): drive the fork suite off the live deployment and wiring#704

Open
Debugger022 wants to merge 1 commit into
developfrom
test/bstock-fork
Open

test(bstock): drive the fork suite off the live deployment and wiring#704
Debugger022 wants to merge 1 commit into
developfrom
test/bstock-fork

Conversation

@Debugger022

@Debugger022 Debugger022 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Point the suite at the deployed liquidator 0x5974Badab6911a78Ba15229045514C2C1bD42343 at block 111264600.
  • Check the real mainnet router allowlist instead of creating one.
  • Hop 1 stays mocked. RFQ quotes are signed off-chain and can't be replayed on a fork.
  • Liquid Mesh and VAI tests no longer deploy their own proxies, since the deployed one supports both.

New tests

  • Flash + two-hop (CAKE debt).
  • Flash + native BNB, which flashes vWBNB and unwraps it.
  • KyberSwap and OpenOcean, behind LIVE_AMM=1. These check the router each one returns still matches what we allowlisted.

How to run

FORKED_NETWORK=bscmainnet ARCHIVE_NODE_bscmainnet=<rpc> \
  npx hardhat test tests/hardhat/Fork/BStockLiquidatorFork.ts

The suite pointed at a superseded liquidator at a block predating its
deployment, and configured its own router allowlist, so it could not
catch a missing or rolled-back setRouter. It now attaches to the live
proxy and asserts the mainnet allowlist instead.

Adds flash+two-hop and flash+native-BNB coverage (both previously
untested despite flash being the recommended shape for non-USDT debt),
plus opt-in LIVE_AMM=1 tests that prove the KyberSwap and OpenOcean
adapters execute against their real routers.
@Debugger022 Debugger022 self-assigned this Jul 21, 2026

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.

Tip: disable this comment in your organization's Code Review settings.

@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Health
contracts 100% 100%
contracts.Admin 88% 41%
contracts.BStock 100% 97%
contracts.Comptroller 100% 90%
contracts.Comptroller.Diamond 95% 64%
contracts.Comptroller.Diamond.facets 88% 74%
contracts.Comptroller.Diamond.interfaces 100% 100%
contracts.Comptroller.Types 100% 100%
contracts.Comptroller.legacy 100% 100%
contracts.Comptroller.legacy.Diamond 0% 0%
contracts.Comptroller.legacy.Diamond.facets 0% 0%
contracts.Comptroller.legacy.Diamond.interfaces 100% 100%
contracts.DelegateBorrowers 100% 89%
contracts.FlashLoan.interfaces 100% 100%
contracts.Governance 68% 45%
contracts.InterestRateModels 74% 59%
contracts.Lens 44% 47%
contracts.Liquidator 83% 60%
contracts.Oracle 100% 100%
contracts.PegStability 88% 84%
contracts.Swap 88% 58%
contracts.Swap.interfaces 100% 100%
contracts.Swap.lib 81% 53%
contracts.Tokens 100% 100%
contracts.Tokens.Prime 97% 81%
contracts.Tokens.Prime.Interfaces 100% 100%
contracts.Tokens.Prime.libs 90% 77%
contracts.Tokens.VAI 82% 52%
contracts.Tokens.VRT 20% 9%
contracts.Tokens.VTokens 71% 53%
contracts.Tokens.VTokens.legacy 0% 0%
contracts.Tokens.VTokens.legacy.Utils 0% 0%
contracts.Tokens.XVS 19% 8%
contracts.Tokens.test 100% 100%
contracts.Utils 52% 31%
contracts.VAIVault 50% 45%
contracts.VRTVault 49% 36%
contracts.XVSVault 63% 50%
contracts.external 100% 100%
contracts.lib 89% 71%
Summary 62% (4518 / 7315) 48% (1751 / 3646)

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