Skip to content

Commit b6aa3bf

Browse files
fix: balance alerts description and correct function call (#1699)
Co-authored-by: Julian Arce <[email protected]>
1 parent f833f56 commit b6aa3bf

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

alerts/.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ EXPRESSION=<GREP_EXPRESSION>
1919
RPC_URL=<YOUR_RPC_URL>
2020
PAYMENT_CONTRACT_ADDRESS=<YOUR_PAYMENT_CONTRACT_ADDRESS>
2121
BALANCE_THRESHOLD=<YOUR_BALANCE_THRESHOLD_IN_ETH>
22+
WALLET_NAME=<YOUR_WALLET_NAME> # Example: "Task sender"
2223
WALLET_ADDRESS=<YOUR_WALLET_ADDRESS>
24+
NETWORK=<MAINNET|HOLESKY|STAGE>
2325

2426
# Variables for sender_with_alert.sh
2527
REPETITIONS=<REPETITIONS>

alerts/balance_alerts.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ balance_alert=false
2525

2626
while :
2727
do
28-
balance_wei=$(cast call --rpc-url $RPC_URL $PAYMENT_CONTRACT_ADDRESS "UserBalances(address)(uint256)" $WALLET_ADDRESS | cut -d' ' -f1)
28+
balance_wei=$(cast call --rpc-url $RPC_URL $PAYMENT_CONTRACT_ADDRESS "user_balances(address)(uint256)" $WALLET_ADDRESS | cut -d' ' -f1)
2929

3030
balance_eth=$(cast from-wei $balance_wei)
3131

3232
if [ 1 -eq "$(echo "$balance_eth < $BALANCE_THRESHOLD" | bc)" ]; then
33-
message="⚠️ WARNING: Wallet $WALLET_ADDRESS balance ($balance_eth ETH) is below $BALANCE_THRESHOLD ETH"
33+
message="⚠️ WARNING: $WALLET_NAME ($NETWORK) Wallet ($WALLET_ADDRESS) balance ($balance_eth ETH) is below $BALANCE_THRESHOLD ETH"
3434
printf "$message\n"
3535
if [ "$balance_alert" = false ]; then
3636
send_slack_message "$message"

0 commit comments

Comments
 (0)