From d29003e7525c2db6aac6a92963bc5f0d24ac9858 Mon Sep 17 00:00:00 2001 From: shkangr Date: Fri, 1 Sep 2023 16:44:59 +0900 Subject: [PATCH 1/4] feat: added Bridge Bsc operator balance checker --- bridge-status-bot/app.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bridge-status-bot/app.sh b/bridge-status-bot/app.sh index b0a2a73..2311e3a 100755 --- a/bridge-status-bot/app.sh +++ b/bridge-status-bot/app.sh @@ -11,6 +11,7 @@ CONTRACT_ADDRESS='0xf203ca1769ca8e9e8fe1da9d147db68b6c919817' BRIDGE_NC_ADDRESS='0x9093dd96c4bb6b44a9e0a522e2de49641f146223' BRIDGE_ETHEREUM_ADDRESS='0x4A2FbE06004e37dE6Fe7Da59a53D14a407Def0ed' BRIDGE_ETHEREUM_SAFE_EXECUTOR_ADDRESS='0x241085D7772E12740d6b1420043F04C51Cb3B45A' +BRIDGE_BSC_OPERATOR_ADDRESS='0x4f2b59A8779aea05e5187312FFCb5E8d751cC4CA' GRAPHQL_API_ENDPOINT='https://9c-main-full-state.nine-chronicles.com' @@ -44,6 +45,8 @@ ETH_BALANCE=$(get_eth_balance "$BRIDGE_ETHEREUM_ADDRESS") ETH_BALANCE_THRESHOLD=0.5 ETH_SAFE_EXECUTOR_BALANCE=$(get_eth_balance "$BRIDGE_ETHEREUM_SAFE_EXECUTOR_ADDRESS") ETH_SAFE_EXECUTOR_THRESHOLD=2 +ETH_BRIDGE_BSC_OPERATOR_BALANCE=$(get_eth_balance "$BRIDGE_BSC_OPERATOR_ADDRESS") +ETH_BRIDGE_BSC_OPERATOR_THRESHOLE=2 # https://etherscan.io/tx/0x851bffbfcb2084bd6ea376b0e799d8111e2b38a04a6eadc74d0c9dbd8c59b7d4 # https://etherscan.io/tx/0x6e7d5d173d2acc7d33f22f4b65da0a33fdfe1a605072e9e70ac1873a7cfe0c18 @@ -63,7 +66,8 @@ TEXT=":notebook: *9c-bridge report*\\n\ :ncg: NCG Balance: *$GOLD_BALANCE*\\n\ GAP between :wncg: and :ncg:: *$GAP* :ether: Ether Safe Contract balance: *$ETH_BALANCE*\\n -:ether: Ether Safe Contract Executor balance: *$ETH_SAFE_EXECUTOR_BALANCE*\\n" +:ether: Ether Safe Contract Executor balance: *$ETH_SAFE_EXECUTOR_BALANCE*\\n +:ether: Ether Bridge bsc operator balance: *$ETH_BRIDGE_BSC_OPERATOR_BALANCE*\\n" if [ $(echo "${ETH_BALANCE} <= ${ETH_BALANCE_THRESHOLD}" | bc) -eq 1 ];then TEXT+="Ether Balance is lower than the threshold (*$ETH_BALANCE_THRESHOLD ETH*). \\n" @@ -73,5 +77,9 @@ if [ $(echo "${ETH_SAFE_EXECUTOR_BALANCE} <= ${ETH_SAFE_EXECUTOR_THRESHOLD}" | b TEXT+="Ether Safe Executor Balance is lower than the threshold (*$ETH_SAFE_EXECUTOR_THRESHOLD ETH*). \\n" fi +if [ $(echo "${ETH_BRIDGE_BSC_OPERATOR_BALANCE} <= ${ETH_BRIDGE_BSC_OPERATOR_THRESHOLE}" | bc) -eq 1 ];then + TEXT+="Ether Bridge BSC Operator Balance is lower than the threshold (*$ETH_BRIDGE_BSC_OPERATOR_THRESHOLE ETH*). \\n" +fi + DATA="{\"channel\":\"$SLACK_CHANNEL\",\"text\":\"$TEXT\",\"mrkdwn\":true}" curl "https://slack.com/api/chat.postMessage" --request POST --data "$DATA" -H "Content-Type: application/json; charset=utf-8" -H "Authorization: Bearer $SLACK_BOT_TOKEN" -s From 3fc6c207f5263ca8b114076aaebbca1d411328ef Mon Sep 17 00:00:00 2001 From: shkangr Date: Fri, 1 Sep 2023 16:47:34 +0900 Subject: [PATCH 2/4] feat: fixed some characters --- bridge-status-bot/app.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridge-status-bot/app.sh b/bridge-status-bot/app.sh index 2311e3a..ac8d647 100755 --- a/bridge-status-bot/app.sh +++ b/bridge-status-bot/app.sh @@ -67,7 +67,7 @@ TEXT=":notebook: *9c-bridge report*\\n\ GAP between :wncg: and :ncg:: *$GAP* :ether: Ether Safe Contract balance: *$ETH_BALANCE*\\n :ether: Ether Safe Contract Executor balance: *$ETH_SAFE_EXECUTOR_BALANCE*\\n -:ether: Ether Bridge bsc operator balance: *$ETH_BRIDGE_BSC_OPERATOR_BALANCE*\\n" +:ether: Ether Bridge Bsc Operator balance: *$ETH_BRIDGE_BSC_OPERATOR_BALANCE*\\n" if [ $(echo "${ETH_BALANCE} <= ${ETH_BALANCE_THRESHOLD}" | bc) -eq 1 ];then TEXT+="Ether Balance is lower than the threshold (*$ETH_BALANCE_THRESHOLD ETH*). \\n" From a86e0cce6ffd9defbe65e903f1ee353a95ba88c0 Mon Sep 17 00:00:00 2001 From: shkangr Date: Mon, 4 Sep 2023 10:25:00 +0900 Subject: [PATCH 3/4] feat: fixed typo --- bridge-status-bot/app.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bridge-status-bot/app.sh b/bridge-status-bot/app.sh index ac8d647..655e7fb 100755 --- a/bridge-status-bot/app.sh +++ b/bridge-status-bot/app.sh @@ -46,7 +46,7 @@ ETH_BALANCE_THRESHOLD=0.5 ETH_SAFE_EXECUTOR_BALANCE=$(get_eth_balance "$BRIDGE_ETHEREUM_SAFE_EXECUTOR_ADDRESS") ETH_SAFE_EXECUTOR_THRESHOLD=2 ETH_BRIDGE_BSC_OPERATOR_BALANCE=$(get_eth_balance "$BRIDGE_BSC_OPERATOR_ADDRESS") -ETH_BRIDGE_BSC_OPERATOR_THRESHOLE=2 +ETH_BRIDGE_BSC_OPERATOR_THRESHOLD=2 # https://etherscan.io/tx/0x851bffbfcb2084bd6ea376b0e799d8111e2b38a04a6eadc74d0c9dbd8c59b7d4 # https://etherscan.io/tx/0x6e7d5d173d2acc7d33f22f4b65da0a33fdfe1a605072e9e70ac1873a7cfe0c18 @@ -67,7 +67,7 @@ TEXT=":notebook: *9c-bridge report*\\n\ GAP between :wncg: and :ncg:: *$GAP* :ether: Ether Safe Contract balance: *$ETH_BALANCE*\\n :ether: Ether Safe Contract Executor balance: *$ETH_SAFE_EXECUTOR_BALANCE*\\n -:ether: Ether Bridge Bsc Operator balance: *$ETH_BRIDGE_BSC_OPERATOR_BALANCE*\\n" +:ether: Ether Bridge BSC Operator balance: *$ETH_BRIDGE_BSC_OPERATOR_BALANCE*\\n" if [ $(echo "${ETH_BALANCE} <= ${ETH_BALANCE_THRESHOLD}" | bc) -eq 1 ];then TEXT+="Ether Balance is lower than the threshold (*$ETH_BALANCE_THRESHOLD ETH*). \\n" @@ -77,8 +77,8 @@ if [ $(echo "${ETH_SAFE_EXECUTOR_BALANCE} <= ${ETH_SAFE_EXECUTOR_THRESHOLD}" | b TEXT+="Ether Safe Executor Balance is lower than the threshold (*$ETH_SAFE_EXECUTOR_THRESHOLD ETH*). \\n" fi -if [ $(echo "${ETH_BRIDGE_BSC_OPERATOR_BALANCE} <= ${ETH_BRIDGE_BSC_OPERATOR_THRESHOLE}" | bc) -eq 1 ];then - TEXT+="Ether Bridge BSC Operator Balance is lower than the threshold (*$ETH_BRIDGE_BSC_OPERATOR_THRESHOLE ETH*). \\n" +if [ $(echo "${ETH_BRIDGE_BSC_OPERATOR_BALANCE} <= ${ETH_BRIDGE_BSC_OPERATOR_THRESHOLD}" | bc) -eq 1 ];then + TEXT+="Ether Bridge BSC Operator Balance is lower than the threshold (*$ETH_BRIDGE_BSC_OPERATOR_THRESHOLD ETH*). \\n" fi DATA="{\"channel\":\"$SLACK_CHANNEL\",\"text\":\"$TEXT\",\"mrkdwn\":true}" From 9b62c4c888700744f28b30894a2584967cc98fcc Mon Sep 17 00:00:00 2001 From: shkangr Date: Tue, 12 Sep 2023 10:18:46 +0900 Subject: [PATCH 4/4] feat: fixed ETH_BRIDGE_BSC_OPERATOR_THRESHOLD --- bridge-status-bot/app.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridge-status-bot/app.sh b/bridge-status-bot/app.sh index 655e7fb..3e072a5 100755 --- a/bridge-status-bot/app.sh +++ b/bridge-status-bot/app.sh @@ -46,7 +46,7 @@ ETH_BALANCE_THRESHOLD=0.5 ETH_SAFE_EXECUTOR_BALANCE=$(get_eth_balance "$BRIDGE_ETHEREUM_SAFE_EXECUTOR_ADDRESS") ETH_SAFE_EXECUTOR_THRESHOLD=2 ETH_BRIDGE_BSC_OPERATOR_BALANCE=$(get_eth_balance "$BRIDGE_BSC_OPERATOR_ADDRESS") -ETH_BRIDGE_BSC_OPERATOR_THRESHOLD=2 +ETH_BRIDGE_BSC_OPERATOR_THRESHOLD=1 # https://etherscan.io/tx/0x851bffbfcb2084bd6ea376b0e799d8111e2b38a04a6eadc74d0c9dbd8c59b7d4 # https://etherscan.io/tx/0x6e7d5d173d2acc7d33f22f4b65da0a33fdfe1a605072e9e70ac1873a7cfe0c18