diff --git a/alerts/.env.example b/alerts/.env.example index b18f93c3d..2c0fe8a84 100644 --- a/alerts/.env.example +++ b/alerts/.env.example @@ -19,7 +19,9 @@ EXPRESSION= RPC_URL= PAYMENT_CONTRACT_ADDRESS= BALANCE_THRESHOLD= +WALLET_NAME= # Example: "Task sender" WALLET_ADDRESS= +NETWORK= # Variables for sender_with_alert.sh REPETITIONS= diff --git a/alerts/balance_alerts.sh b/alerts/balance_alerts.sh index efd9ff21f..9f8229a79 100755 --- a/alerts/balance_alerts.sh +++ b/alerts/balance_alerts.sh @@ -25,12 +25,12 @@ balance_alert=false while : do - balance_wei=$(cast call --rpc-url $RPC_URL $PAYMENT_CONTRACT_ADDRESS "UserBalances(address)(uint256)" $WALLET_ADDRESS | cut -d' ' -f1) + balance_wei=$(cast call --rpc-url $RPC_URL $PAYMENT_CONTRACT_ADDRESS "user_balances(address)(uint256)" $WALLET_ADDRESS | cut -d' ' -f1) balance_eth=$(cast from-wei $balance_wei) if [ 1 -eq "$(echo "$balance_eth < $BALANCE_THRESHOLD" | bc)" ]; then - message="⚠️ WARNING: Wallet $WALLET_ADDRESS balance ($balance_eth ETH) is below $BALANCE_THRESHOLD ETH" + message="⚠️ WARNING: $WALLET_NAME ($NETWORK) Wallet ($WALLET_ADDRESS) balance ($balance_eth ETH) is below $BALANCE_THRESHOLD ETH" printf "$message\n" if [ "$balance_alert" = false ]; then send_slack_message "$message"