Skip to content

Commit 54c3aa3

Browse files
PatStilesuri-99JuArce
authored
feat(audit): Emit events in Operator whitelist (#1107)
Co-authored-by: Urix <[email protected]> Co-authored-by: JuArce <[email protected]>
1 parent 60276cd commit 54c3aa3

File tree

6 files changed

+2286
-2307
lines changed

6 files changed

+2286
-2307
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ operator_whitelist_devnet:
159159
@echo "Operator address: $(OPERATOR_ADDRESS)"
160160
RPC_URL="http://localhost:8545" PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" OUTPUT_PATH=./script/output/devnet/alignedlayer_deployment_output.json ./contracts/scripts/whitelist_operator.sh $(OPERATOR_ADDRESS)
161161

162+
operator_remove_devnet:
163+
@echo "Removing operator"
164+
$(eval OPERATOR_ADDRESS = $(shell yq -r '.operator.address' $(CONFIG_FILE)))
165+
@echo "Operator address: $(OPERATOR_ADDRESS)"
166+
RPC_URL="http://localhost:8545" PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" OUTPUT_PATH=./script/output/devnet/alignedlayer_deployment_output.json ./contracts/scripts/remove_operator.sh $(OPERATOR_ADDRESS)
167+
162168
operator_whitelist:
163169
@echo "Whitelisting operator $(OPERATOR_ADDRESS)"
164170
@. contracts/scripts/.env && . contracts/scripts/whitelist_operator.sh $(OPERATOR_ADDRESS)

contracts/scripts/anvil/state/alignedlayer-deployed-anvil-state.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

contracts/scripts/anvil/state/eigenlayer-deployed-anvil-state.json

Lines changed: 2229 additions & 2303 deletions
Large diffs are not rendered by default.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
3+
# cd to the directory of this script so that this can be run from anywhere
4+
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
5+
# At this point we are in contracts/scripts
6+
cd "$parent_path"
7+
8+
# At this point we are in contracts
9+
cd ../
10+
11+
# Check if the number of arguments is correct
12+
if [ "$#" -ne 1 ]; then
13+
echo "Usage: add_operator_to_whitelist.sh <OPERATOR_ADDRESS>"
14+
exit 1
15+
fi
16+
17+
OPERATOR_ADDRESS=$1
18+
19+
# Read the registry coordinator address from the JSON file
20+
REGISTRY_COORDINATOR=$(jq -r '.addresses.registryCoordinator' "$OUTPUT_PATH")
21+
22+
# Check if the registry coordinator address is empty
23+
if [ -z "$REGISTRY_COORDINATOR" ]; then
24+
echo "Registry coordinator address is empty"
25+
exit 1
26+
fi
27+
28+
# Check if the Ethereum RPC URL is empty
29+
if [ -z "$RPC_URL" ]; then
30+
echo "Ethereum RPC URL is empty"
31+
exit 1
32+
fi
33+
34+
# Check if the private key is empty
35+
if [ -z "$PRIVATE_KEY" ]; then
36+
echo "Private key is empty"
37+
exit 1
38+
fi
39+
40+
# Call the add function on the contract
41+
cast send \
42+
--rpc-url=$RPC_URL \
43+
--private-key=$PRIVATE_KEY \
44+
$REGISTRY_COORDINATOR 'remove(address)' \
45+
$OPERATOR_ADDRESS

contracts/scripts/upgrade_registry_coordinator.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ forge_output=$(forge script script/upgrade/RegistryCoordinatorUpgrader.s.sol \
1414
--rpc-url $RPC_URL \
1515
--private-key $PRIVATE_KEY \
1616
--broadcast \
17+
--verify \
18+
--etherscan-api-key $ETHERSCAN_API_KEY \
1719
--sig "run(string memory eigenLayerDeploymentFilePath, string memory alignedLayerDeploymentFilePath, )")
1820

1921
echo "$forge_output"
@@ -22,10 +24,10 @@ echo "$forge_output"
2224
new_registry_coordinator_implementation=$(echo "$forge_output" | awk '/1: address/ {print $3}')
2325

2426
# Use the extracted value to replace the alignedLayerServiceManagerImplementation value in alignedlayer_deployment_output.json and save it to a temporary file
25-
jq --arg new_registry_coordinator_implementation "$new_registry_coordinator_implementation" '.addresses.registryCoordinatorImplementation = $new_registry_coordinator_implementation' "script/output/holesky/alignedlayer_deployment_output.json" > "script/output/holesky/alignedlayer_deployment_output.temp.json"
27+
jq --arg new_registry_coordinator_implementation "$new_registry_coordinator_implementation" '.addresses.registryCoordinatorImplementation = $new_registry_coordinator_implementation' $OUTPUT_PATH > "script/output/holesky/alignedlayer_deployment_output.temp.json"
2628

2729
# Replace the original file with the temporary file
28-
mv "script/output/holesky/alignedlayer_deployment_output.temp.json" "script/output/holesky/alignedlayer_deployment_output.json"
30+
mv "script/output/holesky/alignedlayer_deployment_output.temp.json" $OUTPUT_PATH
2931

3032
# Delete the temporary file
3133
rm -f "script/output/holesky/alignedlayer_deployment_output.temp.json"

0 commit comments

Comments
 (0)