Skip to content

Commit

Permalink
small refactor + cleanup of DeployMockAvs
Browse files Browse the repository at this point in the history
  • Loading branch information
samlaf committed Jun 12, 2024
1 parent a630ea1 commit 065066c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 24 deletions.
2 changes: 1 addition & 1 deletion contracts/anvil/contracts-deployed-anvil-state.json

Large diffs are not rendered by default.

19 changes: 2 additions & 17 deletions contracts/script/DeployMockAvs.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,8 @@ contract DeployMockAvs is DeployMockAvsRegistries {
);
EigenlayerContracts
memory eigenlayerContracts = _loadEigenlayerDeployedContracts();
string memory opsAddresses = readInput("ops_addresses");
MockAvsOpsAddresses memory addressConfig;
addressConfig.communityMultisig = stdJson.readAddress(
opsAddresses,
".mockAvs.communityMultisig"
);
addressConfig.pauser = stdJson.readAddress(
opsAddresses,
".mockAvs.pauser"
);
addressConfig.churner = stdJson.readAddress(
opsAddresses,
".mockAvs.churner"
);
addressConfig.ejector = stdJson.readAddress(
opsAddresses,
".mockAvs.ejector"
MockAvsOpsAddresses memory addressConfig = _loadAvsOpsAddresses(
"ops_addresses"
);

vm.startBroadcast();
Expand Down
15 changes: 15 additions & 0 deletions contracts/script/DeployMockAvsRegistries.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ contract DeployMockAvsRegistries is
address ejector;
}

function _loadAvsOpsAddresses(
string memory opsAddressesFileName
) internal view returns (MockAvsOpsAddresses memory) {
string memory opsAddresses = readInput(opsAddressesFileName);
MockAvsOpsAddresses memory addressConfig;
addressConfig.communityMultisig = stdJson.readAddress(
opsAddresses,
".communityMultisig"
);
addressConfig.pauser = stdJson.readAddress(opsAddresses, ".pauser");
addressConfig.churner = stdJson.readAddress(opsAddresses, ".churner");
addressConfig.ejector = stdJson.readAddress(opsAddresses, ".ejector");
return addressConfig;
}

function _deploymockAvsRegistryContracts(
EigenlayerContracts memory eigenlayerContracts,
MockAvsOpsAddresses memory addressConfig,
Expand Down
10 changes: 4 additions & 6 deletions contracts/script/input/31337/ops_addresses.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"mockAvs": {
"communityMultisig": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"pauser": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"churner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"ejector": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
}
"communityMultisig": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"pauser": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"churner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"ejector": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
}

0 comments on commit 065066c

Please sign in to comment.