-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathexecute_config.sh
More file actions
486 lines (396 loc) · 20.2 KB
/
execute_config.sh
File metadata and controls
486 lines (396 loc) · 20.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
#!/bin/bash
# Comprehensive deployment testing script for multiple chains
# This script deploys contracts, configures LayerZero, and funds signers
#
# Usage: bash deploy/test_deployment.sh [chain_id1] [chain_id2] ...
#
# Examples:
# bash deploy/test_deployment.sh # Deploy to all chains in config.toml
# bash deploy/test_deployment.sh 84532 # Deploy only to Base Sepolia
# bash deploy/test_deployment.sh 84532 11155420 # Deploy to Base Sepolia and Optimism Sepolia
# bash deploy/test_deployment.sh 11155111 84532 11155420 # Deploy to all three chains
set -e # Exit on any error
# Color codes for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Function to print colored output
log_info() {
echo -e "${GREEN}[INFO]${NC} $1"
}
log_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
log_warning() {
echo -e "${YELLOW}[WARNING]${NC} $1"
}
# Function to check if a command succeeded
check_success() {
if [ $? -eq 0 ]; then
log_info "$1 succeeded"
else
log_error "$1 failed"
exit 1
fi
}
# Function to get all chain IDs from config.toml
get_all_chains() {
grep '^\[' deploy/config.toml | grep -v '\.' | sed 's/\[//g' | sed 's/\]//g'
}
# Parse command-line arguments
REQUESTED_CHAINS=()
if [ $# -gt 0 ]; then
# User provided specific chain IDs to deploy to
REQUESTED_CHAINS=("$@")
log_info "Requested deployment for chain IDs: ${REQUESTED_CHAINS[*]}"
else
# Get all chains from config.toml
REQUESTED_CHAINS=($(get_all_chains))
log_info "No specific chains requested, will deploy to all chains in config.toml: ${REQUESTED_CHAINS[*]}"
fi
# Start deployment process
log_info "Starting comprehensive deployment test"
if [ ${#REQUESTED_CHAINS[@]} -gt 0 ]; then
log_info "Deploying to chains: ${REQUESTED_CHAINS[*]}"
fi
echo "========================================================================"
# Step 1: Load environment variables
log_info "Loading environment variables from .env"
if [ ! -f .env ]; then
log_error ".env file not found!"
exit 1
fi
source .env
# Step 2: Validate required environment variables
log_info "Validating required environment variables"
if [ -z "$PRIVATE_KEY" ]; then
log_error "PRIVATE_KEY is not set in .env"
exit 1
fi
# Check RPC URLs for requested chains
for chain_id in "${REQUESTED_CHAINS[@]}"; do
RPC_VAR="RPC_${chain_id}"
if [ -z "${!RPC_VAR}" ]; then
log_error "$RPC_VAR is not set in .env for chain $chain_id"
log_info "Please set $RPC_VAR in your .env file"
exit 1
fi
done
if [ -z "$GAS_SIGNER_MNEMONIC" ]; then
log_warning "GAS_SIGNER_MNEMONIC is not set - FundSigners may fail"
fi
log_info "All required environment variables are set"
echo ""
# Step 3: Generate random salt for new deployment addresses
log_info "Generating random salt for new contract addresses"
# Generate a random 32-byte hex string for salt
RANDOM_SALT="0x$(openssl rand -hex 32)"
log_info "Generated salt: $RANDOM_SALT"
# Update salt in config.toml for all requested chains
for chain_id in "${REQUESTED_CHAINS[@]}"; do
if grep -q "^\[${chain_id}\.bytes32\]" deploy/config.toml; then
# Get chain name if available
CHAIN_NAME=$(sed -n "/^\[${chain_id}\.string\]/,/^\[/p" deploy/config.toml | grep "^name" | cut -d'"' -f2)
if [ -z "$CHAIN_NAME" ]; then
CHAIN_NAME="Chain $chain_id"
fi
log_info "Updating salt for $CHAIN_NAME ($chain_id) in config.toml"
sed -i.bak "/^\[${chain_id}\.bytes32\]/,/^\[/ s/^salt = .*/salt = \"$RANDOM_SALT\"/" deploy/config.toml
else
log_warning "No bytes32 section found for chain $chain_id, skipping salt update"
fi
done
# Clean up backup files
rm -f deploy/config.toml.bak
log_info "Salt updated in config.toml for all requested chains"
log_warning "⚠️ IMPORTANT: Save this salt value if you need to deploy to the same addresses on other chains: $RANDOM_SALT"
echo ""
# Step 4: Deploy contracts to Base Sepolia and Optimism Sepolia
echo "========================================================================"
# Build chain array string for forge script
CHAIN_ARRAY="["
for i in "${!REQUESTED_CHAINS[@]}"; do
if [ $i -gt 0 ]; then
CHAIN_ARRAY="${CHAIN_ARRAY},"
fi
CHAIN_ARRAY="${CHAIN_ARRAY}${REQUESTED_CHAINS[$i]}"
done
CHAIN_ARRAY="${CHAIN_ARRAY}]"
log_info "STEP 1: Deploying contracts to chains: $CHAIN_ARRAY"
echo "========================================================================"
forge script deploy/DeployMain.s.sol:DeployMain \
--broadcast --multi --slow \
--sig "run(uint256[])" "$CHAIN_ARRAY" \
--private-key $PRIVATE_KEY \
-vvv
check_success "Contract deployment"
echo ""
# Step 5: Configure LayerZero for cross-chain communication
echo "========================================================================"
log_info "STEP 2: Configuring LayerZero for cross-chain communication"
echo "========================================================================"
# Note: Using the same PRIVATE_KEY as requested (instead of L0_SETTLER_OWNER_PK)
forge script deploy/ConfigureLayerZeroSettler.s.sol:ConfigureLayerZeroSettler \
--broadcast --multi --slow \
--sig "run(uint256[])" "$CHAIN_ARRAY" \
--private-key $PRIVATE_KEY \
-vvv
check_success "LayerZero configuration"
echo ""
# Base Sepolia LayerZero verification
if [ ! -z "$LAYERZERO_SETTLER_BASE" ]; then
log_info "Base Sepolia LayerZero configuration:"
# Get LayerZero endpoint from config
LZ_ENDPOINT_BASE=$(sed -n "/^\[84532\.address\]/,/^\[/p" deploy/config.toml | grep "layerzero_endpoint" | cut -d'"' -f2)
LZ_EID_BASE=$(sed -n "/^\[84532\.uint\]/,/^\[/p" deploy/config.toml | grep "layerzero_eid" | awk -F' = ' '{print $2}')
LZ_SEND_ULN_BASE=$(sed -n "/^\[84532\.address\]/,/^\[/p" deploy/config.toml | grep "layerzero_send_uln302" | cut -d'"' -f2)
LZ_RECEIVE_ULN_BASE=$(sed -n "/^\[84532\.address\]/,/^\[/p" deploy/config.toml | grep "layerzero_receive_uln302" | cut -d'"' -f2)
# Check if endpoint is set on LayerZeroSettler
CURRENT_ENDPOINT=$(cast call $LAYERZERO_SETTLER_BASE "endpoint()(address)" --rpc-url $RPC_84532 2>/dev/null || echo "0x0000000000000000000000000000000000000000")
if [ "$CURRENT_ENDPOINT" == "$LZ_ENDPOINT_BASE" ]; then
log_info " ✓ Endpoint correctly set to $LZ_ENDPOINT_BASE"
else
log_error " ✗ Endpoint mismatch: Expected $LZ_ENDPOINT_BASE, got $CURRENT_ENDPOINT"
fi
# Check L0SettlerSigner
LZ_SIGNER=$(cast call $LAYERZERO_SETTLER_BASE "l0SettlerSigner()(address)" --rpc-url $RPC_84532 2>/dev/null || echo "0x0000000000000000000000000000000000000000")
log_info " L0SettlerSigner: $LZ_SIGNER"
fi
# Optimism Sepolia LayerZero verification
if [ ! -z "$LAYERZERO_SETTLER_OP" ]; then
log_info "Optimism Sepolia LayerZero configuration:"
# Get LayerZero endpoint from config - these are in the address section
LZ_ENDPOINT_OP=$(sed -n "/^\[11155420\.address\]/,/^\[/p" deploy/config.toml | grep "layerzero_endpoint" | cut -d'"' -f2)
LZ_EID_OP=$(sed -n "/^\[11155420\.uint\]/,/^\[/p" deploy/config.toml | grep "layerzero_eid" | awk -F' = ' '{print $2}')
LZ_SEND_ULN_OP=$(sed -n "/^\[11155420\.address\]/,/^\[/p" deploy/config.toml | grep "layerzero_send_uln302" | cut -d'"' -f2)
LZ_RECEIVE_ULN_OP=$(sed -n "/^\[11155420\.address\]/,/^\[/p" deploy/config.toml | grep "layerzero_receive_uln302" | cut -d'"' -f2)
# Check if endpoint is set on LayerZeroSettler
CURRENT_ENDPOINT=$(cast call $LAYERZERO_SETTLER_OP "endpoint()(address)" --rpc-url $RPC_11155420 2>/dev/null || echo "0x0000000000000000000000000000000000000000")
if [ "$CURRENT_ENDPOINT" == "$LZ_ENDPOINT_OP" ]; then
log_info " ✓ Endpoint correctly set to $LZ_ENDPOINT_OP"
else
log_error " ✗ Endpoint mismatch: Expected $LZ_ENDPOINT_OP, got $CURRENT_ENDPOINT"
fi
# Check L0SettlerSigner
LZ_SIGNER=$(cast call $LAYERZERO_SETTLER_OP "l0SettlerSigner()(address)" --rpc-url $RPC_11155420 2>/dev/null || echo "0x0000000000000000000000000000000000000000")
log_info " L0SettlerSigner: $LZ_SIGNER"
fi
# Verify cross-chain pathway configuration
log_info "Cross-chain pathway verification:"
# Get EIDs for both chains - they are in the uint sections
LZ_EID_BASE=$(sed -n "/^\[84532\.uint\]/,/^\[/p" deploy/config.toml | grep "layerzero_eid" | awk -F' = ' '{print $2}')
LZ_EID_OP=$(sed -n "/^\[11155420\.uint\]/,/^\[/p" deploy/config.toml | grep "layerzero_eid" | awk -F' = ' '{print $2}')
# Check Base Sepolia -> Optimism Sepolia pathway
if [ ! -z "$LAYERZERO_SETTLER_BASE" ] && [ ! -z "$LZ_EID_OP" ] && [ ! -z "$LZ_ENDPOINT_BASE" ] && [ ! -z "$LZ_SEND_ULN_BASE" ]; then
log_info " Base Sepolia -> Optimism Sepolia pathway:"
# Check executor configuration using endpoint.getConfig()
# CONFIG_TYPE_EXECUTOR = 1
EXECUTOR_CONFIG_BYTES=$(cast call $LZ_ENDPOINT_BASE "getConfig(address,address,uint32,uint32)(bytes)" "$LAYERZERO_SETTLER_BASE" "$LZ_SEND_ULN_BASE" "$LZ_EID_OP" "1" --rpc-url $RPC_84532 2>/dev/null || echo "0x")
if [ "$EXECUTOR_CONFIG_BYTES" != "0x" ] && [ ! -z "$EXECUTOR_CONFIG_BYTES" ]; then
# The executor config is encoded as (uint32 maxMessageSize, address executor)
# We need to decode the bytes - first 32 bytes is maxMessageSize, next 32 bytes is executor address
# Remove 0x prefix and get the executor address (last 40 hex chars of the second 32-byte word)
EXECUTOR_HEX=$(echo "$EXECUTOR_CONFIG_BYTES" | sed 's/0x//' | tail -c 41)
if [ ! -z "$EXECUTOR_HEX" ]; then
EXECUTOR_ADDR="0x$EXECUTOR_HEX"
if [ "$(echo $EXECUTOR_ADDR | tr '[:upper:]' '[:lower:]')" == "$(echo $LAYERZERO_SETTLER_BASE | tr '[:upper:]' '[:lower:]')" ]; then
log_info " ✓ Executor correctly set to LayerZeroSettler"
else
log_warning " ⚠ Executor not set to LayerZeroSettler (self-execution model)"
fi
else
log_warning " ⚠ Could not parse executor configuration"
fi
else
log_warning " ⚠ Executor configuration not set"
fi
# Check ULN configuration using endpoint.getConfig()
# CONFIG_TYPE_ULN = 2
ULN_CONFIG_BYTES=$(cast call $LZ_ENDPOINT_BASE "getConfig(address,address,uint32,uint32)(bytes)" "$LAYERZERO_SETTLER_BASE" "$LZ_SEND_ULN_BASE" "$LZ_EID_OP" "2" --rpc-url $RPC_84532 2>/dev/null || echo "0x")
if [ "$ULN_CONFIG_BYTES" != "0x" ] && [ ! -z "$ULN_CONFIG_BYTES" ] && [ ${#ULN_CONFIG_BYTES} -gt 10 ]; then
log_info " ✓ ULN configuration is set"
else
log_warning " ⚠ ULN configuration not set"
fi
fi
# Check Optimism Sepolia -> Base Sepolia pathway
if [ ! -z "$LAYERZERO_SETTLER_OP" ] && [ ! -z "$LZ_EID_BASE" ] && [ ! -z "$LZ_ENDPOINT_OP" ] && [ ! -z "$LZ_SEND_ULN_OP" ]; then
log_info " Optimism Sepolia -> Base Sepolia pathway:"
# Check executor configuration using endpoint.getConfig()
# CONFIG_TYPE_EXECUTOR = 1
EXECUTOR_CONFIG_BYTES=$(cast call $LZ_ENDPOINT_OP "getConfig(address,address,uint32,uint32)(bytes)" "$LAYERZERO_SETTLER_OP" "$LZ_SEND_ULN_OP" "$LZ_EID_BASE" "1" --rpc-url $RPC_11155420 2>/dev/null || echo "0x")
if [ "$EXECUTOR_CONFIG_BYTES" != "0x" ] && [ ! -z "$EXECUTOR_CONFIG_BYTES" ]; then
# The executor config is encoded as (uint32 maxMessageSize, address executor)
# Remove 0x prefix and get the executor address (last 40 hex chars of the second 32-byte word)
EXECUTOR_HEX=$(echo "$EXECUTOR_CONFIG_BYTES" | sed 's/0x//' | tail -c 41)
if [ ! -z "$EXECUTOR_HEX" ]; then
EXECUTOR_ADDR="0x$EXECUTOR_HEX"
if [ "$(echo $EXECUTOR_ADDR | tr '[:upper:]' '[:lower:]')" == "$(echo $LAYERZERO_SETTLER_OP | tr '[:upper:]' '[:lower:]')" ]; then
log_info " ✓ Executor correctly set to LayerZeroSettler"
else
log_warning " ⚠ Executor not set to LayerZeroSettler (self-execution model)"
fi
else
log_warning " ⚠ Could not parse executor configuration"
fi
else
log_warning " ⚠ Executor configuration not set"
fi
# Check ULN configuration using endpoint.getConfig()
# CONFIG_TYPE_ULN = 2
ULN_CONFIG_BYTES=$(cast call $LZ_ENDPOINT_OP "getConfig(address,address,uint32,uint32)(bytes)" "$LAYERZERO_SETTLER_OP" "$LZ_SEND_ULN_OP" "$LZ_EID_BASE" "2" --rpc-url $RPC_11155420 2>/dev/null || echo "0x")
if [ "$ULN_CONFIG_BYTES" != "0x" ] && [ ! -z "$ULN_CONFIG_BYTES" ] && [ ${#ULN_CONFIG_BYTES} -gt 10 ]; then
log_info " ✓ ULN configuration is set"
else
log_warning " ⚠ ULN configuration not set"
fi
fi
echo ""
# Step 3: Fund signers and set them as gas wallets
echo "========================================================================"
log_info "STEP 3: Funding signers and setting them as gas wallets"
echo "========================================================================"
if [ -z "$GAS_SIGNER_MNEMONIC" ]; then
log_error "Cannot proceed with FundSigners - GAS_SIGNER_MNEMONIC not set"
exit 1
fi
forge script deploy/FundSigners.s.sol:FundSigners \
--broadcast --multi --slow \
--sig "run(uint256[])" "$CHAIN_ARRAY" \
--private-key $PRIVATE_KEY \
-vvv
check_success "Signer funding"
echo ""
# Final Step: Run comprehensive verification for all deployed contracts and configurations
echo "========================================================================"
log_info "FINAL VERIFICATION: Running comprehensive verification"
echo "========================================================================"
log_info "Running verification script for all deployments and configurations..."
bash deploy/verify_config.sh "${REQUESTED_CHAINS[@]}"
check_success "Comprehensive verification"
echo ""
echo "========================================================================"
log_info "DEPLOYMENT COMPLETED SUCCESSFULLY!"
echo "========================================================================"
log_info "✅ All contracts deployed to requested chains"
log_info "✅ LayerZero configured for cross-chain communication"
log_info "✅ Signers funded and set as gas wallets"
log_info "✅ All verifications passed"
echo ""
log_info "Deployment and configuration completed successfully for chains: ${REQUESTED_CHAINS[*]}"
exit 0
# The old verification code below is no longer needed since verify_config.sh handles everything
: '
# Old verification code starts here
# Derive signer addresses from mnemonic (first 3 for verification)
log_info "Checking signer balances..."
# First signer address (derived from the mnemonic)
SIGNER_0="0x33097354Acf259e1fD19fB91159BAE6ccf912Fdb"
SIGNER_1="0x49e1f963ddb4122BD3ccC786eB8F9983dABa8658"
SIGNER_2="0x46C66f82B32f04bf04D05ED92e10b57188BF408A"
# Get target balance from config
TARGET_BALANCE_BASE=$(sed -n "/^\[84532\.uint\]/,/^\[/p" deploy/config.toml | grep "target_balance" | awk -F' = ' '{print $2}' | tr -d '"')
# Check balances on Base Sepolia
log_info "Base Sepolia (84532) signer balances (target: $TARGET_BALANCE_BASE wei):"
BALANCE_0_BASE=$(cast balance $SIGNER_0 --rpc-url $RPC_84532 2>/dev/null || echo "0")
BALANCE_1_BASE=$(cast balance $SIGNER_1 --rpc-url $RPC_84532 2>/dev/null || echo "0")
BALANCE_2_BASE=$(cast balance $SIGNER_2 --rpc-url $RPC_84532 2>/dev/null || echo "0")
# Check if balances meet target
if [ "$BALANCE_0_BASE" -ge "$TARGET_BALANCE_BASE" ]; then
log_info " Signer 0 ($SIGNER_0): $BALANCE_0_BASE wei ✓"
else
log_warning " Signer 0 ($SIGNER_0): $BALANCE_0_BASE wei (below target)"
fi
if [ "$BALANCE_1_BASE" -ge "$TARGET_BALANCE_BASE" ]; then
log_info " Signer 1 ($SIGNER_1): $BALANCE_1_BASE wei ✓"
else
log_warning " Signer 1 ($SIGNER_1): $BALANCE_1_BASE wei (below target)"
fi
if [ "$BALANCE_2_BASE" -ge "$TARGET_BALANCE_BASE" ]; then
log_info " Signer 2 ($SIGNER_2): $BALANCE_2_BASE wei ✓"
else
log_warning " Signer 2 ($SIGNER_2): $BALANCE_2_BASE wei (below target)"
fi
# Get target balance from config
TARGET_BALANCE_OP=$(sed -n "/^\[11155420\.uint\]/,/^\[/p" deploy/config.toml | grep "target_balance" | awk -F' = ' '{print $2}' | tr -d '"')
# Check balances on Optimism Sepolia
log_info "Optimism Sepolia (11155420) signer balances (target: $TARGET_BALANCE_OP wei):"
BALANCE_0_OP=$(cast balance $SIGNER_0 --rpc-url $RPC_11155420 2>/dev/null || echo "0")
BALANCE_1_OP=$(cast balance $SIGNER_1 --rpc-url $RPC_11155420 2>/dev/null || echo "0")
BALANCE_2_OP=$(cast balance $SIGNER_2 --rpc-url $RPC_11155420 2>/dev/null || echo "0")
# Check if balances meet target
if [ "$BALANCE_0_OP" -ge "$TARGET_BALANCE_OP" ]; then
log_info " Signer 0 ($SIGNER_0): $BALANCE_0_OP wei ✓"
else
log_warning " Signer 0 ($SIGNER_0): $BALANCE_0_OP wei (below target)"
fi
if [ "$BALANCE_1_OP" -ge "$TARGET_BALANCE_OP" ]; then
log_info " Signer 1 ($SIGNER_1): $BALANCE_1_OP wei ✓"
else
log_warning " Signer 1 ($SIGNER_1): $BALANCE_1_OP wei (below target)"
fi
if [ "$BALANCE_2_OP" -ge "$TARGET_BALANCE_OP" ]; then
log_info " Signer 2 ($SIGNER_2): $BALANCE_2_OP wei ✓"
else
log_warning " Signer 2 ($SIGNER_2): $BALANCE_2_OP wei (below target)"
fi
# Verify gas wallets and orchestrators in SimpleFunder
log_info "Checking SimpleFunder configuration..."
# Read orchestrator addresses from config.toml
# supported_orchestrators is an array like ["0xAddr1", "0xAddr2"]
# For simplicity, we'll extract the first orchestrator address
ORCHESTRATOR_BASE_CONFIG=$(sed -n "/^\[84532\.address\]/,/^\[/p" deploy/config.toml | grep "supported_orchestrators" | sed 's/.*\["\([^"]*\)".*/\1/')
ORCHESTRATOR_OP_CONFIG=$(sed -n "/^\[11155420\.address\]/,/^\[/p" deploy/config.toml | grep "supported_orchestrators" | sed 's/.*\["\([^"]*\)".*/\1/')
# For Base Sepolia
if [ ! -z "$SIMPLE_FUNDER_BASE" ]; then
log_info "Base Sepolia SimpleFunder ($SIMPLE_FUNDER_BASE):"
# Check if signers are gas wallets (using mapping gasWallets(address) => bool)
IS_GAS_WALLET_0=$(cast call $SIMPLE_FUNDER_BASE "gasWallets(address)(bool)" $SIGNER_0 --rpc-url $RPC_84532 2>/dev/null || echo "false")
if [ "$IS_GAS_WALLET_0" == "true" ]; then
log_info " ✓ Signer 0 is registered as gas wallet"
else
log_warning " ✗ Signer 0 is NOT registered as gas wallet"
fi
# Check orchestrator configuration (using mapping orchestrators(address) => bool)
if [ ! -z "$ORCHESTRATOR_BASE_CONFIG" ]; then
IS_SUPPORTED=$(cast call $SIMPLE_FUNDER_BASE "orchestrators(address)(bool)" $ORCHESTRATOR_BASE_CONFIG --rpc-url $RPC_84532 2>/dev/null || echo "false")
if [ "$IS_SUPPORTED" == "true" ]; then
log_info " ✓ Orchestrator $ORCHESTRATOR_BASE_CONFIG is supported"
else
log_warning " ✗ Orchestrator $ORCHESTRATOR_BASE_CONFIG is NOT supported"
fi
fi
fi
# For Optimism Sepolia
if [ ! -z "$SIMPLE_FUNDER_OP" ]; then
log_info "Optimism Sepolia SimpleFunder ($SIMPLE_FUNDER_OP):"
# Check if signers are gas wallets
IS_GAS_WALLET_0=$(cast call $SIMPLE_FUNDER_OP "gasWallets(address)(bool)" $SIGNER_0 --rpc-url $RPC_11155420 2>/dev/null || echo "false")
if [ "$IS_GAS_WALLET_0" == "true" ]; then
log_info " ✓ Signer 0 is registered as gas wallet"
else
log_warning " ✗ Signer 0 is NOT registered as gas wallet"
fi
# Check orchestrator configuration
if [ ! -z "$ORCHESTRATOR_OP_CONFIG" ]; then
IS_SUPPORTED=$(cast call $SIMPLE_FUNDER_OP "orchestrators(address)(bool)" $ORCHESTRATOR_OP_CONFIG --rpc-url $RPC_11155420 2>/dev/null || echo "false")
if [ "$IS_SUPPORTED" == "true" ]; then
log_info " ✓ Orchestrator $ORCHESTRATOR_OP_CONFIG is supported"
else
log_warning " ✗ Orchestrator $ORCHESTRATOR_OP_CONFIG is NOT supported"
fi
fi
fi
echo ""
# Step 7: Summary
echo "========================================================================"
log_info "DEPLOYMENT TEST COMPLETED SUCCESSFULLY!"
echo "========================================================================"
log_info "✅ Contracts deployed to Base Sepolia and Optimism Sepolia"
log_info "✅ LayerZero configured for cross-chain communication"
log_info "✅ Signers funded and set as gas wallets"
echo ""
echo ""
log_info "All deployment steps completed successfully!"
' # End of commented old verification code