Skip to content

Uday9316/SnapShot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NFT Owner Snapshot

On-chain NFT holder snapshot using ownerOf() for Ethereum and Monad.

1) CLI mode (config in code)

Set values in snap.js under DEFAULTS:

  • chain
  • contractAddress
  • optional manual range

Fixed RPCs:

  • Ethereum: https://eth.llamarpc.com
  • Monad: https://rpc.monad.xyz

Output format:

  • snapshot.txt with one line per holder: address,count

Then run:

npm install
node snap.js

2) Frontend mode (shadcn-style UI)

Run the web app:

cd frontend
npm install
npm run dev

Then open the local URL shown by Vite and run snapshots from UI. UI behavior:

  • user enters only contract + chain
  • app auto-uses fixed RPC and fixed concurrency
  • app auto-downloads snapshot-<chain>.txt (address,count)

3) Lens Contract (optional validation speed-up)

Contract source: contracts/NFTLens.sol

  • Use it for small batched validation checks (ownersOf) after snapshot
  • Full snapshot still uses transfer-log indexing

Frontend:

  • paste deployed lens address in Lens Contract Address
  • click Validate Sample (30) to compare indexed owners vs on-chain

CLI demo call:

node scripts/lens-demo.js --rpc https://eth.llamarpc.com --nft 0xYourNFT --lens 0xYourLens --ids 1,2,3,4,5

Deploy lens contracts:

  1. Add to .env:
DEPLOYER_PRIVATE_KEY=0xYOUR_PRIVATE_KEY
ETH_RPC_URL=https://eth.llamarpc.com
MONAD_RPC_URL=https://rpc.monad.xyz
  1. Install deps and deploy:
npm install
npm run deploy:lens -- --chain monad
# or
npm run deploy:lens -- --chain eth
# deploy ERC20 lens
npm run deploy:lens -- --chain monad --contract erc20
npm run deploy:lens -- --chain eth --contract erc20

Releases

Packages

Contributors

Languages