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
Open
Conversation
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
marked this pull request as ready for review
July 29, 2026 10:09
GitGuru7
reviewed
Jul 29, 2026
…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>
fred-venus
reviewed
Jul 30, 2026
fred-venus
reviewed
Jul 30, 2026
fred-venus
reviewed
Jul 30, 2026
fred-venus
reviewed
Jul 30, 2026
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
vips/vip-664/bscmainnet.tsandsimulations/vip-664/bscmainnet.ts(+abi/).What it does (pure VIP, REGULAR, 40 commands, bscmainnet):
acceptOwnership()).redeemAndTransfer.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.