|
| 1 | +// SPDX-License-Identifier: MIT |
| 2 | +pragma solidity =0.8.12; |
| 3 | + |
| 4 | +import {EigenDACertVerifierV1} from "src/periphery/cert/v1/EigenDACertVerifierV1.sol"; |
| 5 | +import {RegistryCoordinator} from "lib/eigenlayer-middleware/src/RegistryCoordinator.sol"; |
| 6 | +import {IRegistryCoordinator} from "lib/eigenlayer-middleware/src/interfaces/IRegistryCoordinator.sol"; |
| 7 | +import {OperatorStateRetriever} from "lib/eigenlayer-middleware/src/OperatorStateRetriever.sol"; |
| 8 | +import {EigenDAServiceManager} from "src/core/EigenDAServiceManager.sol"; |
| 9 | +import {IEigenDAServiceManager} from "src/core/interfaces/IEigenDAServiceManager.sol"; |
| 10 | +import {EigenDAThresholdRegistry} from "src/core/EigenDAThresholdRegistry.sol"; |
| 11 | +import {IEigenDAThresholdRegistry} from "src/core/interfaces/IEigenDAThresholdRegistry.sol"; |
| 12 | +import {IEigenDABatchMetadataStorage} from "src/core/interfaces/IEigenDABatchMetadataStorage.sol"; |
| 13 | +import "forge-std/Test.sol"; |
| 14 | +import "forge-std/Script.sol"; |
| 15 | +import "forge-std/StdJson.sol"; |
| 16 | +import {EigenDATypesV1 as DATypesV1} from "src/core/libraries/v1/EigenDATypesV1.sol"; |
| 17 | + |
| 18 | +//forge script script/deploy/certverifier/CertVerifierDeployerV1.s.sol:CertVerifierDeployerV1 --sig "run(string, string)" <config.json> <output.json> --rpc-url $RPC --private-key $PRIVATE_KEY -vvvv --etherscan-api-key $ETHERSCAN_API_KEY --verify --broadcast |
| 19 | +contract CertVerifierDeployerV1 is Script, Test { |
| 20 | + address eigenDACertVerifier; |
| 21 | + |
| 22 | + address eigenDAServiceManager; |
| 23 | + address eigenDAThresholdRegistry; |
| 24 | + |
| 25 | + function run(string memory inputJSONFile, string memory outputJSONFile) external { |
| 26 | + string memory path = string.concat("./script/deploy/certverifier/config/", inputJSONFile); |
| 27 | + string memory data = vm.readFile(path); |
| 28 | + |
| 29 | + bytes memory raw = stdJson.parseRaw(data, ".eigenDAServiceManager"); |
| 30 | + eigenDAServiceManager = abi.decode(raw, (address)); |
| 31 | + |
| 32 | + raw = stdJson.parseRaw(data, ".eigenDAThresholdRegistry"); |
| 33 | + eigenDAThresholdRegistry = abi.decode(raw, (address)); |
| 34 | + |
| 35 | + vm.startBroadcast(); |
| 36 | + |
| 37 | + eigenDACertVerifier = address( |
| 38 | + new EigenDACertVerifierV1( |
| 39 | + IEigenDAThresholdRegistry(eigenDAThresholdRegistry), IEigenDABatchMetadataStorage(eigenDAServiceManager) |
| 40 | + ) |
| 41 | + ); |
| 42 | + |
| 43 | + vm.stopBroadcast(); |
| 44 | + |
| 45 | + console.log("Deployed new EigenDACertVerifierV1 at address: ", eigenDACertVerifier); |
| 46 | + |
| 47 | + string memory outputPath = string.concat("./script/deploy/certverifier/output/", outputJSONFile); |
| 48 | + string memory parent_object = "parent object"; |
| 49 | + string memory finalJson = |
| 50 | + vm.serializeAddress(parent_object, "eigenDACertVerifier", address(eigenDACertVerifier)); |
| 51 | + vm.writeJson(finalJson, outputPath); |
| 52 | + } |
| 53 | +} |
0 commit comments