Skip to content

[VPD-1097]: add Phase1 Executor permission grant - BSC mainnet & Testnet#699

Open
Debugger022 wants to merge 12 commits into
mainfrom
feat/VPD-1097
Open

[VPD-1097]: add Phase1 Executor permission grant - BSC mainnet & Testnet#699
Debugger022 wants to merge 12 commits into
mainfrom
feat/VPD-1097

Conversation

@Debugger022
Copy link
Copy Markdown
Contributor

@Debugger022 Debugger022 commented Apr 22, 2026

VIP-623 [BNB Chain] EBrake Executor Phase -1 Activation & Flux Campaign Funding

Bundles two BNB Chain actions from the Wk20 Weekly into a single on-chain proposal: (a) Phase -1 activation of the tighten-only EBrake Executor (VPD-925, venus-periphery#61) and (b) the Binance Wallet × Flux joint campaign funding (25,000 USDT from Venus Treasury).


Context


Description

[BNB Chain] EBrake Executor Contract — Phase -1 Activation

Context

The Executor is the validation layer between off-chain signal monitors and the EBrake contract. It validates parameter bounds on-chain and routes tightening actions to EBrake. The contract is tighten-only: it cannot raise LTV, raise caps, or unpause. All recovery actions go through a governance VIP.

Once activated, a signal that detects a breach (e.g. supply cap exceeded via oracle drift) invokes the Executor, which validates the current on-chain state and forwards the tightening call to EBrake within a single transaction — without VIP latency.

[BNB Chain] Binance Wallet × Flux Campaign Funding

Context

Venus is co-funding a joint campaign with Binance Wallet and Fluid Protocol (Flux) on BNB Chain. Funding flows to a shared multisig address; Fluid contributes the matching amount via their own treasury action, outside this VIP.

Field Value
From Venus Treasury
To 0xBE0EdB1F457334B8d2DfEb3627567137E745A00B
Token USDT
Amount 25,000 USDT
Partner contribution Fluid Protocol — 25,000 USDT to the same address (separate action)

Test plan

  • npx hardhat test simulations/vip-623/bscmainnet.ts --fork bscmainnet100 passing locally
  • yarn tsc --noEmit — clean
  • Verify on-chain post-execution: 13 RoleGranted, 2 OwnershipTransferred, 35 MarketConfigSet, 25k USDT delta on Treasury & Flux wallet

Wires the Phase -1 Executor contract between off-chain signal monitors
and EBrake. Grants monitor perms on Executor action handlers, Executor
perms on EBrake, and Normal Timelock perm on setMarketConfig. Mainnet
and testnet scaffolds with shared perm arrays imported from the VIP for
single source of truth.
@Debugger022 Debugger022 self-assigned this Apr 22, 2026
- `handleSupplyHalt` → `handleSupplyCapExceeding` (orphaned role:
  no such function on Executor)
- `handleBorrowHalt` → `handleBorrowCapExceeding` (same)
- `setMarketConfig` tuple: 6-field phantom → 3-field
  `(minBorrowCap, minSupplyCap, enabled)` matching
  IExecutor.MarketConfig
- Broaden `setMarketConfig` grant from Normal-only to Guardian +
  all three timelocks
@Debugger022 Debugger022 marked this pull request as ready for review April 23, 2026 05:02
@Debugger022 Debugger022 changed the title [VPD-1097]: add VIP-701 to configure tighten-only Executor on BSC [VPD-1097]: add Phase1 Executor permission grant - BSC mainnet Apr 23, 2026
@Debugger022 Debugger022 changed the title [VPD-1097]: add Phase1 Executor permission grant - BSC mainnet [VPD-1097]: add Phase1 Executor permission grant - BSC mainnet & Testnet Apr 23, 2026
...[GUARDIAN, NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK, CRITICAL_TIMELOCK].flatMap(account =>
EXECUTOR_GOVERNANCE_PERMS.map(sig => giveCallPermission(EXECUTOR, sig, account)),
),
],
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.

lets also add setMarketConfig for all the asset on bsc

  • minBorrowCap / minSupplyCap = 0
  • enable

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We ACK'd [I04] Missing zero value check on minBorrowCap and minSupplyCap in setMarketConfig
assuming governance wouldn't set zero floors — setting minBorrowCap = 0 / minSupplyCap = 0 here is exactly that misconfiguration.

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.

lets 20% of current cap then (monitoring side is 50%)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Setting minSupplyCap/minBorrowCap to any non-zero value below current usage doesn't close the path either — a keeper can drive cap to N via handleCapAdjust (N < N is false → passes), then supplyUnderlying < N is false on any active market, so the halt fires the same way. Only a floor above current usage would block this, which defeats handleCapAdjust's purpose — so keeping it at 0 is consistent with our [I04] ACK.

Copy link
Copy Markdown
Contributor

@fred-venus fred-venus May 15, 2026

Choose a reason for hiding this comment

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

