Skip to content

Commit d8af05b

Browse files
authored
feat: whitelist (#371)
1 parent ee7f916 commit d8af05b

4 files changed

Lines changed: 58 additions & 3 deletions

File tree

Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,16 @@ operator_mint_mock_tokens:
9999
@echo "Minting tokens"
100100
. ./scripts/mint_mock_token.sh $(CONFIG_FILE) 1000
101101

102+
operator_whitelist_devnet:
103+
@echo "Whitelisting operator"
104+
$(eval OPERATOR_ADDRESS = $(shell yq -r '.operator.address' $(CONFIG_FILE)))
105+
@echo "Operator address: $(OPERATOR_ADDRESS)"
106+
RPC_URL="http://localhost:8545" PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" OUTPUT_PATH=./script/output/devnet/alignedlayer_deployment_output.json ./contracts/scripts/whitelist_operator.sh $(OPERATOR_ADDRESS)
107+
108+
operator_whitelist:
109+
@echo "Whitelisting operator $(OPERATOR_ADDRESS)"
110+
@. contracts/scripts/.env && . contracts/scripts/whitelist_operator.sh $(OPERATOR_ADDRESS)
111+
102112
operator_deposit_into_mock_strategy:
103113
@echo "Depositing into strategy"
104114
$(eval STRATEGY_ADDRESS = $(shell jq -r '.erc20MockStrategy' contracts/script/output/devnet/strategy_deployment_output.json))
@@ -121,7 +131,7 @@ operator_register_with_aligned_layer:
121131

122132
operator_deposit_and_register: operator_deposit_into_strategy operator_register_with_aligned_layer
123133

124-
operator_full_registration: operator_get_eth operator_register_with_eigen_layer operator_mint_mock_tokens operator_deposit_into_mock_strategy operator_register_with_aligned_layer
134+
operator_full_registration: operator_get_eth operator_register_with_eigen_layer operator_mint_mock_tokens operator_deposit_into_mock_strategy operator_whitelist_devnet operator_register_with_aligned_layer
125135

126136
__BATCHER__:
127137

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

Lines changed: 1 addition & 1 deletion
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 'add(address)' \
45+
$OPERATOR_ADDRESS

0 commit comments

Comments
 (0)