Skip to content

Commit 825cd0f

Browse files
feat: ensure Safe owner is agent
1 parent ef19b67 commit 825cd0f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

run_service.sh

+11
Original file line numberDiff line numberDiff line change
@@ -1055,6 +1055,17 @@ if [ "${USE_STAKING}" = true ]; then
10551055
perform_staking_ops
10561056
fi
10571057

1058+
1059+
# ensure Safe owner is agent
1060+
# (This may occur if update flow was interrupted)
1061+
service_safe_address=$(<"../$service_safe_address_path")
1062+
current_safe_owners=$(poetry run python "../scripts/get_safe_owners.py" "$service_safe_address" "../$agent_pkey_path" "$rpc" $password_argument | awk '{gsub(/"/, "\047", $0); print $0}')
1063+
if [[ "$current_safe_owners" == "['$operator_address']" ]]; then
1064+
echo "[Operator] Swapping Safe owner..."
1065+
poetry run python "../scripts/swap_safe_owner.py" "$service_safe_address" "../$operator_pkey_path" "$agent_address" "$rpc" $password_argument
1066+
fi
1067+
1068+
10581069
echo ""
10591070
echo "Finished checking Autonolas Protocol service $service_id state."
10601071

0 commit comments

Comments
 (0)