Skip to content

[VPD-1185] feat: add TokenBuyBack deployments on bsctestnet#163

Merged
Debugger022 merged 6 commits into
developfrom
feat/VPD-1185
May 12, 2026
Merged

[VPD-1185] feat: add TokenBuyBack deployments on bsctestnet#163
Debugger022 merged 6 commits into
developfrom
feat/VPD-1185

Conversation

@Debugger022
Copy link
Copy Markdown
Contributor

@Debugger022 Debugger022 commented May 11, 2026

Summary

  • Deploy 10 TokenBuyback instances (RiskFund, XVS, Prime, Treasury variants) on bsctestnet and register their addresses.
  • Add a reusable verifyDeployment helper and wire it into every deploy script so proxy + implementation get verified on BscScan automatically.
  • Update hardhat config to use DEPLOYER_PRIVATE_KEY for bsctestnet and pull in @venusprotocol/venus-protocol external deployments; redeploy RiskFundV2 implementation.

Changes

Deploy scripts

  • deploy/000-psr.tsdeploy/009-treasury-buyback.ts: switch handlers to receive hre directly and call verifyDeployment(hre, name) after deployment / ownership transfer for ProtocolShareReserve, RiskFundV2, RiskFundConverter, XVSVaultTreasury, SingleTokenConverterImp, SingleTokenConverterBeacon, all SingleTokenConverter instances, ConverterNetwork, RiskFundBuyback, all Prime/Treasury TokenBuyback instances, and XVSBuyback.

Verification helper

  • helpers/verify.ts (new): exports verifyDeployment / verifyDeployments. Skips hardhat / localhost, skips when ETHERSCAN_API_KEY unset, verifies _Implementation + _Proxy (or main artifact when neither exists), tolerates "already verified" responses, logs failures without throwing.

Hardhat config

  • hardhat.config.ts: add node_modules/@venusprotocol/venus-protocol/deployments/bsctestnet to externalDeployments.bsctestnet; bsctestnet accounts now uses DEPLOYER_PRIVATE_KEY instead of the mnemonic.

Deployments (bsctestnet)

  • New TokenBuyback proxy + implementation artifacts and address-registry entries:
    • RiskFundBuyback — proxy 0x1a063a…71fE, impl 0x9A3716…86D8
    • XVSBuyback — proxy 0x7b96F9…5a11, impl 0x8a5E9a…c343
    • UPrimeBuyback — proxy 0xa9f091…07a4, impl 0x26C451…e1d7
    • USDTPrimeBuyback — proxy 0xaAc507…ab55, impl 0x9Ae32e…fadB
    • BTCBTreasuryBuyback — proxy 0x3AC5D1…feb6, impl 0x95d174…89Dd
    • ETHTreasuryBuyback — proxy 0x721CCA…C35d, impl 0x766fd2…8884
    • USDCTreasuryBuyback — proxy 0x90814c…0fF3, impl 0x03EFea…6573
    • USDTTreasuryBuyback — proxy 0xBCF3Ef…a497, impl 0xA65f35…29F5
    • UTreasuryBuyback — proxy 0x281d53…0C5C, impl 0xDBE338…3412
    • XVSTreasuryBuyback — proxy 0x9d8d03…E773, impl 0xC0C38f…9361
  • Redeploy RiskFundV2_Implementation0xAAe9c6412A7EaeB82eD2bA8E9E2bBc27bDa921f6.
  • Update deployments/bsctestnet.json and deployments/bsctestnet_addresses.json accordingly.

Test plan

  • yarn hardhat compile clean.
  • yarn hardhat deploy --network bsctestnet --tags RiskFundBuyback,XVSBuyback,PrimeBuyback,TreasuryBuyback is a no-op (skipIfAlreadyDeployed) and re-runs verifyDeployment without errors.
  • All 20 buyback artifacts (10 impl + 10 proxy) show as verified on BscScan testnet (confirmed via Etherscan v2 API, chainid 97 — impls = TokenBuyback, proxies = OptimizedTransparentUpgradeableProxy).
  • RiskFundV2_Implementation at 0xAAe9c6412A7EaeB82eD2bA8E9E2bBc27bDa921f6 verified on BscScan.
  • Address registry deployments/bsctestnet_addresses.json contains all new entries with matching _Proxy / _Implementation pairs.

@github-actions
Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Health
Interfaces 100% 100%
ProtocolReserve 95% 78%
Test 100% 100%
Test.Mocks 65% 44%
TokenConverter 89% 74%
Utils 100% 100%
Summary 89% (694 / 780) 74% (241 / 324)

@Debugger022 Debugger022 marked this pull request as ready for review May 12, 2026 05:56
@Debugger022 Debugger022 self-assigned this May 12, 2026
@Debugger022 Debugger022 merged commit 7e2e9b2 into develop May 12, 2026
5 checks passed
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