Skip to content

Commit

Permalink
Add eigendaservice manager
Browse files Browse the repository at this point in the history
  • Loading branch information
gianbelinche committed Jan 7, 2025
1 parent 4a5a54f commit b25f258
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ pragma solidity 0.8.24;
import {IEigenDABridge} from "./IEigenDABridge.sol";
import {IImplementation} from "./IImplementation.sol";
import {DummyImplementation} from "./DummyImplementation.sol";
import {IEigenDABatchMetadataStorage} from "@eigenda/eigenda-utils/interfaces/IEigenDABatchMetadataStorage.sol";

contract DummyEigenDABridge is IEigenDABridge {
IImplementation public implementationContract;
IEigenDABatchMetadataStorage public eigenDaServiceManager;

constructor() {
constructor(address _eigenDaServiceManager) {
implementationContract = new DummyImplementation();
eigenDaServiceManager = IEigenDABatchMetadataStorage(_eigenDaServiceManager);
}

function implementation() external view returns (IImplementation) {
Expand All @@ -25,6 +28,7 @@ contract DummyEigenDABridge is IEigenDABridge {
// Inspired by eigenlayer contracts Merkle.verifyInclusionKeccak
// https://github.com/Layr-Labs/eigenlayer-contracts/blob/3f3f83bd194b3bdc77d06d8fe6b101fafc3bcfd5/src/contracts/libraries/Merkle.sol
bytes32 hashedBatchMetadata = this.hashBatchMetadata(merkleProof.blobVerificationProof.batchMetadata);
require(hashedBatchMetadata == IEigenDABatchMetadataStorage(eigenDaServiceManager).batchIdToBatchMetadataHash(merkleProof.blobVerificationProof.batchId), "invalid batch metadata");

Check failure on line 31 in da-contracts/contracts/da-layers/eigenda/DummyEigenDABridge.sol

View workflow job for this annotation

GitHub Actions / lint

GC: Use Custom Errors instead of require statements

Check failure on line 31 in da-contracts/contracts/da-layers/eigenda/DummyEigenDABridge.sol

View workflow job for this annotation

GitHub Actions / lint

GC: Use Custom Errors instead of require statements

Check failure on line 31 in da-contracts/contracts/da-layers/eigenda/DummyEigenDABridge.sol

View workflow job for this annotation

GitHub Actions / lint

GC: Use Custom Errors instead of require statements
uint256 index = merkleProof.blobVerificationProof.blobIndex;
bytes memory inclusionProof = merkleProof.blobVerificationProof.inclusionProof;
require(inclusionProof.length % 32 == 0, "proof length not multiple of 32");

Check failure on line 34 in da-contracts/contracts/da-layers/eigenda/DummyEigenDABridge.sol

View workflow job for this annotation

GitHub Actions / lint

GC: Use Custom Errors instead of require statements

Check failure on line 34 in da-contracts/contracts/da-layers/eigenda/DummyEigenDABridge.sol

View workflow job for this annotation

GitHub Actions / lint

GC: Use Custom Errors instead of require statements

Check failure on line 34 in da-contracts/contracts/da-layers/eigenda/DummyEigenDABridge.sol

View workflow job for this annotation

GitHub Actions / lint

GC: Use Custom Errors instead of require statements
Expand Down
3 changes: 2 additions & 1 deletion l1-contracts/deploy-scripts/DeployL1.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ contract DeployL1Script is Script, DeployUtils {
}

if (config.contracts.eigenDAL1Validator == address(0)) {
address eigendaBridge = deployViaCreate2(Utils.readDummyEigenDABridgeBytecode(), "");
address eigenDAServiceManagerAddress = address(0);
address eigendaBridge = deployViaCreate2(Utils.readDummyEigenDABridgeBytecode(), abi.encode(eigenDAServiceManagerAddress));
addresses.daAddresses.eigenDAL1Validator = deployViaCreate2(
Utils.readEigenDAL1ValidatorBytecode(),
abi.encode(eigendaBridge)
Expand Down

0 comments on commit b25f258

Please sign in to comment.