Skip to content

arnabmitra/vault-scan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Vault Scan

Read-only Sepolia scanner for the Hastra StakingVault.
Verifies that every PRIME mint and burn honours the oracle NAV published by HastraNavEngine.

What it prints

Section 1 — PRIME Mint/Burn vs NAV (columnar table)

For every Deposit and Withdraw in the window, fetches HastraNavEngine.getRate() at that exact block via eth_call and verifies:

Column Meaning
TIME Block timestamp (UTC)
TYPE Deposit or Withdraw
TX First 12 chars of tx hash
INPUT Deposit: wYLDS in; Withdraw: PRIME shares burned
ACTUAL Deposit: PRIME minted; Withdraw: wYLDS returned
NAV@BLOCK Oracle rate at that block (8 d.p.)
EXPECTED Computed from NAV — should equal ACTUAL
DRIFT `
STATUS OK or MISMATCH!

Tolerance: ±1 raw unit (≈ 0.000001 token) to absorb floor-division rounding.

Note on mismatches: The StakingVault calls getVerifiedNav() → FeedVerifier, which may apply additional rounding before returning the rate. A drift of a few units is expected if the FeedVerifier path differs from a raw getRate() call. Large drifts (>100 units) indicate a genuine oracle inconsistency.

Followed by totals: total PRIME minted, burned, net outstanding change.

Section 2 — NAV Rate History

Every RateUpdated event from HastraNavEngine in the window, showing rate (1e18), totalSupply (PRIME), totalTVL (wYLDS) at each update.

Section 3 — Other Events

PRIME mints/burns by the Transfer path, wYLDS transfers in/out, and RewardsDistributed.

Defaults

Env var Default
RPC_URL QuikNode Sepolia endpoint
VAULT_ADDRESS 0xFf22361Ca2590761A2429D4127b7FF25E79fdC04
YIELD_VAULT_ADDRESS 0x0258787Eb97DD01436B562943D8ca85B772D7b98
NAV_ENGINE_ADDRESS 0xBc494b33Cd67e8033644608876b10BB84d0eDF55
START_UTC last 24 hours (dynamic default)
END_UTC now (dynamic default)

Run

# Default: last 24 hours
cd /Users/arnabmitra/interview-prep
go run ./vault-scan

# Custom window
START_UTC=2026-04-13T00:00:00Z END_UTC=2026-04-15T00:00:00Z go run ./vault-scan

# Override network (e.g. Hoodi testnet)
NAV_ENGINE_ADDRESS=0x<hoodi-nav-engine> \
  VAULT_ADDRESS=0x<hoodi-staking-vault> \
  RPC_URL=https://... \
  go run ./vault-scan

Example output

RPC:        https://...
Vault:      0xff22361ca2...
Window:     2026-04-13T00:00:00Z  ->  2026-04-15T00:00:00Z
Blocks:     10647374  ->  10661323

================================================================================
 PRIME MINT / BURN  vs  NAV  -- each deposit/withdraw verified against oracle
================================================================================
 TIME                  TYPE      TX            INPUT             ACTUAL            NAV@BLOCK     EXPECTED          DRIFT       STATUS
-------------------------------------------------------------------------------------------------------------------------------------
 2026-04-14T18:48:12Z  Deposit   0xd84ca96bee~  20.000000         11.394870         1.75517575    11.394870         0.000000    OK
 2026-04-14T20:53:36Z  Deposit   0x29ca708c07~  5000.000000       2848.679928       1.75519894    2848.679928       0.000000    OK
-------------------------------------------------------------------------------------------------------------------------------------
 Total PRIME minted: 2860.074798         burned: 0.000000          net: 2860.074798
 All 2 mint/burn(s) match the oracle NAV

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages