0.4.1 • Published 4 years ago

@vocdoni/storage-proofs-eth v0.4.1

Weekly downloads
43
License
GPL-3.0-or-later
Repository
github
Last release
4 years ago

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)

// ...
0.4.1

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago