-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from Layr-Labs/samlaf/add-deploy-script-for-sh…
…ared-contracts added deploy script for shared contracts
- Loading branch information
Showing
3 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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,50 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity =0.8.12; | ||
|
||
import "../src/BLSPublicKeyCompendium.sol"; | ||
import "../src/BLSOperatorStateRetriever.sol"; | ||
|
||
import "forge-std/Script.sol"; | ||
import "forge-std/Test.sol"; | ||
|
||
// # To load the variables in the .env file | ||
// source .env | ||
|
||
// # To deploy and verify our contract | ||
// forge script script/DeploySharedContracts.s.sol --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast | ||
contract DeploySharedContracts is Script, Test { | ||
Vm cheats = Vm(HEVM_ADDRESS); | ||
|
||
BLSPublicKeyCompendium public blsPublicKeyCompendium; | ||
BLSOperatorStateRetriever public blsOperatorStateRetriever; | ||
|
||
function run() external { | ||
vm.startBroadcast(); | ||
blsPublicKeyCompendium = new BLSPublicKeyCompendium(); | ||
blsOperatorStateRetriever = new BLSOperatorStateRetriever(); | ||
vm.stopBroadcast(); | ||
|
||
string memory deployed_addresses = "addresses"; | ||
vm.serializeAddress( | ||
deployed_addresses, | ||
"blsOperatorStateRetriever", | ||
address(blsOperatorStateRetriever) | ||
); | ||
string memory finalJson = vm.serializeAddress( | ||
deployed_addresses, | ||
"blsPublicKeyCompendium", | ||
address(blsPublicKeyCompendium) | ||
); | ||
vm.writeJson(finalJson, outputFileName()); | ||
} | ||
|
||
function outputFileName() internal view returns (string memory) { | ||
return | ||
string.concat( | ||
vm.projectRoot(), | ||
"/script/output/", | ||
vm.toString(block.chainid), | ||
"/shared_contracts_deployment_data.json" | ||
); | ||
} | ||
} |