-
Notifications
You must be signed in to change notification settings - Fork 238
CertVerifier Deployer #1302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
CertVerifier Deployer #1302
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
84 changes: 84 additions & 0 deletions
84
contracts/script/deploy/certverifier/CertVerifierDeployer.s.sol
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity =0.8.12; | ||
|
||
import {EigenDACertVerifier} from "src/core/EigenDACertVerifier.sol"; | ||
import {RegistryCoordinator} from "lib/eigenlayer-middleware/src/RegistryCoordinator.sol"; | ||
import {IRegistryCoordinator} from "lib/eigenlayer-middleware/src/interfaces/IRegistryCoordinator.sol"; | ||
import {OperatorStateRetriever} from "lib/eigenlayer-middleware/src/OperatorStateRetriever.sol"; | ||
import {EigenDAServiceManager} from "src/core/EigenDAServiceManager.sol"; | ||
import {IEigenDAServiceManager} from "src/interfaces/IEigenDAServiceManager.sol"; | ||
import {EigenDAThresholdRegistry} from "src/core/EigenDAThresholdRegistry.sol"; | ||
import {IEigenDAThresholdRegistry} from "src/interfaces/IEigenDAThresholdRegistry.sol"; | ||
import {IEigenDABatchMetadataStorage} from "src/interfaces/IEigenDABatchMetadataStorage.sol"; | ||
import {IEigenDASignatureVerifier} from "src/interfaces/IEigenDASignatureVerifier.sol"; | ||
import {EigenDARelayRegistry} from "src/core/EigenDARelayRegistry.sol"; | ||
import {IEigenDARelayRegistry} from "src/interfaces/IEigenDARelayRegistry.sol"; | ||
import "forge-std/Test.sol"; | ||
import "forge-std/Script.sol"; | ||
import "forge-std/StdJson.sol"; | ||
import "src/interfaces/IEigenDAStructs.sol"; | ||
|
||
//forge script script/deploy/certverifier/CertVerifierDeployer.s.sol:CertVerifierDeployer --sig "run(string)" <config.json> --rpc-url $RPC --private-key $PRIVATE_KEY -vvvv --etherscan-api-key $ETHERSCAN_API_KEY --verify --broadcast | ||
contract CertVerifierDeployer is Script, Test { | ||
|
||
address eigenDACertVerifier; | ||
|
||
address eigenDAServiceManager; | ||
address eigenDAThresholdRegistry; | ||
address eigenDARelayRegistry; | ||
address registryCoordinator ; | ||
address operatorStateRetriever; | ||
|
||
SecurityThresholds defaultSecurityThresholds; | ||
bytes quorumNumbersRequired; | ||
|
||
function run(string memory json) external { | ||
|
||
string memory path = string.concat("./script/deploy/certverifier/config/", json); | ||
string memory data = vm.readFile(path); | ||
|
||
bytes memory raw = stdJson.parseRaw(data, ".eigenDAServiceManager"); | ||
eigenDAServiceManager = abi.decode(raw, (address)); | ||
|
||
raw = stdJson.parseRaw(data, ".eigenDAThresholdRegistry"); | ||
eigenDAThresholdRegistry = abi.decode(raw, (address)); | ||
|
||
raw = stdJson.parseRaw(data, ".eigenDARelayRegistry"); | ||
eigenDARelayRegistry = abi.decode(raw, (address)); | ||
|
||
raw = stdJson.parseRaw(data, ".registryCoordinator"); | ||
registryCoordinator = abi.decode(raw, (address)); | ||
|
||
raw = stdJson.parseRaw(data, ".operatorStateRetriever"); | ||
operatorStateRetriever = abi.decode(raw, (address)); | ||
|
||
raw = stdJson.parseRaw(data, ".defaultSecurityThresholds"); | ||
defaultSecurityThresholds = abi.decode(raw, (SecurityThresholds)); | ||
|
||
raw = stdJson.parseRaw(data, ".quorumNumbersRequired"); | ||
quorumNumbersRequired = abi.decode(raw, (bytes)); | ||
|
||
vm.startBroadcast(); | ||
|
||
eigenDACertVerifier = address( | ||
new EigenDACertVerifier( | ||
IEigenDAThresholdRegistry(eigenDAThresholdRegistry), | ||
IEigenDABatchMetadataStorage(eigenDAServiceManager), | ||
IEigenDASignatureVerifier(eigenDAServiceManager), | ||
IEigenDARelayRegistry(eigenDARelayRegistry), | ||
OperatorStateRetriever(operatorStateRetriever), | ||
IRegistryCoordinator(registryCoordinator), | ||
defaultSecurityThresholds, | ||
quorumNumbersRequired | ||
)); | ||
|
||
vm.stopBroadcast(); | ||
|
||
console.log("Deployed new EigenDACertVerifier at address: ", eigenDACertVerifier); | ||
|
||
string memory outputPath = "script/deploy/certverifier/output/certverifier_deployment_data.json"; | ||
ethenotethan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
string memory parent_object = "parent object"; | ||
string memory finalJson = vm.serializeAddress(parent_object, "eigenDACertVerifier", address(eigenDACertVerifier)); | ||
vm.writeJson(finalJson, outputPath); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
## EigenDA Cert Verfier Deployer | ||
|
||
This script can be used to deploy an EigenDACertVerifier contract with specified security thresholds and quorum numbers required | ||
ethenotethan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
ethenotethan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
### Config | ||
|
||
To set up the deployment, a config json should be placed in the `config/` folder with the following structure: | ||
|
||
```json | ||
{ | ||
"eigenDAServiceManager": "0x...", | ||
"eigenDAThresholdRegistry": "0x...", | ||
"eigenDARelayRegistry": "0x...", | ||
"registryCoordinator": "0x...", | ||
"operatorStateRetriever": "0x...", | ||
|
||
"defaultSecurityThresholds": { | ||
"0_confirmationThreshold": 55, | ||
"1_adversaryThreshold": 33 | ||
}, | ||
|
||
"quorumNumbersRequired": "0x0001" | ||
ethenotethan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
``` | ||
|
||
Two sample configs are provided in the `config/` folder for preprod and testnet environments. | ||
|
||
### Deployment | ||
|
||
To deploy the contract, run the following command passing in the path to the config file and appropriate keys | ||
|
||
```bash | ||
forge script script/deploy/certverifier/CertVerifierDeployer.s.sol:CertVerifierDeployer --sig "run(string)" <config.json> --rpc-url $RPC --private-key $PRIVATE_KEY -vvvv --etherscan-api-key $ETHERSCAN_API_KEY --verify --broadcast | ||
``` | ||
|
||
The deployment will output the address of the deployed contract to a json file in the `output/` folder named `certverifier_deployment_data.json` | ||
|
||
```json | ||
{ | ||
"eigenDACertVerifier": "0x..." | ||
} | ||
``` | ||
ethenotethan marked this conversation as resolved.
Show resolved
Hide resolved
|
14 changes: 14 additions & 0 deletions
14
contracts/script/deploy/certverifier/config/preprod.config.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"eigenDAServiceManager": "0x54A03db2784E3D0aCC08344D05385d0b62d4F432", | ||
"eigenDAThresholdRegistry": "0x41AEE4A23770045e9977CC9f964d3380D6Ff9e4E", | ||
"eigenDARelayRegistry": "0xca1ca181fCb3c4192D320569c6eB4b5161B80328", | ||
"registryCoordinator": "0x2c61EA360D6500b58E7f481541A36B443Bc858c6", | ||
"operatorStateRetriever": "0x93545e3b9013CcaBc31E80898fef7569a4024C0C", | ||
|
||
"defaultSecurityThresholds": { | ||
"0_confirmationThreshold": 55, | ||
"1_adversaryThreshold": 33 | ||
}, | ||
|
||
"quorumNumbersRequired": "0x0001" | ||
} |
14 changes: 14 additions & 0 deletions
14
contracts/script/deploy/certverifier/config/testnet.config.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"eigenDAServiceManager": "0xD4A7E1Bd8015057293f0D0A557088c286942e84b", | ||
"eigenDAThresholdRegistry": "0x76d131CFBD900dA12f859a363Fb952eEDD1d1Ec1", | ||
"eigenDARelayRegistry": "0xaC8C6C7Ee7572975454E2f0b5c720f9E74989254", | ||
"registryCoordinator": "0x53012C69A189cfA2D9d29eb6F19B32e0A2EA3490", | ||
"operatorStateRetriever": "0x5322F480c6a14aBA6491974fa0fbF2A925C71B94", | ||
|
||
"defaultSecurityThresholds": { | ||
"0_confirmationThreshold": 55, | ||
"1_adversaryThreshold": 33 | ||
}, | ||
|
||
"quorumNumbersRequired": "0x0001" | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.