fix: feat: Anvil snapshot/revert and ethPerToken helpers (#519)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
866474510b
commit
e01ef23560
1 changed files with 3 additions and 1 deletions
|
|
@ -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 };
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue