Skip to content

[VPD-1134] add EBrake and Sentinel deployments for ethereum, arbitrumone, basemainnet#65

Merged
fred-venus merged 17 commits into
developfrom
feat/VPD-1134
May 3, 2026
Merged

[VPD-1134] add EBrake and Sentinel deployments for ethereum, arbitrumone, basemainnet#65
fred-venus merged 17 commits into
developfrom
feat/VPD-1134

Conversation

@Debugger022
Copy link
Copy Markdown
Contributor

Summary

  • Deploy scripts previously only supported BSC where Unitroller and NormalTimelock exist as local artifacts; IL chains (ethereum, arbitrumone, basemainnet and all others) need these resolved from isolated-pools and oracle package deployments
  • Ownable2Step contracts caused transferOwnership to re-run on every deploy since owner() never changes until the timelock calls acceptOwnership; fixed by checking pendingOwner before sending
  • Sentinel deploy script was missing post-deploy verification calls, leaving implementations unverified on explorers

Changes

helpers/deploymentConfig.ts

  • Added isolated-pools and oracle package imports for all 14 IL networks
  • Added Unitroller (→ Comptroller_Core) and ResilientOracle to preconfiguredAddresses for all non-BSC networks

deploy/2-deploy-ebrake.ts

  • Fall back to preconfiguredAddresses.Unitroller / NormalTimelock when local deployment artifact returns zero address
  • Guard transferOwnership with pendingOwner !== timelock to prevent redundant txs on re-runs

deploy/1-deploy-sentinel.ts

  • Add verify:verify call after each newlyDeployed contract
  • Guard all transferOwnership calls with pendingOwner check (same Ownable2Step fix)

deployments/

  • Ethereum: EBrake, PancakeSwapOracle, UniswapOracle, SentinelOracle, DeviationSentinel
  • Arbitrum One: same set
  • Base Mainnet: same set

Test plan

  • npx hardhat deploy --tags ebrake --network ethereum → should print "reusing" for all contracts
  • npx hardhat deploy --tags sentinel --network ethereum → should print "reusing", no ownership transfer tx sent
  • Verify proxy addresses on Etherscan/Arbiscan/Basescan match artifacts in deployments/
  • Confirm implementations are verified on block explorers (all flagged ✓ during this deployment)

Non-BSC networks have no local Unitroller artifact; resolve comptroller
and ResilientOracle from isolated-pools and oracle package deployments.
Fix Ownable2Step transferOwnership re-running on every deploy by checking
pendingOwner. Add post-deploy implementation verification for all Sentinel
contracts.
@Debugger022 Debugger022 self-assigned this Apr 28, 2026
Debugger022 and others added 2 commits April 28, 2026 13:27
verification tasks throw HardhatNetworkNotSupportedError when running
against the local hardhat network; gate all verify:verify calls behind
network.live.
@Debugger022 Debugger022 marked this pull request as ready for review April 29, 2026 10:14
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

Enables eBTC/WBTC pricing via Curve's built-in EMA price oracle,
avoiding the need to deploy a separate TWAP. Price direction verified
empirically against the live eBTC/WBTC pool on Ethereum mainnet.
Aerodrome Slipstream slot0() returns 6 values (no feeProtocol),
incompatible with IUniswapV3Pool. Adds a dedicated interface and
oracle contract with identical sqrtPriceX96 math.
Debugger022 and others added 9 commits April 30, 2026 13:27
… price

EMA price_oracle smooths out manipulation, defeating the sentinel's purpose
of detecting short-term on-chain price deviations. get_dy returns the
instantaneous swap output, reflecting the current pool state. Also adds
refCoinIndex to config for N-coin pool support and explicit decimal params
to avoid per-call STATICCALL overhead.
…setDecimals

refDecimals cancel out in the derivation — the correct divisor is 10^assetDecimals,
not 10^refDecimals. Both are equivalent for same-decimal pairs (eBTC/WBTC) but
diverge by 10^(refDecimals-assetDecimals) for cross-decimal pools. Also removes
refDecimals from PoolConfig and setPoolConfig since it is not needed.
Redeploy CurveOracle implementation with the corrected pricing formula
(dy * refPriceUsd / 10^assetDecimals). upgradeAndCall was re-invoking
initialize on an already-initialized proxy — fix by checking for existing
proxy and omitting execute block on upgrades so ProxyAdmin.upgrade() is
used instead.
[VPD-1118][VPD-1141] add CurveOracle and AerodromeSlipstreamOracle
@github-actions
Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Health
contracts 100% 100%
contracts.DeviationSentinel 100% 100%
contracts.DeviationSentinel.Oracles 96% 93%
contracts.EmergencyBrake 0% 0%
contracts.Interfaces 100% 100%
contracts.LeverageManager 94% 80%
contracts.Libraries 29% 33%
contracts.PositionSwapper 0% 0%
contracts.RelativePositionManager 91% 64%
contracts.SwapHelper 100% 100%
contracts.SwapRouter 79% 55%
contracts.pendle-pt-fixed-rate-vault 0% 0%
contracts.pendle-pt-fixed-rate-vault.interfaces 100% 100%
contracts.pendle-pt-fixed-rate-vault.test 0% 0%
Summary 64% (942 / 1471) 50% (467 / 934)

@fred-venus
Copy link
Copy Markdown
Contributor

lgtm

@fred-venus fred-venus merged commit c2e9787 into develop May 3, 2026
4 checks passed
Debugger022 pushed a commit that referenced this pull request May 14, 2026
## 1.2.0-dev.8 (2026-05-03)

* Merge pull request #65 from VenusProtocol/feat/VPD-1134 ([c2e9787](c2e9787)), closes [#65](#65)
* Merge pull request #66 from VenusProtocol/feat/VPD-1118 ([cbbda88](cbbda88)), closes [#66](#66)
* feat: add deviation + ebrake deployments on sepolia ([0389cda](0389cda))
* feat: updating deployment files ([d4cd975](d4cd975))
* feat: updating deployment files ([8945c6d](8945c6d))
* feat: updating deployment files ([89d841e](89d841e))
* feat(deploy): enable EBrake and Sentinel deployment on IL chains ([7fa889a](7fa889a))
* feat(sentinel): add AerodromeSlipstreamOracle for Base ([fa10f6a](fa10f6a))
* feat(sentinel): add CurveOracle for Curve StableSwap-NG pools ([a2aee7c](a2aee7c))
* fix(CurveOracle): correct pricing formula to dy * refPriceUsd / 10^assetDecimals ([169d45c](169d45c))
* fix(deploy): skip contract verification on hardhat network ([9994306](9994306))
* fix(deploy): upgrade CurveOracle impl and fix re-init revert on upgrades ([2c48a8e](2c48a8e))
* fix(deploy): use OptimizedTransparentProxy pattern to fix uninitialized proxy ([8df7c69](8df7c69))
* chore(deployments): add AerodromeSlipstreamOracle deployment for basemainnet ([69527f1](69527f1))
* chore(deployments): add CurveOracle deployment for ethereum ([af7c831](af7c831))
* chore(deployments): add EBrake and Sentinel deployments for ethereum, arbitrumone, basemainnet ([b22c64e](b22c64e))
* chore(deployments): redeploy CurveOracle proxy on ethereum with new impl ([72a5ffa](72a5ffa))
* refactor(CurveOracle): use get_dy instead of price_oracle for instant price ([16e577a](16e577a))
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