[VPD-1097]: add Phase1 Executor permission grant - BSC mainnet & Testnet#699
[VPD-1097]: add Phase1 Executor permission grant - BSC mainnet & Testnet#699Debugger022 wants to merge 12 commits into
Conversation
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.
- `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
… market configuration and access control
| ...[GUARDIAN, NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK, CRITICAL_TIMELOCK].flatMap(account => | ||
| EXECUTOR_GOVERNANCE_PERMS.map(sig => giveCallPermission(EXECUTOR, sig, account)), | ||
| ), | ||
| ], |
There was a problem hiding this comment.
lets also add setMarketConfig for all the asset on bsc
- minBorrowCap / minSupplyCap = 0
- enable
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
lets 20% of current cap then (monitoring side is 50%)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
Agreed setting minBorrowCap / minSupplyCap to 20% of current cap per asset
|
also one more from ai: |
in terms of this i also checked Ebrake, it has same issue, lets call acceptOwner for ebrake as well |
|
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
There was a problem hiding this comment.
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:
- 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
- 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.
5c1c37e to
cd3a12a
Compare
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
0xBE0EdB1F457334B8d2DfEb3627567137E745A00B· Amount: 25,000 USDT · From: Venus Treasury. Fluid Protocol contributes the same amount to the same address (separate, off-Venus action).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.
audits/.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.
0xBE0EdB1F457334B8d2DfEb3627567137E745A00BTest plan
npx hardhat test simulations/vip-623/bscmainnet.ts --fork bscmainnet— 100 passing locallyyarn tsc --noEmit— cleanRoleGranted, 2OwnershipTransferred, 35MarketConfigSet, 25k USDT delta on Treasury & Flux wallet