Skip to content
This repository was archived by the owner on May 29, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions run_service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ create_storage() {
' This folder contains crucial configuration information and autogenerated keys for your Trader agent.\n' \
' Please back up this folder and be cautious if you are modifying or sharing these files to avoid potential asset loss.' > "../$store_readme_path"

dotenv_set_key "$env_file_path" "SUBGRAPH_API_KEY" "$SUBGRAPH_API_KEY" true
dotenv_set_key "../$env_file_path" "SUBGRAPH_API_KEY" "$SUBGRAPH_API_KEY" true
dotenv_set_key "../$env_file_path" "USE_STAKING" "$USE_STAKING"

AGENT_ID=14
Expand Down Expand Up @@ -1060,11 +1060,13 @@ fi

# ensure Safe owner is agent
# (This may occur if update flow was interrupted)
service_safe_address=$(<"../$service_safe_address_path")
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}')
if [[ "$current_safe_owners" == "['$operator_address']" ]]; then
echo "[Operator] Swapping Safe owner..."
poetry run python "../scripts/swap_safe_owner.py" "$service_safe_address" "../$operator_pkey_path" "$agent_address" "$rpc" $password_argument
if [[ -f "../$service_safe_address_path" ]]; then
service_safe_address=$(<"../$service_safe_address_path")
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}')
if [[ "$current_safe_owners" == "['$operator_address']" ]]; then
echo "[Operator] Swapping Safe owner..."
poetry run python "../scripts/swap_safe_owner.py" "$service_safe_address" "../$operator_pkey_path" "$agent_address" "$rpc" $password_argument
fi
fi


Expand Down