Skip to content

Commit 54e6f63

Browse files
committed
fix: some pausable commands for local dev
1 parent 6711308 commit 54e6f63

File tree

6 files changed

+41
-31
lines changed

6 files changed

+41
-31
lines changed

Makefile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,28 +95,29 @@ anvil_upgrade_add_aggregator:
9595
. contracts/scripts/anvil/upgrade_add_aggregator_to_service_manager.sh
9696

9797
pause_all_aligned_service_manager:
98-
@echo "Pausing all contracts..."
99-
. contracts/scripts/pause_aligned_service_manager.sh all
98+
@echo "Pausing Aligned Service Manager contract..."
99+
@. contracts/scripts/.env && . contracts/scripts/pause_aligned_service_manager.sh all
100100

101101
unpause_all_aligned_service_manager:
102-
@echo "Pausing all contracts..."
103-
. contracts/scripts/unpause_aligned_service_manager.sh all
102+
@echo "Pausing Aligned Service Manager contract..."
103+
@. contracts/scripts/.env && . contracts/scripts/unpause_aligned_service_manager.sh all
104104

105105
get_paused_state_aligned_service_manager:
106106
@echo "Getting paused state of Aligned Service Manager contract..."
107-
. contracts/scripts/get_paused_state_aligned_service_manager.sh
107+
@. contracts/scripts/.env && . contracts/scripts/get_paused_state_aligned_service_manager.sh
108108

109109
pause_batcher_payment_service:
110110
@echo "Pausing BatcherPayments contract..."
111-
. contracts/scripts/pause_batcher_payment_service.sh
111+
@. contracts/scripts/.env && . contracts/scripts/pause_batcher_payment_service.sh
112112

113113
unpause_batcher_payment_service:
114114
@echo "Unpausing BatcherPayments contract..."
115115
. contracts/scripts/unpause_batcher_payment_service.sh
116116

117117
get_paused_state_batcher_payments_service:
118118
@echo "Getting paused state of Batcher Payments Service contract..."
119-
. contracts/scripts/get_paused_state_batcher_payments_service.sh
119+
@. contracts/scripts/.env && . contracts/scripts/get_paused_state_batcher_payments_service.sh
120+
120121
anvil_upgrade_initialize_disable_verifiers:
121122
@echo "Initializing disabled verifiers..."
122123
. contracts/scripts/anvil/upgrade_disabled_verifiers_in_service_manager.sh

contracts/scripts/get_paused_state_aligned_service_manager.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ if [ -z "$ALIGNED_SERVICE_MANAGER" ]; then
55
exit 1
66
fi
77

8-
if [ -z "$ALIGNED_SERVICE_MANAGER_PAUSER_PRIVATE_KEY" ]; then
9-
echo "ALIGNED_SERVICE_MANAGER_PAUSER_PRIVATE_KEY env var is not set"
10-
exit 1
11-
fi
12-
138
if [ -z "$RPC_URL" ]; then
149
echo "RPC_URL env var is not set"
1510
exit 1
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
if [ -z "$BATCHER_PAYMENT_SERVICE" ]; then
4+
echo "BATCHER_PAYMENT_SERVICE env var is not set"
5+
exit 1
6+
fi
7+
8+
if [ -z "$RPC_URL" ]; then
9+
echo "RPC_URL env var is not set"
10+
exit 1
11+
fi
12+
13+
number=$(cast call $BATCHER_PAYMENT_SERVICE "paused()(bool)" --rpc-url $RPC_URL)
14+
echo Batcher Payments Paused state: $number

contracts/scripts/pause_aligned_service_manager.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ if [ -z "$ALIGNED_SERVICE_MANAGER" ]; then
1212
exit 1
1313
fi
1414

