Skip to content

Commit 5af9eb5

Browse files
committed
feat: make strategies_get_addresses
1 parent 0a1ab7d commit 5af9eb5

File tree

3 files changed

+42
-3
lines changed

3 files changed

+42
-3
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,10 @@ strategies_remove:
303303
@echo "Removing strategies: $(INDICES_TO_REMOVE)"
304304
@. contracts/scripts/.env && . contracts/scripts/remove_strategy.sh $(INDICES_TO_REMOVE)
305305

306+
strategies_get_addresses:
307+
@echo "Getting strategy addresses"
308+
@. contracts/scripts/.env && . contracts/scripts/get_restakeable_strategies.sh
309+
306310
__BATCHER__:
307311

308312
BURST_SIZE ?= 5
@@ -585,7 +589,6 @@ deploy_aligned_contracts: ## Deploy Aligned Contracts. Parameters: NETWORK=<main
585589
@echo "Deploying Aligned Contracts on $(NETWORK) network..."
586590
@. contracts/scripts/.env.$(NETWORK) && . contracts/scripts/deploy_aligned_contracts.sh
587591

588-
589592
deploy_pauser_registry: ## Deploy Pauser Registry
590593
@echo "Deploying Pauser Registry..."
591594
@. contracts/scripts/.env && . contracts/scripts/deploy_pauser_registry.sh
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
if [ -z "$OUTPUT_PATH" ]; then
12+
echo "OUTPUT_PATH env var is not set"
13+
exit 1
14+
fi
15+
16+
if [ -z "$RPC_URL" ]; then
17+
echo "RPC_URL env var is not set"
18+
exit 1
19+
fi
20+
21+
ALIGNED_SERVICE_MANAGER=$(jq -r '.addresses.alignedLayerServiceManager' "$OUTPUT_PATH")
22+
23+
## Using in this cast call:
24+
25+
# /**
26+
# * @notice Returns the list of strategies that the AVS supports for restaking
27+
# * @dev This function is intended to be called off-chain
28+
# * @dev No guarantee is made on uniqueness of each element in the returned array.
29+
# * The off-chain service should do that validation separately
30+
# */
31+
# function getRestakeableStrategies() external view returns (address[] memory) {
32+
33+
cast call $ALIGNED_SERVICE_MANAGER "getRestakeableStrategies()(address[])" --rpc-url $RPC_URL
34+
35+
# Expected output:
36+
# [addresses]
37+
# example:
38+
# [0xc5a5C42992dECbae36851359345FE25997F5C42d, 0x80528D6e9A2BAbFc766965E0E26d5aB08D9CFaF9]

contracts/scripts/get_strategy_weight.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ STAKE_REGISTRY=$(jq -r '.addresses.stakeRegistry' "$OUTPUT_PATH")
4343

4444
QUORUM_NUMER=0x0 #Aligned has only 1 quorum for now
4545

46-
echo $STAKE_REGISTRY
47-
4846
cast call $STAKE_REGISTRY "strategyParamsByIndex(uint8,uint256)((address,uint96))" $QUORUM_NUMER $STRATEGY_INDEX --rpc-url $RPC_URL
4947

5048
# Expected output:

0 commit comments

Comments
 (0)