Skip to content

berachain/eip-4788-proof

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EIP-4788 proofs verification

A set of scripts and on-chain code to use EIP-4788 block root to prove specific properties of CL blocks.

Usage

Obtain proofs

cd script
yarn install

# Provide an address of a CL API endpoint.
export BEACON_NODE_URL=http://127.0.0.1:5052
node withdrawal.js
node validator.js

Look into the corresponding scripts and modify the required values such as slot, validator index, withdrawal index.

The scripts output the data required too make a proof verifiable onchain with the contracts presented in this repository. See tests for example usage.

The provided scripts were used to create fixtures for the tests.

Tests

Foundry tests read JSON files fixtures and use the contracts from the repository to accepts proofs.

forge test

To run forked tests, provide FORK_URL environment variable. Currently, the Goerli is the only public network supporting EIP-4788.

FORK_URL=http://127.0.0.1:8545 forge test --mt Fork

Gas Snapshots

$ forge snapshot

About

EIP-4788 proofs verification

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 77.2%
  • JavaScript 22.8%