Skip to content

Commit

Permalink
minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
0xDEnYO committed Feb 25, 2025
1 parent b284418 commit 9008edd
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions script/tasks/diamondSyncDEXs_FAST.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ function diamondSyncDEXs_FAST {
fi
fi

local FILE_SUFFIX=$(getFileSuffix "$ENVIRONMENT")

# Ask for contract name if not provided
if [[ -z "$DIAMOND_CONTRACT_NAME" ]]; then
echo ""
Expand Down Expand Up @@ -62,7 +60,7 @@ function diamondSyncDEXs_FAST {
DIAMOND_ADDRESS=$(getContractAddressFromDeploymentLogs "$NETWORK" "$ENVIRONMENT" "$DIAMOND_CONTRACT_NAME")

# Print sync start message
echo "[info] Syncing DEXs for $DIAMOND_CONTRACT_NAME on network $NETWORK (address: $DIAMOND_ADDRESS)"
echo "[$NETWORK] Whitelisting addresses for $DIAMOND_CONTRACT_NAME with address $DIAMOND_ADDRESS"

# Check if contract address exists
if [[ "$DIAMOND_ADDRESS" == "null" || -z "$DIAMOND_ADDRESS" ]]; then
Expand All @@ -79,10 +77,9 @@ function diamondSyncDEXs_FAST {
# Function to get approved DEXs from the contract
function getApprovedDEXs {
local ATTEMPT=1
local MAX_ATTEMPTS=5
local result=""

while [ $ATTEMPT -le $MAX_ATTEMPTS ]; do
while [ $ATTEMPT -le $MAX_ATTEMPTS_PER_SCRIPT_EXECUTION ]; do
result=$(cast call "$DIAMOND_ADDRESS" "approvedDexs() returns (address[])" --rpc-url "$RPC_URL" 2>/dev/null)

if [[ $? -eq 0 && ! -z "$result" ]]; then
Expand Down

0 comments on commit 9008edd

Please sign in to comment.