Skip to content

succinctlabs/eigenlayer-beacon-oracle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Eigenlayer Beacon Oracle

This repository contains the smart contract for the Eigenlayer Beacon Oracle. It uses the beacon roots precompile added in EIP-4788 to find the block root for a given timestamp.

Deployments

Currently, the Eigenlayer Beacon Oracle is deployed on the following chains:

Example transaction:

Contracts

To deploy the contract on a chain, run the following command:

$ cd contracts
$ forge script script/DeployEigenLayerBeaconOracle.s.sol:DeployEigenLayerBeaconOracle --rpc-url <RPC_URL> --private-key <PRIVATE_KEY> --verifier etherscan --etherscan-api-key <ETHERSCAN_API_KEY> --verify --broadcast

Operator Script

Make sure to set the enviroment variables in .env before running the operator. If you're planning to self-relay (not use the Succinct relayer), set RELAYER_PRIVATE_KEY in .env.

To run the script which periodically updates the oracle, run the following command:

$ RUST_LOG=info cargo run --bin operator --release

Cost

To get the Ethereum block corresponding to a date, do the following:

To compute the cost of requesting beacon block roots over the past month, run the following command:

cargo run --bin cost -- --rpc-url <RPC_URL> --relayer-address <RELAYER_ADDRESS> --contract-address <CONTRACT_ADDRESS> --start-timestamp <START_TIMESTAMP> --end-timestamp <END_TIMESTAMP>

Ex. To get the total costs from relayer on Mainnet, run the following:

cargo run --bin cost -- --rpc-url <MAINNET_RPC_URL> --relayer-address 0x44eB418A966ff47f5AF6f48AEa6Afde0bf193a8d --contract-address 0x343907185b71adf0eba9567538314396aa985442 --start-timestamp 2024-03-01T00:00:00+00:00 --end-timestamp 2024-04-01T00:00:00+00:00

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published