Skip to content

fix: reject zero scale factor#118

Closed
prd-carapulse[bot] wants to merge 3 commits into
mainfrom
hermes/certora-scale-factor-nonzero
Closed

fix: reject zero scale factor#118
prd-carapulse[bot] wants to merge 3 commits into
mainfrom
hermes/certora-scale-factor-nonzero

Conversation

@prd-carapulse

@prd-carapulse prd-carapulse Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Reject zero SCALE_FACTOR values after the constructor's integer division.
  • Add a Certora harness/spec proving scaleFactorCannotBeZero for every successful MorphoChainlinkOracleV2 deployment.
  • Add a Certora GitHub Actions workflow plus a focused Forge regression test for a config that previously rounded the scale factor to zero.

Request Context

  • Initiator: Mathis / Slack: <@U02NB58F6R3> / GitHub: @MathisGD
  • Initial Slack thread: C0B520ZTPJM / 1781506867.952699
  • Additional context: requested a PR in morpho-org/morpho-blue-oracles to prove with Certora that the scale factor cannot be zero.
  • Rationale: prevent successful oracle deployments with a zero price scale factor.

Test Plan

  • forge fmt --check
  • forge build --force
  • forge build --contracts certora/helpers/MorphoChainlinkOracleV2Harness.sol --force
  • forge test --match-path test/MorphoChainlinkOracleV2ScaleFactorTest.sol -vvv
  • certoraCVLFormatter certora/specs/MorphoChainlinkOracleV2.spec
  • jq < certora/confs/MorphoChainlinkOracleV2.conf
  • certoraRun certora/confs/MorphoChainlinkOracleV2.conf --compilation_steps_only
  • Certora GitHub Actions workflow remote proof with CERTORAKEY

Requested by: <@U02NB58F6R3>

Reject zero scale factors and add the Certora scaleFactorCannotBeZero proof.
prd-carapulse Bot added 2 commits June 15, 2026 07:23
Require the harness deployment to succeed before asserting on the returned scale factor.
Refactor scale factor computation into an internal helper and make the Certora harness verify the exact successful helper computation.
@MathisGD MathisGD closed this Jun 15, 2026
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.

1 participant