Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

30 Commits

Folders and files

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

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

$ cargo run --release

Make sure to set the enviroment variables in .env before running the script.

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

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages