Skip to content

VDB-34: VIP-664 [BNB Chain] Treasury Fund Cleanup Phase 2 — recover deprecated-market and third-party positions - #747

Open
trumpgpt-bot wants to merge 3 commits into
mainfrom
bot/VDB-34-work-on-jira-issue-vpd-1710
Open

VDB-34: VIP-664 [BNB Chain] Treasury Fund Cleanup Phase 2 — recover deprecated-market and third-party positions#747
trumpgpt-bot wants to merge 3 commits into
mainfrom
bot/VDB-34-work-on-jira-issue-vpd-1710

Conversation

@trumpgpt-bot

Copy link
Copy Markdown
Contributor

Adds vips/vip-664/bscmainnet.ts and simulations/vip-664/bscmainnet.ts (+ abi/).

What it does (pure VIP, REGULAR, 40 commands, bscmainnet):

  • Part 1: start two-step ownership transfer of the 6 Treasury TokenBuyback contracts (BTCB/ETH/XVS/USDT/USDC/U) from the Normal Timelock to the Guardian (Guardian completes with acceptOwnership()).
  • Part 2: redeem 13 deprecated-market positions (8 isolated + 5 core) back to VTreasury via the TokenRedeemer. vETH is redeemed for a fixed cash-safe amount (1.99 ETH); the other 12 via redeemAndTransfer.
  • Part 3: transfer 8 third-party staking receipt tokens (SolvBTC, xSolvBTC, ankrBNB, asBNB, BETH, slisBNB, stkBNB, BNBx) to the dev recipient for off-chain unstaking.

Verification: every address/signature/value verified on-chain — 13 vTokens confirmed deprecated (CF/supplyCap/borrowCap all 0), positions match the Notion doc, cash ≥ redeemable for all full redeems, buyback owners = NT, redeemer owner = NT, third-party underlyings + balances confirmed.

Two on-chain-driven scope changes vs the plan: (1) BNBx is routed to the dev recipient rather than exited natively — Stader StakeManagerV2 is paused() and charges 10% (feeBps=1000), contradicting the 'instant/zero-fee' assumption; (2) the vUST 0% IRM repoint is excluded — vUST.admin() is the Guardian, not the timelock, so a governance VIP can't call _setInterestRateModel (must be a Guardian multisig tx). Both documented in the VIP description.

Tests: npx hardhat test simulations/vip-664/bscmainnet.ts --fork bscmainnet → 54 passing. Execute gas = 38% of the per-tx cap. eslint + prettier clean.


Opened by the Venus dev bot. Review required; the bot cannot merge.

Recover Venus Treasury (BSC) positions held outside VTreasury:

- Part 1: start two-step ownership transfer of the 6 Treasury TokenBuyback
  contracts from the Normal Timelock to the Guardian.
- Part 2: redeem 13 deprecated-market vToken positions (8 isolated + 5 core)
  back to VTreasury via the TokenRedeemer. vETH is redeemed for a fixed
  cash-safe amount (1.99 ETH); the rest use redeemAndTransfer.
- Part 3: transfer 8 third-party staking receipt tokens (SolvBTC, xSolvBTC,
  ankrBNB, asBNB, BETH, slisBNB, stkBNB, BNBx) to the dev recipient for
  off-chain unstaking. BNBx routed here (not native Stader exit) because
  StakeManagerV2 is paused and charges 10%.

The vUST 0% IRM change is intentionally excluded: vUST's admin is the
Guardian, not the timelock, so it must be executed as a Guardian multisig tx.

Fork simulation (bscmainnet) passing: 54 tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@trumpgpt-bot
trumpgpt-bot marked this pull request as ready for review July 29, 2026 10:09
Comment thread vips/vip-664/bscmainnet.ts Outdated
Comment thread vips/vip-664/bscmainnet.ts Outdated
…ive exit

- vUSDT (Tron): the thinnest deprecated market (cash only ~0.47% above the
  treasury position), so switch it from a full redeemAndTransfer to a cash-safe
  redeemUnderlyingAndTransfer (10,300 USDT), mirroring vETH; leftover vUSDT is
  returned to VTreasury.
- BNBx (Stader): exit natively instead of routing to the dev recipient. Verified
  on-chain that paused()/feeBps gate only the async requestWithdraw path, not the
  instant redeemBnbxForBnb, which pays the full BNB value with no fee. Withdraw
  BNBx to the Normal Timelock, redeemBnbxForBnb, and forward the BNB to VTreasury.
- Simulation: generalize the partial-redeem assertions to both markets; add the
  BNBx native-exit pre/post checks (BNB returned to VTreasury, no BNBx stranded)
  and the RedeemedBnbxForBnb event; new stakeManagerV2 ABI.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment thread vips/vip-664/bscmainnet.ts
Comment thread vips/vip-664/bscmainnet.ts Outdated
Comment thread vips/vip-664/bscmainnet.ts Outdated
Comment thread vips/vip-664/bscmainnet.ts Outdated
- Part 1: expand TokenBuyback ownership transfer from 6 to all 10
  Token Converter Phase-2 'Active' contracts (adds USDTPrime, UPrime,
  RiskFund, XVSBuyback) — all verified owner=NormalTimelock, pendingOwner=0.
- Part 2: redeem all 13 deprecated-market positions in full and send the
  underlying directly to DEV_RECIPIENT (was VTreasury). vUSDT(Tron) and
  vETH revert to full redeemAndTransfer — market cash verified > position
  at the fork block, so no partial redeem needed.
- Part 3: add illiquid vTUSDOLD (getCash==0) as a whole-vToken transfer to
  DEV_RECIPIENT so no separate later VIP is needed.

Sim: 61 passing, eslint+prettier clean, execute gas 40.82% of per-tx cap.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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