6.8 KiB
Prerequisites Completion Guide
Date: 2025-01-12
Purpose: Complete guide for completing all prerequisites for bridge funding
Prerequisites Overview
Before funding bridge contracts, you need:
-
✅ LINK Token Contract Deployed
- Address:
0x326C977E6efc84E512bB9C30f76E30c160eD06FB - Status: ⚠️ Not deployed
- Address:
-
⚠️ Account Has LINK Tokens
- Required: 20 LINK minimum
- Current: 0 LINK (token not deployed)
-
⚠️ Bridge Contracts Funded
- WETH9 Bridge: 10 LINK
- WETH10 Bridge: 10 LINK
Step 1: Deploy LINK Token Contract
Option A: Automated Deployment (Recommended)
cd /home/intlc/projects/proxmox/explorer-monorepo
./scripts/deploy-link-token.sh
What it does:
- Checks if LINK token already exists
- Creates a standard ERC20 LINK token contract
- Deploys to ChainID 138
- Verifies deployment
- Mints initial supply to deployer
Requirements:
- Foundry installed (
forge) - OpenZeppelin contracts available
- Sufficient ETH for gas
Option B: Manual Deployment
If automated deployment fails, you can deploy manually:
-
Using Remix IDE:
- Go to https://remix.ethereum.org
- Create new file:
LinkToken.sol - Use standard ERC20 contract
- Deploy to ChainID 138
-
Using Hardhat:
npx hardhat deploy --network chain138 -
Using Foundry:
forge create LinkToken --rpc-url http://192.168.11.250:8545 --private-key $PRIVATE_KEY
LINK Token Contract Specification
Standard ERC20 Token:
- Name: "Chainlink Token"
- Symbol: "LINK"
- Decimals: 18
- Initial Supply: 1,000,000,000 LINK (1 billion)
- Expected Address:
0x326C977E6efc84E512bB9C30f76E30c160eD06FB
Note: The expected address may not match if not using CREATE2. Update .env with the actual deployed address.
Step 2: Acquire LINK Tokens
Option A: Initial Supply (If You Deployed)
If you deployed the LINK token contract, you should have received the initial supply (1 billion LINK) in your deployer account.
Check balance:
cast call 0x326C977E6efc84E512bB9C30f76E30c160eD06FB \
"balanceOf(address)" \
$(cast wallet address $PRIVATE_KEY) \
--rpc-url http://192.168.11.250:8545
Option B: Transfer from Another Account
If LINK exists on another account:
cast send 0x326C977E6efc84E512bB9C30f76E30c160eD06FB \
"transfer(address,uint256)" \
<RECEIVER_ADDRESS> \
$(cast --to-wei 20 ether) \
--rpc-url http://192.168.11.250:8545 \
--private-key <SENDER_PRIVATE_KEY> \
--gas-price $(./scripts/get-optimal-gas-from-api.sh proposed)
Option C: Bridge from Another Chain
If LINK exists on another chain (Ethereum, BSC, etc.), you can bridge it:
- Use a cross-chain bridge
- Select LINK token
- Bridge to ChainID 138
- Receive LINK on ChainID 138
Option D: Use a Faucet (If Available)
Some test networks provide faucets. Check if ChainID 138 has a LINK faucet.
Step 3: Fund Bridge Contracts
Automated Funding
./scripts/fund-bridge-contracts.sh 10
This will:
- Check account LINK balance
- Transfer 10 LINK to WETH9 Bridge
- Transfer 10 LINK to WETH10 Bridge
- Verify funding
Manual Funding
Fund WETH9 Bridge:
cast send 0x326C977E6efc84E512bB9C30f76E30c160eD06FB \
"transfer(address,uint256)" \
0x89dd12025bfCD38A168455A44B400e913ED33BE2 \
10000000000000000000 \
--rpc-url http://192.168.11.250:8545 \
--private-key $PRIVATE_KEY \
--gas-price $(./scripts/get-optimal-gas-from-api.sh proposed)
Fund WETH10 Bridge:
cast send 0x326C977E6efc84E512bB9C30f76E30c160eD06FB \
"transfer(address,uint256)" \
0xe0E93247376aa097dB308B92e6Ba36bA015535D0 \
10000000000000000000 \
--rpc-url http://192.168.11.250:8545 \
--private-key $PRIVATE_KEY \
--gas-price $(./scripts/get-optimal-gas-from-api.sh proposed)
Complete All Prerequisites (Automated)
Run the complete prerequisites script:
./scripts/complete-prerequisites.sh
This script will:
- ✅ Check/deploy LINK token
- ✅ Verify account has sufficient LINK
- ✅ Fund bridge contracts
- ✅ Verify funding
Verification
Check LINK Token Deployment
# Check if contract exists
cast code 0x326C977E6efc84E512bB9C30f76E30c160eD06FB --rpc-url http://192.168.11.250:8545
# Check token name
cast call 0x326C977E6efc84E512bB9C30f76E30c160eD06FB "name()" --rpc-url http://192.168.11.250:8545
# Check token symbol
cast call 0x326C977E6efc84E512bB9C30f76E30c160eD06FB "symbol()" --rpc-url http://192.168.11.250:8545
Check Account Balance
cast call 0x326C977E6efc84E512bB9C30f76E30c160eD06FB \
"balanceOf(address)" \
$(cast wallet address $PRIVATE_KEY) \
--rpc-url http://192.168.11.250:8545
Check Bridge Contract Balances
# WETH9 Bridge
cast call 0x326C977E6efc84E512bB9C30f76E30c160eD06FB \
"balanceOf(address)" \
0x89dd12025bfCD38A168455A44B400e913ED33BE2 \
--rpc-url http://192.168.11.250:8545
# WETH10 Bridge
cast call 0x326C977E6efc84E512bB9C30f76E30c160eD06FB \
"balanceOf(address)" \
0xe0E93247376aa097dB308B92e6Ba36bA015535D0 \
--rpc-url http://192.168.11.250:8545
Generate Full Report
./scripts/get-funding-report.sh
Troubleshooting
LINK Token Not Deploying
Issue: Deployment script fails
Solutions:
- Check Foundry installation:
forge --version - Check OpenZeppelin contracts:
forge install OpenZeppelin/openzeppelin-contracts - Check ETH balance for gas
- Try manual deployment using Remix IDE
Insufficient LINK Balance
Issue: Account doesn't have enough LINK
Solutions:
- If you deployed, check deployer account balance
- Transfer from another account
- Bridge from another chain
- Use faucet (if available)
Bridge Funding Fails
Issue: Transfer to bridge contracts fails
Solutions:
- Check LINK token is deployed
- Check account has sufficient LINK
- Check gas price is appropriate
- Verify bridge contract addresses are correct
Next Steps
After completing prerequisites:
- ✅ Verify funding:
./scripts/get-funding-report.sh - ✅ Test bridge operations:
./scripts/wrap-and-bridge-to-ethereum.sh 0.001 - ✅ Monitor fees:
./scripts/monitor-fees.sh 1.0 - ✅ Check bridge config:
./scripts/check-bridge-config.sh
Summary
Prerequisites Checklist
- LINK token contract deployed
- Account has 20+ LINK tokens
- WETH9 Bridge funded with 10 LINK
- WETH10 Bridge funded with 10 LINK
- All funding verified
Quick Commands
# Complete all prerequisites
./scripts/complete-prerequisites.sh
# Or step by step:
./scripts/deploy-link-token.sh # Step 1
# Acquire LINK tokens manually # Step 2
./scripts/fund-bridge-contracts.sh 10 # Step 3
./scripts/get-funding-report.sh # Verify
Last Updated: 2025-01-12