20% of caps below (post-VIP-622 where applicable, current on-chain caps otherwise). Source: VIP-622 actual code in #706 + Comptroller.supplyCaps/borrowCaps on BSC.

Asset 20% Supply 20% Borrow
AAVE 4K 600
ADA 3M 600K
asBNB 43.2K 0
BCH 1K 200
BNB 534K 402K
BTCB 4.55K 706
Cake 4.8M 3.84M
DAI 2.78M 1.5M
DOGE 16M 600K
DOT 240K 80K
ETH 14.4K 7.4K
FDUSD 7.4M 4M
LINK 80K 4K
lisUSD 1M 800K
LTC 10K 1.6K
PT-clisBNB-25JUN2026 5K 0
PT-sUSDE-26JUN2025 400K 0
slisBNB 400 0
SOL 14.4K 3.6K
SolvBTC 600 4
sUSDe 800K 0
TRX 600K 200K
TWT 400K 10K
U 42M 42M
UNI 440K 40K
USD1 1M 800K
USDC 72M 64.8M
USDe 400K 320K
USDT 120M 90M
WBNB 534K 402K
wBETH 8K 200
XAUM 40 0
XRP 1.5M 200K
xSolvBTC 240 0
XVS 370K 0

All values in underlying units (DOGE 8 dp, TRX 6 dp, others 18 dp).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed setting minBorrowCap / minSupplyCap to 20% of current cap per asset

@fred-venus
Copy link
Copy Markdown
Contributor

fred-venus commented May 15, 2026

also one more from ai:

Executor acceptOwnership missing. cast call shows owner()=0x8D43F1776B…0cd9A (deployer EOA), pendingOwner()=0x939bD8…6396 (Normal
  Timelock). setAccessControlManager(address) is onlyOwner — until Normal Timelock accepts, the deployer EOA can repoint Executor's ACM and bypass every gate
  this VIP installs. Add target=EXECUTOR, sig="acceptOwnership()" to the actions array, or have the timelock accept ownership in a prior VIP.

@fred-venus
Copy link
Copy Markdown
Contributor

also one more from ai:

Executor acceptOwnership missing. cast call shows owner()=0x8D43F1776B…0cd9A (deployer EOA), pendingOwner()=0x939bD8…6396 (Normal
  Timelock). setAccessControlManager(address) is onlyOwner — until Normal Timelock accepts, the deployer EOA can repoint Executor's ACM and bypass every gate
  this VIP installs. Add target=EXECUTOR, sig="acceptOwnership()" to the actions array, or have the timelock accept ownership in a prior VIP.

in terms of this i also checked Ebrake, it has same issue, lets call acceptOwner for ebrake as well

@fred-venus
Copy link
Copy Markdown
Contributor

fred-venus commented May 15, 2026

One last from marketing team: since this is gonna be proposed as weekly vip, we would like to add one more cmd:

lets transfer 25k usdt from our treasury to flux marketing address i.e. 0xBE0EdB1F457334B8d2DfEb3627567137E745A00B (its a multisig we shared with fluid team)

This is gonna be used for incoming marketing campaign

- Add a hardhat script that snapshots BSC core-pool markets and
  writes per-market 20% borrow/supply floors to coreMarketCaps.json
- VIP imports the snapshot and emits one setMarketConfig per listed
  market instead of zero defaults
- Simulation diffs every entry against the JSON so floors can't
  silently drift between snapshot and execution
Copy link
Copy Markdown
Contributor

@fred-venus fred-venus May 15, 2026

Choose a reason for hiding this comment

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

This seems directly from the script, but not factoring this in-queue vip i.e. https://venus.io/#/governance/proposal/622?chainId=1

i think we can remove:

  1. fil, tusd, the, busd, sxp, matic, tusdold,trxold, beth

also quite a few assets we've decreased their cap in vip622, so the 20% should be def lower, i will suggest take my above comment as a ref

Copy link
Copy Markdown
Contributor Author

@Debugger022 Debugger022 May 15, 2026

Choose a reason for hiding this comment

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

- Add vip622Overrides.json hardcoding 20% floors for the 19 markets
  PR #706 right-sizes but hasn't yet executed on-chain
- VIP merges overrides over the script snapshot per address, with a
  per-market source tag so reviewers can see at a glance which floors
  came from live state vs the VIP-622 hardcode
- Unblocks publishing VIP-701 without waiting for VIP-622 to land
- Script imports marketCapChanges / delistAssets from
  vips/vip-622/data/bscmainnet.ts directly; the
  hand-transcribed vip622Overrides.json is removed so any
  upstream edit flows through on the next run.
- Pipeline drops markets whose 20% floors round to zero,
  removing BUSD / SXP / MATIC / TUSDOLD / TRXOLD / BETH /
  FIL / TUSD / THE from the config set.
- VIP iterates the baked coreMarketCaps.json with no in-VIP
  merge logic; capSource on each entry is the audit trail.
- Simulation pre-executes VIP-622 and asserts each Executor
  floor equals 20% of the live post-VIP-622 cap, and
  validates every skipped market against its reason.
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