Skip to content

Commit

Permalink
Add ownable to verifier
Browse files Browse the repository at this point in the history
  • Loading branch information
gianbelinche committed Sep 30, 2024
1 parent 5715277 commit aec2b24
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions l1-contracts/contracts/eigenda/EigenDAVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,30 @@ pragma solidity ^0.8.9;

import {EigenDARollupUtils} from "@eigenda/eigenda-utils/libraries/EigenDARollupUtils.sol";
import {IEigenDAServiceManager} from "@eigenda/eigenda-utils/interfaces/IEigenDAServiceManager.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

Check failure on line 6 in l1-contracts/contracts/eigenda/EigenDAVerifier.sol

View workflow job for this annotation

GitHub Actions / lint

global import of path @openzeppelin/contracts/access/Ownable.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)

Check failure on line 6 in l1-contracts/contracts/eigenda/EigenDAVerifier.sol

View workflow job for this annotation

GitHub Actions / lint

global import of path @openzeppelin/contracts/access/Ownable.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)

Check failure on line 6 in l1-contracts/contracts/eigenda/EigenDAVerifier.sol

View workflow job for this annotation

GitHub Actions / lint

global import of path @openzeppelin/contracts/access/Ownable.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)

contract EigenDAVerifier {
contract EigenDAVerifier is Ownable {

struct BlobInfo {
IEigenDAServiceManager.BlobHeader blobHeader;
EigenDARollupUtils.BlobVerificationProof blobVerificationProof;
}

IEigenDAServiceManager public immutable EIGEN_DA_SERVICE_MANAGER;
IEigenDAServiceManager public EIGEN_DA_SERVICE_MANAGER;

constructor(address _eigenDAServiceManager) {
constructor(address _initialOwner, address _eigenDAServiceManager) {
_transferOwnership(_initialOwner);
EIGEN_DA_SERVICE_MANAGER = IEigenDAServiceManager(_eigenDAServiceManager);
}

function setServiceManager(address _eigenDAServiceManager) external onlyOwner {
EIGEN_DA_SERVICE_MANAGER = IEigenDAServiceManager(_eigenDAServiceManager);
}

function verifyBlob(
BlobInfo calldata blobInfo
) external view {
require(address(EIGEN_DA_SERVICE_MANAGER) != address(0), "EigenDAVerifier: EIGEN_DA_SERVICE_MANAGER not set");
EigenDARollupUtils.verifyBlob(blobInfo.blobHeader, EIGEN_DA_SERVICE_MANAGER, blobInfo.blobVerificationProof);
}
}
2 changes: 1 addition & 1 deletion l1-contracts/deploy-scripts/DeployL1.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ contract DeployL1Script is Script {
function deployEigenDAVerifier() internal {
bytes memory bytecode = abi.encodePacked(
type(EigenDAVerifier).creationCode,
abi.encode(config.contracts.eigenServiceManager)
abi.encode(config.deployerAddress,config.contracts.eigenServiceManager)
);
address contractAddress = deployViaCreate2(bytecode);
console.log("EigenDAVerifier deployed at:", contractAddress);
Expand Down

0 comments on commit aec2b24

Please sign in to comment.