This package has been deprecated

Author message:

Please, use @vocdoni/storage-proofs instead

@dvote/storage-proofs
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

DVote 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 @dvote/storage-proofs
const tokenAddress = "0x1234..."
const holderAddress = "0x2345..."
const balancePositionIdx = 1

const balanceSlot = ERC20Prover.getHolderBalanceSlot(holderAddress, balancePositionIdx)

const storageProover = new ERC20Prover(jsonRpcUri)
const data = await storageProover.getProof(tokenAddress, [balanceSlot], blockNumber, true)

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

// ...

Readme

Keywords

none

Package Sidebar

Install

npm i @dvote/storage-proofs

Weekly Downloads

1

Version

0.1.1

License

GPL-3.0-or-later

Unpacked Size

57.4 kB

Total Files

16

Last publish

Collaborators

  • 0xme
  • dappfuse
  • divdevdoe
  • xavivives