Skip to content

Commit

Permalink
Add deploy eigenda verifier
Browse files Browse the repository at this point in the history
  • Loading branch information
gianbelinche committed Sep 30, 2024
1 parent ebb9420 commit 6973094
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions l1-contracts/deploy-scripts/DeployL1.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {FeeParams, PubdataPricingMode} from "contracts/state-transition/chain-de
import {L1SharedBridge} from "contracts/bridge/L1SharedBridge.sol";
import {L1ERC20Bridge} from "contracts/bridge/L1ERC20Bridge.sol";
import {DiamondProxy} from "contracts/state-transition/chain-deps/DiamondProxy.sol";
import {EigenDAVerifier} from "contracts/eigenda/EigenDAVerifier.sol";

contract DeployL1Script is Script {
using stdToml for string;
Expand All @@ -50,6 +51,7 @@ contract DeployL1Script is Script {
address blobVersionedHashRetriever;
address validatorTimelock;
address create2Factory;
address eigendaVerifier;
}

struct BridgehubDeployedAddresses {
Expand Down Expand Up @@ -113,6 +115,7 @@ contract DeployL1Script is Script {
bytes diamondCutData;
bytes32 bootloaderHash;
bytes32 defaultAAHash;
address eigenServiceManager;
}

struct TokensConfig {
Expand All @@ -135,6 +138,7 @@ contract DeployL1Script is Script {
deployDefaultUpgrade();
deployGenesisUpgrade();
deployValidatorTimelock();
deployEigenDAVerifier();

deployGovernance();
deployChainAdmin();
Expand Down Expand Up @@ -209,6 +213,7 @@ contract DeployL1Script is Script {
config.contracts.bootloaderHash = toml.readBytes32("$.contracts.bootloader_hash");

config.tokens.tokenWethAddress = toml.readAddress("$.tokens.token_weth_address");
config.contracts.eigenServiceManager = toml.readAddress("$.contracts.eigen_service_manager");
}

function instantiateCreate2Factory() internal {
Expand Down Expand Up @@ -280,6 +285,16 @@ contract DeployL1Script is Script {
addresses.validatorTimelock = contractAddress;
}

function deployEigenDAVerifier() internal {
bytes memory bytecode = abi.encodePacked(
type(EigenDAVerifier).creationCode,
abi.encode(config.contracts.eigenServiceManager)
);
address contractAddress = deployViaCreate2(bytecode);
console.log("EigenDAVerifier deployed at:", contractAddress);
addresses.eigendaVerifier = contractAddress;
}

function deployGovernance() internal {
bytes memory bytecode = abi.encodePacked(
type(Governance).creationCode,
Expand Down Expand Up @@ -706,6 +721,7 @@ contract DeployL1Script is Script {
);
vm.serializeAddress("deployed_addresses", "validator_timelock_addr", addresses.validatorTimelock);
vm.serializeAddress("deployed_addresses", "chain_admin", addresses.chainAdmin);
vm.serializeAddress("deployed_addresses", "eigen_da_verifier", addresses.eigendaVerifier);
vm.serializeString("deployed_addresses", "bridgehub", bridgehub);
vm.serializeString("deployed_addresses", "state_transition", stateTransition);
string memory deployedAddresses = vm.serializeString("deployed_addresses", "bridges", bridges);
Expand Down

0 comments on commit 6973094

Please sign in to comment.