Skip to content

VDB-7: Deploy TokenRedeemer and author bsctestnet VIP#685

Draft
trumpgpt-bot wants to merge 5 commits into
developfrom
bot/VDB-7-deploy-tokenredeemer-and-author-bsctestnet-vip
Draft

VDB-7: Deploy TokenRedeemer and author bsctestnet VIP#685
trumpgpt-bot wants to merge 5 commits into
developfrom
bot/VDB-7-deploy-tokenredeemer-and-author-bsctestnet-vip

Conversation

@trumpgpt-bot

Copy link
Copy Markdown

What changed

Repo Files Change
vips vips/vip-664/bsctestnet.ts VIP-664 — single REGULAR command sweepTokens(XVS, VTreasury) on the TokenRedeemer, executed by the bsctestnet NormalTimelock.
vips simulations/vip-664/bsctestnet.ts + abi/{XVS,TokenRedeemer}.json 4-part fork simulation.
venus-protocol-documentation deployed-contracts/funds.md TokenRedeemer entry under BNB Chain Testnet.
venus-protocol deploy/015-deploy-token-redeemer.ts + deployments/bsctestnet/TokenRedeemer.json Deploy-script patch + artifacts (committed in the deploy phase).

Address verification (three ways agree)

TokenRedeemer = 0x6E78a0d96257F8F2615d72F3ee48cb6fb2c970bd

  • Deploy context / answer: 0x6E78…970bd
  • venus-protocol/deployments/bsctestnet/TokenRedeemer.json .address: 0x6E78…970bd
  • On-chain owner() (chain.call 0x8da5cb5b): 0xce10739590001705F7FF231611ba4A48B2820327 = bsctestnet NormalTimelock ✓

Other addresses (from artifacts + NETWORK_ADDRESSES.bsctestnet):

  • XVS 0xB9e0E753630434d7863528cc73CB7AC638a7c8ff
  • VTreasury 0x8b293600c50d6fbdc6ed4251cc75ece29880276f

Signature / gate verification

  • sweepTokens(address,address) exists in the deployed ABI; source: Currency.wrap(token).transferAll(destination) → transfers the full balance, emitting exactly one ERC-20 Transfer.
  • Gate is onlyOwner (owner = NormalTimelock) — no ACM grant and no acceptOwnership() needed (Ownable2Step transfers ownership directly in the constructor).

Simulation (4 parts)

forking(114868878, …) — the block in which TokenRedeemer was deployed (contract present on the fork). before() seeds 1 XVS into the TokenRedeemer from the XVS Vault Proxy whale.

  1. Pre-VIP — TokenRedeemer holds the seeded XVS; owner() == NormalTimelock.
  2. testVip + expectEvents — full propose→vote→queue→execute; asserts one Transfer.
  3. Post-VIP — TokenRedeemer XVS balance == 0 (fully swept).
  4. Behavioral proof — Treasury XVS balance == before + swept amount.
$ npx hardhat test simulations/vip-664/bsctestnet.ts --fork bsctestnet
  At block #114868878
  Pre-VIP state
    ✔ TokenRedeemer holds the seeded XVS balance
    ✔ TokenRedeemer is owned by the NormalTimelock
  ... commands
    ✔ executes sweepTokens(address,address) successfully
  ... execution
    ✔ can be proposed
    ✔ should be voteable
    ✔ should be queued successfully
    ✔ should be executed successfully   (gasUsed=133870)
  Post-VIP state
    ✔ TokenRedeemer XVS balance is fully swept to zero
    ✔ Treasury XVS balance increased by the swept amount
  9 passing (25s)

Lint

  • npx eslint vips/vip-664/bsctestnet.ts simulations/vip-664/bsctestnet.ts → exit 0.
  • npx prettier --check "vips/vip-664/**" "simulations/vip-664/**" → "All matched files use Prettier code style!"
  • Note: the full-repo yarn lint OOMs in this environment (V8 heap exhaustion linting the entire repo), unrelated to these files; scoped eslint/prettier are clean.

Risks

  • None to mainnet — testnet-only VIP; a plain ERC-20 sweep with no oracle/price dependency and no parameter changes.

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

@GitGuru7 GitGuru7 changed the base branch from main to develop June 22, 2026 13:54
Comment thread deploy/015-deploy-token-redeemer.ts Outdated

func.tags = ["TokenRedeemer"];
func.skip = async hre => hre.network.name !== "hardhat" && hre.network.name !== "bscmainnet";
func.skip = async hre => !["hardhat", "bscmainnet", "bsctestnet"].includes(hre.network.name);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Skip the opbnbmainnet as well here. Nothing impacts the eventual PR and VIP but a good to have improvement.

@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Health
contracts 100% 100%
contracts.Admin 88% 41%
contracts.Comptroller 100% 90%
contracts.Comptroller.Diamond 95% 64%
contracts.Comptroller.Diamond.facets 87% 73%
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 43% 46%
contracts.Liquidator 83% 60%
contracts.Oracle 100% 100%
contracts.PegStability 88% 84%
contracts.Swap 87% 58%
contracts.Swap.interfaces 100% 100%
contracts.Swap.lib 81% 55%
contracts.Tokens 100% 100%
contracts.Tokens.Prime 97% 73%
contracts.Tokens.Prime.Interfaces 100% 100%
contracts.Tokens.Prime.libs 90% 76%
contracts.Tokens.VAI 82% 52%
contracts.Tokens.VRT 20% 9%
contracts.Tokens.VTokens 70% 52%
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 57% (3740 / 6546) 43% (1412 / 3276)

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.

2 participants