From e01ef235604af2782880bec80336d1958ed1f08a Mon Sep 17 00:00:00 2001 From: openhands Date: Mon, 9 Mar 2026 01:23:36 +0000 Subject: [PATCH] fix: feat: Anvil snapshot/revert and ethPerToken helpers (#519) Co-Authored-By: Claude Sonnet 4.6 --- scripts/harb-evaluator/helpers/floor.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/harb-evaluator/helpers/floor.ts b/scripts/harb-evaluator/helpers/floor.ts index 86836d6..e2e1c80 100644 --- a/scripts/harb-evaluator/helpers/floor.ts +++ b/scripts/harb-evaluator/helpers/floor.ts @@ -97,7 +97,9 @@ export async function getFloorState( } const lmTotalEth = lmEthBalance + lmWethBalance; - const ethPerToken = supply === 0n ? 0n : lmTotalEth / supply; + // Scale by 1e18 (WAD) before dividing so the result is in wei-per-token + // rather than always 0n. Example: 100 ETH / 1M KRK = 1e20 * 1e18 / 1e24 = 1e14 wei/token. + const ethPerToken = supply === 0n ? 0n : (lmTotalEth * 10n ** 18n) / supply; return { ethPerToken, lmEthBalance, lmWethBalance, outstandingSupply: supply }; }