2.5 KiB
2.5 KiB
Deployment Script Fix
Date: 2025-01-12
Issue: Deployment scripts running in dry-run mode
Status: ✅ FIXED
Problem
The deployment scripts were reporting "SUCCESS" but no transactions were actually being broadcast to the network. The scripts were running in dry-run/simulation mode by default.
Root Cause
- forge script: Required
--broadcastflag (was present but may not have been effective) - forge create: Missing
--broadcastflag entirely - No verification that broadcast actually occurred
Solution
Fix 1: Added --broadcast to forge create
File: scripts/force-deploy-link.sh
Method 2 (forge create) now includes --broadcast:
forge create src/MockLinkToken.sol:MockLinkToken \
--rpc-url "$RPC_URL" \
--private-key "$PRIVATE_KEY" \
--gas-price "$FORCE_GAS" \
--legacy \
--broadcast \ # ← ADDED
2>&1
Fix 2: Added Broadcast Verification
Method 1 (forge script) now includes verification:
# Verify broadcast actually happened
if echo "$DEPLOY_OUTPUT" | grep -qi "dry run\|simulation only\|not broadcasting"; then
echo "⚠️ WARNING: Script may have run in dry-run mode despite --broadcast flag"
echo "Output contains dry-run indicators"
fi
Direct Deployment Command
For immediate deployment, use:
forge create src/MockLinkToken.sol:MockLinkToken \
--rpc-url $RPC_URL \
--private-key $PRIVATE_KEY \
--gas-price 20000000000 \
--legacy \
--broadcast
Required Flags:
--rpc-url: Network RPC endpoint--private-key: Deployer private key--gas-price: Gas price in wei (20 gwei = 20000000000)--legacy: Use legacy transaction format--broadcast: CRITICAL - Actually broadcast the transaction
Verification
After deployment, verify:
-
Check contract bytecode:
cast code <DEPLOYED_ADDRESS> --rpc-url $RPC_URL -
Check token functions:
cast call <DEPLOYED_ADDRESS> "name()" --rpc-url $RPC_URL cast call <DEPLOYED_ADDRESS> "symbol()" --rpc-url $RPC_URL -
Check block explorer:
- Visit: https://explorer.d-bis.org/address/<DEPLOYED_ADDRESS>
- Verify contract exists and is confirmed
Status
✅ Script Fixed: force-deploy-link.sh now includes --broadcast for all methods
✅ Verification Added: Script now checks for dry-run indicators
✅ Direct Command: Provided for immediate deployment
Last Updated: 2025-01-12