15-
if [ -z "$ALIGNED_SERVICE_MANAGER_PAUSER_PRIVATE_KEY" ]; then
16-
echo "ALIGNED_SERVICE_MANAGER_PAUSER_PRIVATE_KEY env var is not set"
15+
if [ -z "$PRIVATE_KEY" ]; then
16+
echo "PRIVATE_KEY env var is not set"
1717
exit 1
1818
fi
1919

@@ -27,7 +27,7 @@ if [[ "$1" == "all" ]]; then
2727
cast send $ALIGNED_SERVICE_MANAGER \
2828
"pauseAll()()" \
2929
--rpc-url $RPC_URL \
30-
--private-key $ALIGNED_SERVICE_MANAGER_PAUSER_PRIVATE_KEY
30+
--private-key $PRIVATE_KEY
3131
exit 0
3232
fi
3333

@@ -43,4 +43,4 @@ echo "New pause state: $result"
4343
cast send $ALIGNED_SERVICE_MANAGER \
4444
"pause(uint256)()" "$result" \
4545
--rpc-url $RPC_URL \
46-
--private-key $ALIGNED_SERVICE_MANAGER_PAUSER_PRIVATE_KEY
46+
--private-key $PRIVATE_KEY

contracts/scripts/pause_batcher_payment_service.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ if [ -z "$BATCHER_PAYMENT_SERVICE" ]; then
55
exit 1
66
fi
77

8-
if [ -z "$BATCHER_PAYMENT_SERVICE_PAUSER_PRIVATE_KEY" ]; then
9-
echo "BATCHER_PAYMENT_SERVICE_PAUSER_PRIVATE_KEY env var is not set"
8+
if [ -z "$PRIVATE_KEY" ]; then
9+
echo "PRIVATE_KEY env var is not set"
1010
exit 1
1111
fi
1212

@@ -15,8 +15,8 @@ if [ -z "$RPC_URL" ]; then
1515
exit 1
1616
fi
1717

18-
echo "Pausing batcher payment contract"
18+
echo "Pausing contract"
1919
cast send $BATCHER_PAYMENT_SERVICE \
2020
"pause()()" \
2121
--rpc-url $RPC_URL \
22-
--private-key $BATCHER_PAYMENT_SERVICE_PAUSER_PRIVATE_KEY
22+
--private-key $PRIVATE_KEY

contracts/scripts/unpause_aligned_service_manager.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,13 @@ if [ -z "$1" ]; then
77
exit 1
88
fi
99

10-
if [[ "$1" == "all" ]]; then
11-
echo "Unpausing whole contract"
12-
cast send $ALIGNED_SERVICE_MANAGER \
13-
"unpause(uint256)()" 0 \
14-
--rpc-url $RPC_URL \
15-
--private-key $ALIGNED_SERVICE_MANAGER_PAUSER_PRIVATE_KEY
16-
return
17-
fi
18-
1910
if [ -z "$ALIGNED_SERVICE_MANAGER" ]; then
2011
echo "ALIGNED_SERVICE_MANAGER env var is not set"
2112
exit 1
2213
fi
2314

24-
if [ -z "$ALIGNED_SERVICE_MANAGER_PAUSER_PRIVATE_KEY" ]; then
25-
echo "ALIGNED_SERVICE_MANAGER_PAUSER_PRIVATE_KEY env var is not set"
15+
if [ -z "$PRIVATE_KEY" ]; then
16+
echo "PRIVATE_KEY env var is not set"
2617
exit 1
2718
fi
2819

@@ -31,6 +22,15 @@ if [ -z "$RPC_URL" ]; then
3122
exit 1
3223
fi
3324

25+
if [[ "$1" == "all" ]]; then
26+
echo "Unpausing whole contract"
27+
cast send $ALIGNED_SERVICE_MANAGER \
28+
"unpause(uint256)()" 0 \
29+
--rpc-url $RPC_URL \
30+
--private-key $PRIVATE_KEY
31+
return
32+
fi
33+
3434
result=0
3535

3636
for num in "$@"; do

0 commit comments

Comments
 (0)