New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@vocdoni/storage-proofs-eth

Package Overview
Dependencies
Maintainers
5
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vocdoni/storage-proofs-eth

Javascript/Typescript library to generate storage proofs for ERC token contracts

latest
Source
npmnpm
Version
0.4.1
Version published
Weekly downloads
27
-40%
Maintainers
5
Weekly downloads
 
Created
Source

Storage Proofs

Javascript/Typescript library to generate storage proofs for ERC token contracts.

The library is heavily inspired on the prior work of @izqui on evm-storage-proofs.

Usage

Instal with NPM:

npm install @vocdoni/storage-proofs-eth
const tokenAddress = "0x1234..."
const holderAddress = "0x2345..."
const balancePositionIdx = 1

const balanceSlot = ERC20Proof.getHolderBalanceSlot(holderAddress, balancePositionIdx)

const result = await ERC20Proof.get(tokenAddress, [balanceSlot], blockNumber, jsonRpcUri)

const { proof, block, blockHeaderRLP, accountProofRLP, storageProofsRLP } = result

// Throws if not valid
await ERC20Proof.verify(block.stateRoot, tokenAddress, proof)

// ...

FAQs

Package last updated on 20 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts