refactor(archive): move historical contracts and adapters to archive directory
- Archived multiple non-EVM adapters (Algorand, Hedera, Tron, TON, Cosmos, Solana) and compliance contracts (IndyVerifier) to `archive/solidity/contracts/`. - Updated documentation to reflect the historical status of archived components. - Adjusted `foundry.toml` and `README.md` for clarity on historical dependencies and configurations. - Enhanced Makefile and package.json scripts for improved contract testing and building processes. - Removed obsolete contracts (AlltraCustomBridge, CommodityCCIPBridge, ISO4217WCCIPBridge, VaultBridgeAdapter) from the main directory. - Updated implementation reports to indicate archived status for various components.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")/../.."
|
||||
source scripts/lib/forge-scope.sh
|
||||
|
||||
echo "=== Deployment Preparation Check ==="
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")/../.."
|
||||
FORGE_SCOPE="${FORGE_SCOPE:-full}"
|
||||
|
||||
echo "=== 🚀 Running All Automated Tasks ==="
|
||||
echo ""
|
||||
@@ -41,10 +42,10 @@ run_parallel_task "validate-scripts" "./scripts/automation/validate-all-scripts.
|
||||
run_parallel_task "scope-review" "./scripts/automation/scope-review.sh"
|
||||
|
||||
# Task 3: Compile Foundry contracts
|
||||
run_parallel_task "compile-foundry" "forge build --force 2>&1 | grep -v 'ccip-integration' || true"
|
||||
run_parallel_task "compile-foundry" "bash scripts/forge/scope.sh build \"$FORGE_SCOPE\" --force 2>&1 | grep -v 'ccip-integration' || true"
|
||||
|
||||
# Task 4: Run Foundry tests
|
||||
run_parallel_task "test-foundry" "forge test --no-match-path 'test/ccip-integration/*' 2>&1 || true"
|
||||
run_parallel_task "test-foundry" "bash scripts/forge/scope.sh test \"$FORGE_SCOPE\" --no-match-path 'test/ccip-integration/*' 2>&1 || true"
|
||||
|
||||
# Task 5: Check environment configuration
|
||||
run_parallel_task "check-env" "./scripts/deployment/verify-env.sh 2>&1 || echo 'Env check skipped'"
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")/../.."
|
||||
FORGE_SCOPE="${FORGE_SCOPE:-full}"
|
||||
|
||||
echo "=== 🧪 Running Tests in Parallel ==="
|
||||
|
||||
@@ -12,7 +13,7 @@ mkdir -p test-results
|
||||
|
||||
# Run Foundry tests (excluding CCIP integration)
|
||||
echo "Running Foundry tests..."
|
||||
forge test --no-match-path 'test/ccip-integration/*' --json > test-results/foundry.json 2>&1 &
|
||||
bash scripts/forge/scope.sh test "$FORGE_SCOPE" --no-match-path 'test/ccip-integration/*' --json > test-results/foundry.json 2>&1 &
|
||||
FORGE_PID=$!
|
||||
|
||||
# Run Hardhat tests (if any)
|
||||
|
||||
@@ -80,6 +80,7 @@ echo "Deployed Contracts:"
|
||||
echo " CCIPLogger: $CCIP_LOGGER_ADDRESS"
|
||||
echo "Next Steps:"
|
||||
echo " 1. Verify contract on Etherscan"
|
||||
echo " 2. Deploy CCIPTxReporter to Chain-138"
|
||||
echo " 2. Set CHAIN138_CCIP_REPORTER for the historical Chain-138 sender if that flow is still active"
|
||||
echo " Archived source: archive/solidity/contracts/ccip-integration/CCIPTxReporter.sol"
|
||||
echo " 3. Configure watcher/relayer service"
|
||||
echo " 4. Start monitoring"
|
||||
|
||||
@@ -1,66 +1,7 @@
|
||||
const { ethers } = require("hardhat");
|
||||
require("dotenv").config();
|
||||
const archivedSource = "archive/solidity/contracts/ccip-integration/CCIPTxReporter.sol";
|
||||
|
||||
/**
|
||||
* Deploy CCIPTxReporter to Chain-138
|
||||
* This contract reports Chain-138 transactions to Ethereum Mainnet via CCIP
|
||||
*/
|
||||
async function main() {
|
||||
const [deployer] = await ethers.getSigners();
|
||||
console.log("Deploying CCIPTxReporter with account:", deployer.address);
|
||||
console.log("Account balance:", (await ethers.provider.getBalance(deployer.address)).toString());
|
||||
|
||||
// Get configuration from environment
|
||||
const routerAddress = process.env.CCIP_CHAIN138_ROUTER || process.env.CCIP_ROUTER || ethers.ZeroAddress;
|
||||
const destChainSelector = process.env.ETH_MAINNET_SELECTOR || "0x500147"; // Ethereum Mainnet selector (update with actual value from CCIP Directory)
|
||||
const destReceiver = process.env.CCIP_LOGGER_ETH_ADDRESS || ethers.ZeroAddress;
|
||||
|
||||
if (routerAddress === ethers.ZeroAddress) {
|
||||
throw new Error("CCIP_ROUTER or CCIP_CHAIN138_ROUTER must be set in .env");
|
||||
}
|
||||
if (destReceiver === ethers.ZeroAddress) {
|
||||
throw new Error("CCIP_LOGGER_ETH_ADDRESS must be set in .env (deploy CCIPLogger first)");
|
||||
}
|
||||
|
||||
console.log("\nConfiguration:");
|
||||
console.log(" Router (Chain-138):", routerAddress);
|
||||
console.log(" Destination Chain Selector (Ethereum):", destChainSelector);
|
||||
console.log(" Destination Receiver (CCIPLogger):", destReceiver);
|
||||
|
||||
// Deploy CCIPTxReporter
|
||||
const CCIPTxReporter = await ethers.getContractFactory("CCIPTxReporter");
|
||||
console.log("\nDeploying CCIPTxReporter...");
|
||||
|
||||
const selectorU64 = typeof destChainSelector === "string" && destChainSelector.startsWith("0x")
|
||||
? BigInt(destChainSelector)
|
||||
: BigInt(destChainSelector);
|
||||
const reporter = await CCIPTxReporter.deploy(
|
||||
routerAddress,
|
||||
selectorU64,
|
||||
destReceiver
|
||||
);
|
||||
|
||||
await reporter.waitForDeployment();
|
||||
const reporterAddress = await reporter.getAddress();
|
||||
|
||||
console.log("\n✅ CCIPTxReporter deployed to:", reporterAddress);
|
||||
console.log("\nDeployment details:");
|
||||
console.log(" Router:", await reporter.router());
|
||||
console.log(" Destination Chain Selector:", await reporter.destChainSelector());
|
||||
console.log(" Destination Receiver:", await reporter.destReceiver());
|
||||
console.log(" Owner:", await reporter.owner());
|
||||
|
||||
console.log("\n📝 Next steps:");
|
||||
console.log(" 1. Verify contract on Chain-138 explorer (if available)");
|
||||
console.log(" 2. Update .env with CCIP_REPORTER_CHAIN138_ADDRESS=" + reporterAddress);
|
||||
console.log(" 3. Fund the contract with ETH for CCIP fees");
|
||||
console.log(" 4. Start the watcher/relayer service");
|
||||
console.log(" 5. Test with a sample transaction report");
|
||||
}
|
||||
|
||||
main()
|
||||
.then(() => process.exit(0))
|
||||
.catch((error) => {
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
});
|
||||
console.error("CCIPTxReporter has been archived out of the active compile graph.");
|
||||
console.error(`Historical source: ${archivedSource}`);
|
||||
console.error("If you need a fresh deployment, restore that source into contracts/ first.");
|
||||
console.error("If you only need the existing deployment, set CHAIN138_CCIP_REPORTER in .env.");
|
||||
process.exit(1);
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
set -e
|
||||
|
||||
cd /home/intlc/projects/proxmox/smom-dbis-138
|
||||
source scripts/lib/forge-scope.sh
|
||||
|
||||
echo "╔══════════════════════════════════════════════════════════════╗"
|
||||
echo "║ TokenFactory138 Compilation and Error Check ║"
|
||||
@@ -126,4 +127,3 @@ else
|
||||
echo " 3. Ensure all dependencies are compiled"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
|
||||
# Colors
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
@@ -17,12 +20,8 @@ echo -e "${BLUE}╚════════════════════
|
||||
echo ""
|
||||
|
||||
# Load environment
|
||||
cd /home/intlc/projects/proxmox/smom-dbis-138
|
||||
if [ -f .env ]; then
|
||||
set -a
|
||||
source .env
|
||||
set +a
|
||||
fi
|
||||
cd "$PROJECT_ROOT"
|
||||
source "$PROJECT_ROOT/scripts/load-env.sh" >/dev/null 2>&1 || true
|
||||
|
||||
# Check prerequisites
|
||||
if [ -z "$PRIVATE_KEY" ]; then
|
||||
@@ -198,4 +197,3 @@ echo " 1. Verify contracts on explorer: https://explorer.d-bis.org"
|
||||
echo " 2. Review test results above"
|
||||
echo " 3. Set up monitoring and alerting"
|
||||
echo " 4. Configure multisig governance (production)"
|
||||
|
||||
|
||||
@@ -5,16 +5,19 @@
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Load environment variables
|
||||
if [ -f .env ]; then
|
||||
export $(cat .env | grep -v '^#' | xargs)
|
||||
else
|
||||
source "$PROJECT_ROOT/scripts/load-env.sh" >/dev/null 2>&1 || true
|
||||
|
||||
if [ ! -f .env ]; then
|
||||
echo -e "${RED}Error: .env file not found${NC}"
|
||||
exit 1
|
||||
fi
|
||||
@@ -120,4 +123,3 @@ echo " CompliantUSDT: $COMPLIANT_USDT"
|
||||
echo " CompliantUSDC: $COMPLIANT_USDC"
|
||||
echo ""
|
||||
echo "Addresses have been saved to .env file"
|
||||
|
||||
|
||||
@@ -5,16 +5,19 @@
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Load environment variables
|
||||
if [ -f .env ]; then
|
||||
export $(cat .env | grep -v '^#' | xargs)
|
||||
else
|
||||
source "$PROJECT_ROOT/scripts/load-env.sh" >/dev/null 2>&1 || true
|
||||
|
||||
if [ ! -f .env ]; then
|
||||
echo -e "${RED}Error: .env file not found${NC}"
|
||||
exit 1
|
||||
fi
|
||||
@@ -109,4 +112,3 @@ echo " TokenRegistry: $TOKEN_REGISTRY"
|
||||
echo " FeeCollector: $FEE_COLLECTOR"
|
||||
echo ""
|
||||
echo "Addresses have been saved to .env file"
|
||||
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
@@ -24,12 +28,7 @@ if [ -z "$PRIVATE_KEY" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Load .env if exists
|
||||
if [ -f .env ]; then
|
||||
set -a
|
||||
source .env
|
||||
set +a
|
||||
fi
|
||||
source "$PROJECT_ROOT/scripts/load-env.sh" >/dev/null 2>&1 || true
|
||||
|
||||
# Set defaults
|
||||
RPC_URL=${RPC_URL:-${RPC_URL_138:-"http://192.168.11.250:8545"}}
|
||||
@@ -325,4 +324,3 @@ echo " 4. Test end-to-end functionality"
|
||||
echo ""
|
||||
echo -e "${GREEN}All addresses saved to .env file${NC}"
|
||||
echo ""
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ set -e
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
source "$PROJECT_ROOT/scripts/lib/forge-scope.sh"
|
||||
|
||||
# Load environment variables
|
||||
source "$PROJECT_ROOT/../explorer-monorepo/.env" 2>/dev/null || true
|
||||
@@ -139,4 +140,3 @@ else
|
||||
echo "Receipt: $RECEIPT"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -4,9 +4,11 @@
|
||||
# Optional: CUSTODIAN_ADDRESS, RESERVE_MANAGER_ADDRESS, RESERVE_TRANSMITTER_1, RESERVE_TRANSMITTER_2
|
||||
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
|
||||
source .env 2>/dev/null || true
|
||||
source "$PROJECT_ROOT/scripts/load-env.sh" >/dev/null 2>&1 || true
|
||||
|
||||
: "${PRIVATE_KEY:?PRIVATE_KEY required}"
|
||||
: "${RPC_URL:?RPC_URL required (e.g. http://192.168.11.250:8545)}"
|
||||
|
||||
@@ -9,9 +9,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
|
||||
# Load environment variables
|
||||
if [ -f "$PROJECT_ROOT/.env" ]; then
|
||||
source "$PROJECT_ROOT/.env"
|
||||
fi
|
||||
source "$PROJECT_ROOT/scripts/load-env.sh" >/dev/null 2>&1 || true
|
||||
|
||||
# Configuration
|
||||
RPC_URL_MAINNET="${RPC_URL_MAINNET:-https://eth.llamarpc.com}"
|
||||
@@ -107,4 +105,3 @@ else
|
||||
echo "⚠️ Could not extract deployed addresses from logs"
|
||||
echo " Please check deployment logs manually"
|
||||
fi
|
||||
|
||||
|
||||
@@ -4,9 +4,11 @@
|
||||
# Optional: TREASURY_ADDRESS
|
||||
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
|
||||
source .env 2>/dev/null || true
|
||||
source "$PROJECT_ROOT/scripts/load-env.sh" >/dev/null 2>&1 || true
|
||||
|
||||
: "${PRIVATE_KEY:?PRIVATE_KEY required}"
|
||||
: "${RPC_URL:?RPC_URL required (e.g. http://192.168.11.250:8545)}"
|
||||
|
||||
@@ -3,7 +3,11 @@
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")/../.."
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
source "$SCRIPT_DIR/../lib/init.sh"
|
||||
source "$PROJECT_ROOT/scripts/load-env.sh" >/dev/null 2>&1 || true
|
||||
|
||||
echo "=== Compiling and Testing Mainnet Contracts ==="
|
||||
|
||||
|
||||
@@ -3,7 +3,11 @@
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")/../.."
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
source "$SCRIPT_DIR/../lib/init.sh"
|
||||
source "$PROJECT_ROOT/scripts/load-env.sh" >/dev/null 2>&1 || true
|
||||
|
||||
# Color codes
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ set -euo pipefail
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
FORGE_SCOPE_RUNNER=(bash "$PROJECT_ROOT/scripts/forge/scope.sh")
|
||||
# Load .env via dotenv (RPC CR/LF trim). Fallback: raw source.
|
||||
if [[ -f "$SCRIPT_DIR/../lib/deployment/dotenv.sh" ]]; then
|
||||
# shellcheck disable=SC1090
|
||||
@@ -65,7 +66,7 @@ run_ccip_remaining_mainnets() {
|
||||
continue
|
||||
fi
|
||||
echo -e "${YELLOW}DeployAll to $name (chain $chain_id)...${NC}"
|
||||
forge script script/DeployAll.s.sol:DeployAll \
|
||||
"${FORGE_SCOPE_RUNNER[@]}" script script/DeployAll.s.sol:DeployAll \
|
||||
--rpc-url "$rpc" --chain-id "$chain_id" --private-key "$PRIVATE_KEY" \
|
||||
--broadcast --slow -vvv || echo -e "${RED}$name DeployAll failed${NC}"
|
||||
echo ""
|
||||
@@ -78,12 +79,12 @@ run_trustless() {
|
||||
echo -e "${YELLOW}=== Trustless Bridge (Chain 138 + Ethereum) ===${NC}"
|
||||
require_env PRIVATE_KEY RPC_URL_138 || return 1
|
||||
echo "Deploying Trustless (Lockbox) on Chain 138..."
|
||||
forge script script/bridge/trustless/DeployTrustlessBridge.s.sol:DeployTrustlessBridge \
|
||||
"${FORGE_SCOPE_RUNNER[@]}" script script/bridge/trustless/DeployTrustlessBridge.s.sol:DeployTrustlessBridge \
|
||||
--rpc-url "$RPC_URL_138" --broadcast --via-ir --private-key "$PRIVATE_KEY" -vvv || true
|
||||
require_env ETHEREUM_MAINNET_RPC || return 1
|
||||
MAINNET_RPC=$(ensure_rpc "$ETHEREUM_MAINNET_RPC")
|
||||
echo "Deploying Trustless (BondManager, ChallengeManager, LP, Inbox, SwapRouter, Coordinator) on Ethereum..."
|
||||
forge script script/bridge/trustless/DeployTrustlessBridge.s.sol:DeployTrustlessBridge \
|
||||
"${FORGE_SCOPE_RUNNER[@]}" script script/bridge/trustless/DeployTrustlessBridge.s.sol:DeployTrustlessBridge \
|
||||
--rpc-url "$MAINNET_RPC" --broadcast --via-ir --private-key "$PRIVATE_KEY" \
|
||||
${ETHERSCAN_API_KEY:+--verify --etherscan-api-key "$ETHERSCAN_API_KEY"} -vvv || true
|
||||
echo -e "${GREEN}Trustless phase done.${NC}"
|
||||
@@ -93,7 +94,7 @@ run_trustless() {
|
||||
run_oracle() {
|
||||
echo -e "${YELLOW}=== Oracle (Chain 138) ===${NC}"
|
||||
require_env PRIVATE_KEY RPC_URL_138 || return 1
|
||||
forge script script/DeployOracle.s.sol:DeployOracle \
|
||||
"${FORGE_SCOPE_RUNNER[@]}" script script/DeployOracle.s.sol:DeployOracle \
|
||||
--rpc-url "$RPC_URL_138" --broadcast --private-key "$PRIVATE_KEY" \
|
||||
--with-gas-price "${GAS_PRICE_138:-1000000000}" --legacy -vvv || true
|
||||
echo -e "${GREEN}Oracle phase done.${NC}"
|
||||
@@ -105,7 +106,7 @@ run_mapper() {
|
||||
require_env PRIVATE_KEY || return 1
|
||||
if [ -n "${RPC_URL_138:-}" ]; then
|
||||
echo "Deploying AddressMapper on Chain 138..."
|
||||
forge script script/DeployAddressMapper.s.sol:DeployAddressMapper \
|
||||
"${FORGE_SCOPE_RUNNER[@]}" script script/DeployAddressMapper.s.sol:DeployAddressMapper \
|
||||
--rpc-url "$RPC_URL_138" --broadcast --private-key "$PRIVATE_KEY" \
|
||||
--with-gas-price "${GAS_PRICE_138:-1000000000}" --legacy -vvv || true
|
||||
fi
|
||||
@@ -116,7 +117,7 @@ run_mapper() {
|
||||
[ -z "$rpc" ] && continue
|
||||
rpc=$(ensure_rpc "$rpc")
|
||||
echo "Deploying AddressMapperEmpty on chain $chain_id..."
|
||||
forge script script/DeployAddressMapperOtherChain.s.sol:DeployAddressMapperOtherChain \
|
||||
"${FORGE_SCOPE_RUNNER[@]}" script script/DeployAddressMapperOtherChain.s.sol:DeployAddressMapperOtherChain \
|
||||
--rpc-url "$rpc" --chain-id "$chain_id" --broadcast --private-key "$PRIVATE_KEY" -vvv || true
|
||||
done
|
||||
echo -e "${GREEN}Mapper phase done.${NC}"
|
||||
@@ -128,7 +129,7 @@ run_pmm() {
|
||||
require_env PRIVATE_KEY RPC_URL_138 || return 1
|
||||
if [ -z "${DODO_PMM_INTEGRATION:-}" ] && [ -n "${DODO_VENDING_MACHINE_ADDRESS:-}" ]; then
|
||||
echo "Deploying DODOPMMIntegration on Chain 138..."
|
||||
forge script script/dex/DeployDODOPMMIntegration.s.sol:DeployDODOPMMIntegration \
|
||||
"${FORGE_SCOPE_RUNNER[@]}" script script/dex/DeployDODOPMMIntegration.s.sol:DeployDODOPMMIntegration \
|
||||
--rpc-url "$RPC_URL_138" --broadcast --private-key "$PRIVATE_KEY" \
|
||||
--with-gas-price "${GAS_PRICE_138:-1000000000}" --legacy -vvv || true
|
||||
else
|
||||
@@ -136,7 +137,7 @@ run_pmm() {
|
||||
fi
|
||||
if [ -n "${DODO_PMM_INTEGRATION:-}" ] && [ -n "${XAU_ADDRESS:-}" ]; then
|
||||
echo "Creating XAU-anchored pools..."
|
||||
forge script script/dex/DeployPrivatePoolRegistryAndPools.s.sol:DeployPrivatePoolRegistryAndPools \
|
||||
"${FORGE_SCOPE_RUNNER[@]}" script script/dex/DeployPrivatePoolRegistryAndPools.s.sol:DeployPrivatePoolRegistryAndPools \
|
||||
--rpc-url "$RPC_URL_138" --broadcast --private-key "$PRIVATE_KEY" \
|
||||
--with-gas-price "${GAS_PRICE_138:-1000000000}" --legacy -vvv || true
|
||||
fi
|
||||
|
||||
@@ -154,7 +154,7 @@ deploy_contract() {
|
||||
log_warn "Deploying ${contract_name}..."
|
||||
|
||||
# Run deployment script
|
||||
local output=$(forge script "$script_name" \
|
||||
local output=$(forge_scoped script "$script_name" \
|
||||
--rpc-url "$RPC_URL" \
|
||||
--broadcast \
|
||||
--private-key "$PRIVATE_KEY" \
|
||||
@@ -220,7 +220,7 @@ if [ -z "$CCIP_ROUTER" ] || [ "$CCIP_ROUTER" = "0x000000000000000000000000000000
|
||||
DATA_FEE_PER_BYTE=${CCIP_DATA_FEE_PER_BYTE:-"1000000000"} # 1 gwei per byte
|
||||
|
||||
# Deploy CCIP Router
|
||||
CCIP_ROUTER_ADDRESS=$(forge script script/DeployCCIPRouter.s.sol:DeployCCIPRouter \
|
||||
CCIP_ROUTER_ADDRESS=$(forge_scoped script script/DeployCCIPRouter.s.sol:DeployCCIPRouter \
|
||||
--sig "run(address,uint256,uint256)" "$CCIP_FEE_TOKEN" "$BASE_FEE" "$DATA_FEE_PER_BYTE" \
|
||||
--rpc-url "$RPC_URL" \
|
||||
--broadcast \
|
||||
@@ -373,4 +373,3 @@ ORACLE_AGGREGATOR_ADDRESS=$ORACLE_ADDRESS
|
||||
EOF
|
||||
|
||||
log_success "Deployment addresses saved to: ${DEPLOYMENT_FILE}"
|
||||
|
||||
|
||||
@@ -95,34 +95,34 @@ echo ""
|
||||
|
||||
# Phase 1: Phased core (registry + governance)
|
||||
run_phase 1 "Phased core (01_DeployCore)" "UNIVERSAL_ASSET_REGISTRY" \
|
||||
"forge script script/deploy/01_DeployCore.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
"bash \"$PROJECT_ROOT/scripts/forge/scope.sh\" script script/deploy/01_DeployCore.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
|
||||
# Phase 2: Phased bridges (CCIP bridge + orchestrator)
|
||||
run_phase 2 "Phased bridges (02_DeployBridges)" "UNIVERSAL_CCIP_BRIDGE" \
|
||||
"forge script script/deploy/02_DeployBridges.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
"bash \"$PROJECT_ROOT/scripts/forge/scope.sh\" script script/deploy/02_DeployBridges.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
|
||||
# Phase 3: Channel managers
|
||||
run_phase 3 "PaymentChannelManager" "PAYMENT_CHANNEL_MANAGER" \
|
||||
"forge script script/DeployPaymentChannelManager.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
"bash \"$PROJECT_ROOT/scripts/forge/scope.sh\" script script/DeployPaymentChannelManager.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
|
||||
run_phase 3 "GenericStateChannelManager" "GENERIC_STATE_CHANNEL_MANAGER" \
|
||||
"forge script script/DeployGenericStateChannelManager.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
"bash \"$PROJECT_ROOT/scripts/forge/scope.sh\" script script/DeployGenericStateChannelManager.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
|
||||
# Phase 4: Deterministic core (CREATE2)
|
||||
run_phase 4 "Deterministic core (DeployDeterministicCore)" "CREATE2_FACTORY" \
|
||||
"forge script script/deploy/DeployDeterministicCore.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
"bash \"$PROJECT_ROOT/scripts/forge/scope.sh\" script script/deploy/DeployDeterministicCore.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
|
||||
# Phase 5: Vault system
|
||||
run_phase 5 "Vault system (DeployVaultSystem)" "VAULT_FACTORY" \
|
||||
"forge script script/deploy/vault/DeployVaultSystem.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
"bash \"$PROJECT_ROOT/scripts/forge/scope.sh\" script script/deploy/vault/DeployVaultSystem.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
|
||||
# Phase 6: Reserve system (requires TOKEN_FACTORY in .env)
|
||||
run_phase 6 "Reserve system (DeployReserveSystem)" "RESERVE_SYSTEM" \
|
||||
"forge script script/reserve/DeployReserveSystem.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
"bash \"$PROJECT_ROOT/scripts/forge/scope.sh\" script script/reserve/DeployReserveSystem.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
|
||||
# Phase 7: Trustless bridge (Lockbox138 on Chain 138)
|
||||
run_phase 7 "Trustless bridge (Lockbox138)" "LOCKBOX_138" \
|
||||
"forge script script/bridge/trustless/DeployTrustlessBridge.s.sol:DeployTrustlessBridge --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
"bash \"$PROJECT_ROOT/scripts/forge/scope.sh\" script script/bridge/trustless/DeployTrustlessBridge.s.sol:DeployTrustlessBridge --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
|
||||
echo ""
|
||||
echo "============================================"
|
||||
|
||||
@@ -9,6 +9,7 @@ set -euo pipefail
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "$SCRIPT_DIR/../lib/init.sh"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
FORGE_SCOPE_RUNNER=(bash "${PROJECT_ROOT}/scripts/forge/scope.sh")
|
||||
# Load .env via dotenv (RPC CR/LF trim). Fallback: raw source.
|
||||
if [[ -f "$SCRIPT_DIR/../lib/deployment/dotenv.sh" ]]; then
|
||||
# shellcheck disable=SC1090
|
||||
@@ -237,7 +238,7 @@ deploy_contracts() {
|
||||
|
||||
# Deploy WETH
|
||||
log "Deploying WETH..."
|
||||
WETH_ADDRESS=$(forge script script/DeployWETH.s.sol \
|
||||
WETH_ADDRESS=$("${FORGE_SCOPE_RUNNER[@]}" script script/DeployWETH.s.sol \
|
||||
--rpc-url "$RPC_URL" \
|
||||
--broadcast \
|
||||
--private-key "$PRIVATE_KEY" \
|
||||
@@ -253,7 +254,7 @@ deploy_contracts() {
|
||||
# Deploy Multicall individually (if not using Deploy.s.sol)
|
||||
if [ -z "$MULTICALL_ADDRESS" ] || [ "$MULTICALL_ADDRESS" = "null" ]; then
|
||||
log "Deploying Multicall..."
|
||||
DEPLOY_OUTPUT=$(forge script script/DeployMulticall.s.sol \
|
||||
DEPLOY_OUTPUT=$("${FORGE_SCOPE_RUNNER[@]}" script script/DeployMulticall.s.sol \
|
||||
--rpc-url "$RPC_URL" \
|
||||
--broadcast \
|
||||
--private-key "$PRIVATE_KEY" \
|
||||
@@ -274,7 +275,7 @@ deploy_contracts() {
|
||||
# Deploy Oracle Aggregator individually (if not using Deploy.s.sol)
|
||||
if [ -z "$ORACLE_ADDRESS" ] || [ "$ORACLE_ADDRESS" = "null" ]; then
|
||||
log "Deploying Oracle Aggregator..."
|
||||
DEPLOY_OUTPUT=$(forge script script/DeployOracle.s.sol \
|
||||
DEPLOY_OUTPUT=$("${FORGE_SCOPE_RUNNER[@]}" script script/DeployOracle.s.sol \
|
||||
--rpc-url "$RPC_URL" \
|
||||
--broadcast \
|
||||
--private-key "$PRIVATE_KEY" \
|
||||
@@ -308,7 +309,7 @@ deploy_contracts() {
|
||||
# Deploy CCIP Router (optional)
|
||||
if [ -f "${PROJECT_ROOT}/script/DeployCCIPRouter.s.sol" ]; then
|
||||
log "Deploying CCIP Router..."
|
||||
DEPLOY_OUTPUT=$(forge script script/DeployCCIPRouter.s.sol \
|
||||
DEPLOY_OUTPUT=$("${FORGE_SCOPE_RUNNER[@]}" script script/DeployCCIPRouter.s.sol \
|
||||
--rpc-url "$RPC_URL" \
|
||||
--broadcast \
|
||||
--private-key "$PRIVATE_KEY" \
|
||||
@@ -560,4 +561,3 @@ main() {
|
||||
|
||||
# Run main function
|
||||
main "$@"
|
||||
|
||||
|
||||
@@ -10,6 +10,9 @@ YELLOW='\033[1;33m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Configuration
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
FORGE_SCOPE_RUNNER=(bash "$PROJECT_ROOT/scripts/forge/scope.sh")
|
||||
RPC_URL="${CHAIN_138_RPC_URL:-http://localhost:8545}"
|
||||
PRIVATE_KEY="${DEPLOYER_PRIVATE_KEY}"
|
||||
ADMIN_ADDRESS="${ADMIN_ADDRESS}"
|
||||
@@ -30,7 +33,7 @@ echo "Admin Address: $ADMIN_ADDRESS"
|
||||
|
||||
# Deploy contracts
|
||||
echo -e "${YELLOW}Deploying BridgeRegistry...${NC}"
|
||||
REGISTRY_ADDRESS=$(forge script script/bridge/interop/DeployBridgeRegistry.s.sol \
|
||||
REGISTRY_ADDRESS=$("${FORGE_SCOPE_RUNNER[@]}" script script/bridge/interop/DeployBridgeRegistry.s.sol \
|
||||
--rpc-url "$RPC_URL" \
|
||||
--private-key "$PRIVATE_KEY" \
|
||||
--broadcast \
|
||||
@@ -39,7 +42,7 @@ REGISTRY_ADDRESS=$(forge script script/bridge/interop/DeployBridgeRegistry.s.sol
|
||||
echo "BridgeRegistry deployed at: $REGISTRY_ADDRESS"
|
||||
|
||||
echo -e "${YELLOW}Deploying BridgeEscrowVault...${NC}"
|
||||
VAULT_ADDRESS=$(forge script script/bridge/interop/DeployBridgeEscrowVault.s.sol \
|
||||
VAULT_ADDRESS=$("${FORGE_SCOPE_RUNNER[@]}" script script/bridge/interop/DeployBridgeEscrowVault.s.sol \
|
||||
--rpc-url "$RPC_URL" \
|
||||
--private-key "$PRIVATE_KEY" \
|
||||
--broadcast \
|
||||
@@ -49,7 +52,7 @@ VAULT_ADDRESS=$(forge script script/bridge/interop/DeployBridgeEscrowVault.s.sol
|
||||
echo "BridgeEscrowVault deployed at: $VAULT_ADDRESS"
|
||||
|
||||
echo -e "${YELLOW}Deploying wXRP Token...${NC}"
|
||||
WXRP_ADDRESS=$(forge script script/bridge/interop/DeployWXRP.s.sol \
|
||||
WXRP_ADDRESS=$("${FORGE_SCOPE_RUNNER[@]}" script script/bridge/interop/DeployWXRP.s.sol \
|
||||
--rpc-url "$RPC_URL" \
|
||||
--private-key "$PRIVATE_KEY" \
|
||||
--broadcast \
|
||||
@@ -64,7 +67,7 @@ if [ -z "$HSM_SIGNER_ADDRESS" ]; then
|
||||
HSM_SIGNER_ADDRESS="$ADMIN_ADDRESS"
|
||||
fi
|
||||
|
||||
CONTROLLER_ADDRESS=$(forge script script/bridge/interop/DeployMintBurnController.s.sol \
|
||||
CONTROLLER_ADDRESS=$("${FORGE_SCOPE_RUNNER[@]}" script script/bridge/interop/DeployMintBurnController.s.sol \
|
||||
--rpc-url "$RPC_URL" \
|
||||
--private-key "$PRIVATE_KEY" \
|
||||
--broadcast \
|
||||
@@ -74,7 +77,7 @@ CONTROLLER_ADDRESS=$(forge script script/bridge/interop/DeployMintBurnController
|
||||
echo "MintBurnController deployed at: $CONTROLLER_ADDRESS"
|
||||
|
||||
echo -e "${YELLOW}Deploying BridgeVerifier...${NC}"
|
||||
VERIFIER_ADDRESS=$(forge script script/bridge/interop/DeployBridgeVerifier.s.sol \
|
||||
VERIFIER_ADDRESS=$("${FORGE_SCOPE_RUNNER[@]}" script script/bridge/interop/DeployBridgeVerifier.s.sol \
|
||||
--rpc-url "$RPC_URL" \
|
||||
--private-key "$PRIVATE_KEY" \
|
||||
--broadcast \
|
||||
@@ -105,7 +108,7 @@ echo "Addresses saved to .bridge-deployment.json"
|
||||
|
||||
# Initialize registry with default destinations
|
||||
echo -e "${YELLOW}Initializing registry...${NC}"
|
||||
forge script script/bridge/interop/InitializeRegistry.s.sol \
|
||||
"${FORGE_SCOPE_RUNNER[@]}" script script/bridge/interop/InitializeRegistry.s.sol \
|
||||
--rpc-url "$RPC_URL" \
|
||||
--private-key "$PRIVATE_KEY" \
|
||||
--broadcast \
|
||||
|
||||
@@ -124,19 +124,15 @@ else
|
||||
ERRORS=$((ERRORS + 1))
|
||||
fi
|
||||
|
||||
# Step 5: Deploy CCIPTxReporter
|
||||
log_info "Step 5: Deploying CCIPTxReporter"
|
||||
# Step 5: Verify historical CCIPTxReporter
|
||||
log_info "Step 5: Checking CCIPTxReporter"
|
||||
|
||||
if [ -z "$CHAIN138_CCIP_REPORTER" ] || [ "$CHAIN138_CCIP_REPORTER" = "" ]; then
|
||||
if [ -f "scripts/ccip-deployment/deploy-ccip-reporter.js" ]; then
|
||||
log_warn "⚠️ CCIPTxReporter not deployed"
|
||||
echo " To deploy, run:"
|
||||
echo " npm run deploy:reporter:chain138"
|
||||
echo " Or:"
|
||||
echo " npx hardhat run scripts/ccip-deployment/deploy-ccip-reporter.js --network chain138"
|
||||
else
|
||||
log_warn "⚠️ CCIPTxReporter deployment script not found"
|
||||
fi
|
||||
log_warn "⚠️ CCIPTxReporter not configured"
|
||||
echo " Historical source archive:"
|
||||
echo " archive/solidity/contracts/ccip-integration/CCIPTxReporter.sol"
|
||||
echo " If you still rely on this flow, set CHAIN138_CCIP_REPORTER to the deployed address."
|
||||
echo " Restore the archived source before attempting a fresh redeploy."
|
||||
else
|
||||
log_success "✅ CCIPTxReporter address: $CHAIN138_CCIP_REPORTER"
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ set -e
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
FORGE_SCOPE_RUNNER=(bash "$PROJECT_ROOT/scripts/forge/scope.sh")
|
||||
# Load .env via dotenv (RPC CR/LF trim). Fallback: raw source.
|
||||
if [[ -f "$SCRIPT_DIR/../lib/deployment/dotenv.sh" ]]; then
|
||||
# shellcheck disable=SC1090
|
||||
@@ -80,7 +81,7 @@ echo "━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
echo ""
|
||||
|
||||
echo "📋 2.1: Deploy CCIP Router..."
|
||||
forge script script/DeployCCIPRouter.s.sol:DeployCCIPRouter --rpc-url "$RPC_URL" --broadcast --private-key "$PRIVATE_KEY" --legacy -vvv 2>&1 | tee /tmp/ccip-router.log | grep -E "CCIP Router deployed|deployed at:|Error" | head -3
|
||||
"${FORGE_SCOPE_RUNNER[@]}" script script/DeployCCIPRouter.s.sol:DeployCCIPRouter --rpc-url "$RPC_URL" --broadcast --private-key "$PRIVATE_KEY" --legacy -vvv 2>&1 | tee /tmp/ccip-router.log | grep -E "CCIP Router deployed|deployed at:|Error" | head -3
|
||||
CCIP_ROUTER=$(grep -oE "0x[a-fA-F0-9]{40}" /tmp/ccip-router.log 2>/dev/null | head -1)
|
||||
if [ -n "$CCIP_ROUTER" ]; then
|
||||
echo " ✅ CCIP Router: $CCIP_ROUTER"
|
||||
@@ -90,7 +91,7 @@ fi
|
||||
|
||||
echo ""
|
||||
echo "📋 2.2: Deploy CCIP Sender..."
|
||||
forge script script/DeployCCIPSender.s.sol:DeployCCIPSender --rpc-url "$RPC_URL" --broadcast --private-key "$PRIVATE_KEY" --legacy -vvv 2>&1 | tee /tmp/ccip-sender.log | grep -E "CCIPSender deployed|deployed at:|Error" | head -3
|
||||
"${FORGE_SCOPE_RUNNER[@]}" script script/DeployCCIPSender.s.sol:DeployCCIPSender --rpc-url "$RPC_URL" --broadcast --private-key "$PRIVATE_KEY" --legacy -vvv 2>&1 | tee /tmp/ccip-sender.log | grep -E "CCIPSender deployed|deployed at:|Error" | head -3
|
||||
CCIP_SENDER=$(grep -oE "0x[a-fA-F0-9]{40}" /tmp/ccip-sender.log 2>/dev/null | head -1)
|
||||
if [ -n "$CCIP_SENDER" ]; then
|
||||
echo " ✅ CCIP Sender: $CCIP_SENDER"
|
||||
@@ -99,7 +100,7 @@ fi
|
||||
|
||||
echo ""
|
||||
echo "📋 2.3: Deploy CCIP Receiver..."
|
||||
forge script script/DeployCCIPReceiver.s.sol:DeployCCIPReceiver --rpc-url "$RPC_URL" --broadcast --private-key "$PRIVATE_KEY" --legacy -vvv 2>&1 | tee /tmp/ccip-receiver.log | grep -E "CCIPReceiver deployed|deployed at:|Error" | head -3
|
||||
"${FORGE_SCOPE_RUNNER[@]}" script script/DeployCCIPReceiver.s.sol:DeployCCIPReceiver --rpc-url "$RPC_URL" --broadcast --private-key "$PRIVATE_KEY" --legacy -vvv 2>&1 | tee /tmp/ccip-receiver.log | grep -E "CCIPReceiver deployed|deployed at:|Error" | head -3
|
||||
CCIP_RECEIVER=$(grep -oE "0x[a-fA-F0-9]{40}" /tmp/ccip-receiver.log 2>/dev/null | head -1)
|
||||
if [ -n "$CCIP_RECEIVER" ]; then
|
||||
echo " ✅ CCIP Receiver: $CCIP_RECEIVER"
|
||||
@@ -108,7 +109,7 @@ fi
|
||||
|
||||
echo ""
|
||||
echo "📋 2.4: Deploy CCIP WETH9 Bridge..."
|
||||
forge script script/DeployCCIPWETH9Bridge.s.sol:DeployCCIPWETH9Bridge --rpc-url "$RPC_URL" --broadcast --private-key "$PRIVATE_KEY" --legacy -vvv 2>&1 | tee /tmp/ccip-weth9-bridge.log | grep -E "CCIPWETH9Bridge deployed|deployed at:|Error" | head -3
|
||||
"${FORGE_SCOPE_RUNNER[@]}" script script/DeployCCIPWETH9Bridge.s.sol:DeployCCIPWETH9Bridge --rpc-url "$RPC_URL" --broadcast --private-key "$PRIVATE_KEY" --legacy -vvv 2>&1 | tee /tmp/ccip-weth9-bridge.log | grep -E "CCIPWETH9Bridge deployed|deployed at:|Error" | head -3
|
||||
WETH9_BRIDGE=$(grep -oE "0x[a-fA-F0-9]{40}" /tmp/ccip-weth9-bridge.log 2>/dev/null | head -1)
|
||||
if [ -n "$WETH9_BRIDGE" ]; then
|
||||
echo " ✅ CCIP WETH9 Bridge: $WETH9_BRIDGE"
|
||||
@@ -117,7 +118,7 @@ fi
|
||||
|
||||
echo ""
|
||||
echo "📋 2.5: Deploy CCIP WETH10 Bridge..."
|
||||
forge script script/DeployCCIPWETH10Bridge.s.sol:DeployCCIPWETH10Bridge --rpc-url "$RPC_URL" --broadcast --private-key "$PRIVATE_KEY" --legacy -vvv 2>&1 | tee /tmp/ccip-weth10-bridge.log | grep -E "CCIPWETH10Bridge deployed|deployed at:|Error" | head -3
|
||||
"${FORGE_SCOPE_RUNNER[@]}" script script/DeployCCIPWETH10Bridge.s.sol:DeployCCIPWETH10Bridge --rpc-url "$RPC_URL" --broadcast --private-key "$PRIVATE_KEY" --legacy -vvv 2>&1 | tee /tmp/ccip-weth10-bridge.log | grep -E "CCIPWETH10Bridge deployed|deployed at:|Error" | head -3
|
||||
WETH10_BRIDGE=$(grep -oE "0x[a-fA-F0-9]{40}" /tmp/ccip-weth10-bridge.log 2>/dev/null | head -1)
|
||||
if [ -n "$WETH10_BRIDGE" ]; then
|
||||
echo " ✅ CCIP WETH10 Bridge: $WETH10_BRIDGE"
|
||||
@@ -132,15 +133,15 @@ echo "━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
echo ""
|
||||
|
||||
echo "📋 3.1: Deploy Multicall..."
|
||||
forge script script/DeployMulticall.s.sol:DeployMulticall --rpc-url "$RPC_URL" --broadcast --private-key "$PRIVATE_KEY" --legacy -vvv 2>&1 | tee /tmp/multicall.log | grep -E "Multicall deployed|deployed at:|Error" | head -3
|
||||
"${FORGE_SCOPE_RUNNER[@]}" script script/DeployMulticall.s.sol:DeployMulticall --rpc-url "$RPC_URL" --broadcast --private-key "$PRIVATE_KEY" --legacy -vvv 2>&1 | tee /tmp/multicall.log | grep -E "Multicall deployed|deployed at:|Error" | head -3
|
||||
|
||||
echo ""
|
||||
echo "📋 3.2: Deploy Oracle..."
|
||||
forge script script/DeployOracle.s.sol:DeployOracle --rpc-url "$RPC_URL" --broadcast --private-key "$PRIVATE_KEY" --legacy -vvv 2>&1 | tee /tmp/oracle.log | grep -E "Aggregator|Proxy|deployed at:|Error" | head -5
|
||||
"${FORGE_SCOPE_RUNNER[@]}" script script/DeployOracle.s.sol:DeployOracle --rpc-url "$RPC_URL" --broadcast --private-key "$PRIVATE_KEY" --legacy -vvv 2>&1 | tee /tmp/oracle.log | grep -E "Aggregator|Proxy|deployed at:|Error" | head -5
|
||||
|
||||
echo ""
|
||||
echo "📋 3.3: Deploy MultiSig..."
|
||||
forge script script/DeployMultiSig.s.sol:DeployMultiSig --rpc-url "$RPC_URL" --broadcast --private-key "$PRIVATE_KEY" --legacy -vvv 2>&1 | tee /tmp/multisig.log | grep -E "MultiSig|deployed at:|Error" | head -3
|
||||
"${FORGE_SCOPE_RUNNER[@]}" script script/DeployMultiSig.s.sol:DeployMultiSig --rpc-url "$RPC_URL" --broadcast --private-key "$PRIVATE_KEY" --legacy -vvv 2>&1 | tee /tmp/multisig.log | grep -E "MultiSig|deployed at:|Error" | head -3
|
||||
|
||||
echo ""
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
|
||||
@@ -80,7 +80,7 @@ deploy_contract() {
|
||||
log_warn "Deploying ${contract_name}..."
|
||||
|
||||
# Run deployment script
|
||||
local output=$(forge script "$script_name" \
|
||||
local output=$(forge_scoped script "$script_name" \
|
||||
--rpc-url "$RPC_URL" \
|
||||
--broadcast \
|
||||
--private-key "$PRIVATE_KEY" \
|
||||
@@ -132,7 +132,7 @@ if [ -z "$CCIP_ROUTER" ] || [ "$CCIP_ROUTER" = "0x000000000000000000000000000000
|
||||
log_warn "Warning: CCIP_FEE_TOKEN not set. Using zero address (native token)"
|
||||
fi
|
||||
|
||||
CCIP_ROUTER_ADDRESS=$(forge script script/DeployCCIPRouter.s.sol:DeployCCIPRouter \
|
||||
CCIP_ROUTER_ADDRESS=$(forge_scoped script script/DeployCCIPRouter.s.sol:DeployCCIPRouter \
|
||||
--sig "run(address,uint256,uint256)" "$FEE_TOKEN" "$BASE_FEE" "$DATA_FEE_PER_BYTE" \
|
||||
--rpc-url "$RPC_URL" \
|
||||
--broadcast \
|
||||
@@ -269,4 +269,3 @@ log_success "Oracle Aggregator: ${ORACLE_ADDRESS}"
|
||||
|
||||
log_success "=== Deployment Complete ==="
|
||||
log_success "All contract addresses have been updated in .env file"
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ log_warn "Phase 1: Deploying independent contracts in parallel..."
|
||||
# Deploy Multicall, WETH9, and WETH10 in parallel
|
||||
{
|
||||
log_warn "Deploying Multicall..."
|
||||
MULTICALL_OUTPUT=$(forge script script/DeployMulticall.s.sol:DeployMulticall \
|
||||
MULTICALL_OUTPUT=$(forge_scoped script script/DeployMulticall.s.sol:DeployMulticall \
|
||||
--rpc-url "$RPC_URL" \
|
||||
--broadcast \
|
||||
--private-key "$PRIVATE_KEY" \
|
||||
@@ -104,7 +104,7 @@ MULTICALL_PID=$!
|
||||
|
||||
{
|
||||
log_warn "Deploying WETH9..."
|
||||
WETH9_OUTPUT=$(forge script script/DeployWETH.s.sol:DeployWETH \
|
||||
WETH9_OUTPUT=$(forge_scoped script script/DeployWETH.s.sol:DeployWETH \
|
||||
--rpc-url "$RPC_URL" \
|
||||
--broadcast \
|
||||
--private-key "$PRIVATE_KEY" \
|
||||
@@ -119,7 +119,7 @@ WETH9_PID=$!
|
||||
|
||||
{
|
||||
log_warn "Deploying WETH10..."
|
||||
WETH10_OUTPUT=$(forge script script/DeployWETH10.s.sol:DeployWETH10 \
|
||||
WETH10_OUTPUT=$(forge_scoped script script/DeployWETH10.s.sol:DeployWETH10 \
|
||||
--rpc-url "$RPC_URL" \
|
||||
--broadcast \
|
||||
--private-key "$PRIVATE_KEY" \
|
||||
@@ -143,7 +143,7 @@ source .env
|
||||
# Phase 2: CCIP Router (if needed)
|
||||
if [ -z "$CCIP_ROUTER" ] || [ "$CCIP_ROUTER" = "0x0000000000000000000000000000000000000000" ]; then
|
||||
log_warn "Phase 2: Deploying CCIP Router..."
|
||||
CCIP_ROUTER_OUTPUT=$(forge script script/DeployCCIPRouter.s.sol:DeployCCIPRouter \
|
||||
CCIP_ROUTER_OUTPUT=$(forge_scoped script script/DeployCCIPRouter.s.sol:DeployCCIPRouter \
|
||||
--sig "run(address,uint256,uint256)" \
|
||||
"$CCIP_FEE_TOKEN" \
|
||||
"1000000000000000" \
|
||||
@@ -171,7 +171,7 @@ if [ "${DEPLOY_BRIDGES:-true}" = "true" ] && [ -n "$CCIP_ROUTER" ] && [ -n "$WET
|
||||
{
|
||||
log_warn "Deploying CCIPWETH9Bridge..."
|
||||
export CCIP_ROUTER WETH9_ADDRESS CCIP_FEE_TOKEN
|
||||
BRIDGE9_OUTPUT=$(forge script script/DeployCCIPWETH9Bridge.s.sol:DeployCCIPWETH9Bridge \
|
||||
BRIDGE9_OUTPUT=$(forge_scoped script script/DeployCCIPWETH9Bridge.s.sol:DeployCCIPWETH9Bridge \
|
||||
--rpc-url "$RPC_URL" \
|
||||
--broadcast \
|
||||
--private-key "$PRIVATE_KEY" \
|
||||
@@ -187,7 +187,7 @@ if [ "${DEPLOY_BRIDGES:-true}" = "true" ] && [ -n "$CCIP_ROUTER" ] && [ -n "$WET
|
||||
{
|
||||
log_warn "Deploying CCIPWETH10Bridge..."
|
||||
export CCIP_ROUTER WETH10_ADDRESS CCIP_FEE_TOKEN
|
||||
BRIDGE10_OUTPUT=$(forge script script/DeployCCIPWETH10Bridge.s.sol:DeployCCIPWETH10Bridge \
|
||||
BRIDGE10_OUTPUT=$(forge_scoped script script/DeployCCIPWETH10Bridge.s.sol:DeployCCIPWETH10Bridge \
|
||||
--rpc-url "$RPC_URL" \
|
||||
--broadcast \
|
||||
--private-key "$PRIVATE_KEY" \
|
||||
@@ -212,7 +212,7 @@ log_warn "Phase 4: Deploying Oracle and MultiSig in parallel..."
|
||||
# Deploy Oracle (independent)
|
||||
{
|
||||
export ORACLE_DESCRIPTION ORACLE_HEARTBEAT ORACLE_DEVIATION_THRESHOLD
|
||||
ORACLE_OUTPUT=$(forge script script/DeployOracle.s.sol:DeployOracle \
|
||||
ORACLE_OUTPUT=$(forge_scoped script script/DeployOracle.s.sol:DeployOracle \
|
||||
--rpc-url "$RPC_URL" \
|
||||
--broadcast \
|
||||
--private-key "$PRIVATE_KEY" \
|
||||
@@ -241,7 +241,7 @@ if [ -z "$MULTISIG_OWNERS" ]; then
|
||||
else
|
||||
{
|
||||
export OWNERS="$MULTISIG_OWNERS"
|
||||
MULTISIG_OUTPUT=$(forge script script/DeployMultiSig.s.sol:DeployMultiSig \
|
||||
MULTISIG_OUTPUT=$(forge_scoped script script/DeployMultiSig.s.sol:DeployMultiSig \
|
||||
--rpc-url "$RPC_URL" \
|
||||
--broadcast \
|
||||
--private-key "$PRIVATE_KEY" \
|
||||
@@ -279,4 +279,3 @@ log_success "MultiSig: ${MULTISIG_ADDRESS:-N/A}"
|
||||
log_success ""
|
||||
log_success "=== Parallel Deployment Complete ==="
|
||||
log_success "All addresses have been updated in .env file"
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "$SCRIPT_DIR/../lib/init.sh"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
FORGE_SCOPE_RUNNER=(bash "$PROJECT_ROOT/scripts/forge/scope.sh")
|
||||
# Load .env via dotenv (RPC CR/LF trim). Fallback: raw source.
|
||||
if [[ -f "$SCRIPT_DIR/../lib/deployment/dotenv.sh" ]]; then
|
||||
# shellcheck disable=SC1090
|
||||
@@ -146,7 +147,7 @@ deploy_contract() {
|
||||
return
|
||||
fi
|
||||
|
||||
forge script "$script" \
|
||||
"${FORGE_SCOPE_RUNNER[@]}" script "$script" \
|
||||
--rpc-url "$RPC_URL" \
|
||||
--broadcast \
|
||||
--private-key "$PRIVATE_KEY" \
|
||||
|
||||
@@ -108,44 +108,44 @@ echo ""
|
||||
|
||||
# Phase 1: CREATE2 / Deterministic core
|
||||
run_phase 1 "Deterministic core (DeployDeterministicCore)" "CREATE2_FACTORY" \
|
||||
"forge script script/deploy/DeployDeterministicCore.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
"bash \"$PROJECT_ROOT/scripts/forge/scope.sh\" script script/deploy/DeployDeterministicCore.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
|
||||
# Phase 2: Vault system
|
||||
run_phase 2 "Vault system (DeployVaultSystem)" "VAULT_FACTORY" \
|
||||
"forge script script/deploy/vault/DeployVaultSystem.s.sol:DeployVaultSystem --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
"bash \"$PROJECT_ROOT/scripts/forge/scope.sh\" script script/deploy/vault/DeployVaultSystem.s.sol:DeployVaultSystem --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
|
||||
# Phase 3: Reserve system (requires TOKEN_FACTORY)
|
||||
run_phase 3 "Reserve system (DeployReserveSystem)" "RESERVE_SYSTEM" \
|
||||
"forge script script/reserve/DeployReserveSystem.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
"bash \"$PROJECT_ROOT/scripts/forge/scope.sh\" script script/reserve/DeployReserveSystem.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
|
||||
# Phase 4: Reserve Keeper (requires ORACLE_PRICE_FEED unless RESERVE_KEEPER already set)
|
||||
run_phase 4 "Reserve Keeper (DeployKeeper)" "RESERVE_KEEPER" \
|
||||
"forge script script/reserve/DeployKeeper.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\"" \
|
||||
"bash \"$PROJECT_ROOT/scripts/forge/scope.sh\" script script/reserve/DeployKeeper.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\"" \
|
||||
"ORACLE_PRICE_FEED"
|
||||
|
||||
# Phase 5: PaymentChannelManager + GenericStateChannelManager
|
||||
run_phase 5a "PaymentChannelManager" "PAYMENT_CHANNEL_MANAGER" \
|
||||
"forge script script/DeployPaymentChannelManager.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
"bash \"$PROJECT_ROOT/scripts/forge/scope.sh\" script script/DeployPaymentChannelManager.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
|
||||
run_phase 5b "GenericStateChannelManager" "GENERIC_STATE_CHANNEL_MANAGER" \
|
||||
"forge script script/DeployGenericStateChannelManager.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
"bash \"$PROJECT_ROOT/scripts/forge/scope.sh\" script script/DeployGenericStateChannelManager.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
|
||||
# Phase 6: Trustless bridge (Lockbox138 on Chain 138)
|
||||
run_phase 6 "Trustless bridge (Lockbox138)" "LOCKBOX_138" \
|
||||
"forge script script/bridge/trustless/DeployTrustlessBridge.s.sol:DeployTrustlessBridge --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
"bash \"$PROJECT_ROOT/scripts/forge/scope.sh\" script script/bridge/trustless/DeployTrustlessBridge.s.sol:DeployTrustlessBridge --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
|
||||
# Phase 7: DODO / Swap (requires DODO_VENDING_MACHINE_ADDRESS, COMPLIANT_USDT_ADDRESS, COMPLIANT_USDC_ADDRESS)
|
||||
run_phase 7 "DODO PMM Integration" "DODOPMM_INTEGRATION_ADDRESS" \
|
||||
"forge script script/dex/DeployDODOPMMIntegration.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\"" \
|
||||
"bash \"$PROJECT_ROOT/scripts/forge/scope.sh\" script script/dex/DeployDODOPMMIntegration.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\"" \
|
||||
"DODO_VENDING_MACHINE_ADDRESS"
|
||||
|
||||
# Phase 8: eMoney (Chain 138)
|
||||
run_phase 8 "eMoney (DeployChain138)" "TOKEN_FACTORY_138" \
|
||||
"forge script script/emoney/DeployChain138.s.sol:DeployChain138 --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
"bash \"$PROJECT_ROOT/scripts/forge/scope.sh\" script script/emoney/DeployChain138.s.sol:DeployChain138 --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
|
||||
# Phase 9: Smart accounts (informational — actual deploy from ERC-4337 impl)
|
||||
run_phase 9 "Smart accounts kit (informational)" "" \
|
||||
"forge script script/smart-accounts/DeploySmartAccountsKit.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
"bash \"$PROJECT_ROOT/scripts/forge/scope.sh\" script script/smart-accounts/DeploySmartAccountsKit.s.sol --rpc-url \"$RPC\" --broadcast --private-key \"$PRIVATE_KEY\" --with-gas-price \"$GAS_PRICE\""
|
||||
|
||||
echo ""
|
||||
echo "============================================"
|
||||
|
||||
@@ -3,6 +3,11 @@
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
source "$PROJECT_ROOT/scripts/load-env.sh" >/dev/null 2>&1 || true
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
@@ -11,10 +16,11 @@ NC='\033[0m' # No Color
|
||||
|
||||
# Configuration
|
||||
FABRIC_NETWORK="${FABRIC_NETWORK:-fabric-network}"
|
||||
CHAIN_138_RPC_URL="${CHAIN_138_RPC_URL:-http://localhost:8545}"
|
||||
CHAIN_138_RPC_URL="${CHAIN_138_RPC_URL:-${RPC_URL_138:-http://localhost:8545}}"
|
||||
FIREFLY_API_URL="${FIREFLY_API_URL:-http://localhost:5000}"
|
||||
CACTI_API_URL="${CACTI_API_URL:-http://localhost:4000}"
|
||||
INDY_API_URL="${INDY_API_URL:-http://localhost:9000}"
|
||||
DEPLOYER_PRIVATE_KEY="${DEPLOYER_PRIVATE_KEY:-${PRIVATE_KEY:-}}"
|
||||
|
||||
echo -e "${GREEN}Deploying Tokenization System...${NC}"
|
||||
|
||||
@@ -61,6 +67,18 @@ if [ -z "$DEPLOYER_PRIVATE_KEY" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for required_script in \
|
||||
script/tokenization/DeployTokenizedEUR.s.sol \
|
||||
script/tokenization/DeployTokenRegistry.s.sol \
|
||||
script/tokenization/RegisterToken.s.sol
|
||||
do
|
||||
if [ ! -f "$required_script" ]; then
|
||||
echo -e "${RED}Error: missing required script $required_script${NC}"
|
||||
echo -e "${YELLOW}This deployment wrapper is stale relative to the current repo layout and needs refreshed tokenization scripts before it can run.${NC}"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
TOKENIZED_EUR_ADDRESS=$(forge script script/tokenization/DeployTokenizedEUR.s.sol \
|
||||
--rpc-url "$CHAIN_138_RPC_URL" \
|
||||
--private-key "$DEPLOYER_PRIVATE_KEY" \
|
||||
|
||||
@@ -50,6 +50,7 @@ elif [[ -f "$ENV_FILE" ]]; then
|
||||
set +a
|
||||
ENV_SOURCE="$ENV_FILE"
|
||||
fi
|
||||
source "$SMOM_ROOT/scripts/lib/forge-scope.sh"
|
||||
|
||||
RPC_URL_138="${RPC_URL_138:-http://192.168.11.211:8545}"
|
||||
WETH="${WETH:-$CHAIN138_WETH_DEFAULT}"
|
||||
@@ -231,9 +232,9 @@ echo ""
|
||||
|
||||
echo "Exact dry-run command"
|
||||
if [[ -f "$PROJECT_ENV_LOADER" ]]; then
|
||||
echo "cd \"$PROJECT_ROOT\" && source scripts/lib/load-project-env.sh && cd smom-dbis-138 && forge script script/bridge/trustless/DeployEnhancedSwapRouter.s.sol:DeployEnhancedSwapRouter --rpc-url \"$RPC_URL_138\" --private-key \"\$PRIVATE_KEY\""
|
||||
echo "cd \"$PROJECT_ROOT\" && source scripts/lib/load-project-env.sh && cd smom-dbis-138 && bash scripts/forge/scope.sh script bridge/trustless script/bridge/trustless/DeployEnhancedSwapRouter.s.sol:DeployEnhancedSwapRouter --rpc-url \"$RPC_URL_138\" --private-key \"\$PRIVATE_KEY\""
|
||||
else
|
||||
echo "cd \"$SMOM_ROOT\" && source .env && forge script script/bridge/trustless/DeployEnhancedSwapRouter.s.sol:DeployEnhancedSwapRouter --rpc-url \"$RPC_URL_138\" --private-key \"\$PRIVATE_KEY\""
|
||||
echo "cd \"$SMOM_ROOT\" && source .env && bash scripts/forge/scope.sh script bridge/trustless script/bridge/trustless/DeployEnhancedSwapRouter.s.sol:DeployEnhancedSwapRouter --rpc-url \"$RPC_URL_138\" --private-key \"\$PRIVATE_KEY\""
|
||||
fi
|
||||
echo ""
|
||||
echo "Example minimal exports before dry-run"
|
||||
|
||||
@@ -45,6 +45,7 @@ elif [[ -f "$ENV_FILE" ]]; then
|
||||
set +a
|
||||
ENV_SOURCE="$ENV_FILE"
|
||||
fi
|
||||
source "$SMOM_ROOT/scripts/lib/forge-scope.sh"
|
||||
|
||||
RPC_URL_138="${RPC_URL_138:-http://192.168.11.211:8545}"
|
||||
WETH="${WETH:-0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2}"
|
||||
|
||||
@@ -3,7 +3,11 @@
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")/../.."
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
source "$SCRIPT_DIR/../lib/init.sh"
|
||||
source "$PROJECT_ROOT/scripts/load-env.sh" >/dev/null 2>&1 || true
|
||||
|
||||
# Color codes
|
||||
|
||||
@@ -49,8 +53,8 @@ declare -A CONTRACT_DEPS=(
|
||||
|
||||
declare -A CONTRACT_SCRIPTS=(
|
||||
["CCIPLogger"]="npx hardhat run scripts/ccip-deployment/deploy-ccip-logger.js --network mainnet"
|
||||
["CCIPWETH9Bridge"]="forge script script/DeployCCIPWETH9Bridge.s.sol --rpc-url \$ETHEREUM_MAINNET_RPC --broadcast --private-key \$PRIVATE_KEY"
|
||||
["CCIPWETH10Bridge"]="forge script script/DeployCCIPWETH10Bridge.s.sol --rpc-url \$ETHEREUM_MAINNET_RPC --broadcast --private-key \$PRIVATE_KEY"
|
||||
["CCIPWETH9Bridge"]="bash scripts/forge/scope.sh script ccip script/DeployCCIPWETH9Bridge.s.sol:DeployCCIPWETH9Bridge --rpc-url \$ETHEREUM_MAINNET_RPC --broadcast --private-key \$PRIVATE_KEY"
|
||||
["CCIPWETH10Bridge"]="bash scripts/forge/scope.sh script ccip script/DeployCCIPWETH10Bridge.s.sol:DeployCCIPWETH10Bridge --rpc-url \$ETHEREUM_MAINNET_RPC --broadcast --private-key \$PRIVATE_KEY"
|
||||
)
|
||||
|
||||
TOTAL_COST_WEI=0
|
||||
@@ -80,7 +84,7 @@ COSTS["CCIPWETH9Bridge"]=$cost_eth
|
||||
TOTAL_COST_WEI=$(echo "$TOTAL_COST_WEI + $cost_wei" | bc 2>/dev/null)
|
||||
echo " Estimated Cost: $cost_eth ETH"
|
||||
echo " Dependencies: CCIPRouter"
|
||||
echo " Script: forge script script/DeployCCIPWETH9Bridge.s.sol --rpc-url \$ETHEREUM_MAINNET_RPC --broadcast --private-key \$PRIVATE_KEY"
|
||||
echo " Script: bash scripts/forge/scope.sh script ccip script/DeployCCIPWETH9Bridge.s.sol:DeployCCIPWETH9Bridge --rpc-url \$ETHEREUM_MAINNET_RPC --broadcast --private-key \$PRIVATE_KEY"
|
||||
|
||||
echo "3. CCIPWETH10Bridge"
|
||||
echo " Location: contracts/ccip/CCIPWETH10Bridge.sol"
|
||||
@@ -93,7 +97,7 @@ COSTS["CCIPWETH10Bridge"]=$cost_eth
|
||||
TOTAL_COST_WEI=$(echo "$TOTAL_COST_WEI + $cost_wei" | bc 2>/dev/null)
|
||||
echo " Estimated Cost: $cost_eth ETH"
|
||||
echo " Dependencies: CCIPRouter"
|
||||
echo " Script: forge script script/DeployCCIPWETH10Bridge.s.sol --rpc-url \$ETHEREUM_MAINNET_RPC --broadcast --private-key \$PRIVATE_KEY"
|
||||
echo " Script: bash scripts/forge/scope.sh script ccip script/DeployCCIPWETH10Bridge.s.sol:DeployCCIPWETH10Bridge --rpc-url \$ETHEREUM_MAINNET_RPC --broadcast --private-key \$PRIVATE_KEY"
|
||||
|
||||
TOTAL_COST_ETH=$(echo "scale=10; $TOTAL_COST_WEI / 1000000000000000000" | bc 2>/dev/null)
|
||||
|
||||
|
||||
@@ -3,7 +3,11 @@
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")/../.."
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
source "$SCRIPT_DIR/../lib/init.sh"
|
||||
source "$PROJECT_ROOT/scripts/load-env.sh" >/dev/null 2>&1 || true
|
||||
|
||||
# Color codes
|
||||
|
||||
@@ -35,8 +39,8 @@ declare -A CONTRACT_DEPS=(
|
||||
|
||||
declare -A CONTRACT_SCRIPTS=(
|
||||
["CCIPLogger"]="npx hardhat run scripts/ccip-deployment/deploy-ccip-logger.js --network mainnet"
|
||||
["CCIPWETH9Bridge"]="forge script script/DeployCCIPWETH9Bridge.s.sol --rpc-url \$ETHEREUM_MAINNET_RPC --broadcast --private-key \$PRIVATE_KEY"
|
||||
["CCIPWETH10Bridge"]="forge script script/DeployCCIPWETH10Bridge.s.sol --rpc-url \$ETHEREUM_MAINNET_RPC --broadcast --private-key \$PRIVATE_KEY"
|
||||
["CCIPWETH9Bridge"]="bash scripts/forge/scope.sh script ccip script/DeployCCIPWETH9Bridge.s.sol:DeployCCIPWETH9Bridge --rpc-url \$ETHEREUM_MAINNET_RPC --broadcast --private-key \$PRIVATE_KEY"
|
||||
["CCIPWETH10Bridge"]="bash scripts/forge/scope.sh script ccip script/DeployCCIPWETH10Bridge.s.sol:DeployCCIPWETH10Bridge --rpc-url \$ETHEREUM_MAINNET_RPC --broadcast --private-key \$PRIVATE_KEY"
|
||||
)
|
||||
|
||||
log_success "Remaining Contracts for Mainnet Deployment:"
|
||||
|
||||
@@ -5,12 +5,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
SMOM_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
ENV_FILE="$SMOM_ROOT/.env"
|
||||
|
||||
if [[ -f "$ENV_FILE" ]]; then
|
||||
set -a
|
||||
# shellcheck disable=SC1090
|
||||
source "$ENV_FILE"
|
||||
set +a
|
||||
fi
|
||||
source "$SMOM_ROOT/scripts/load-env.sh" >/dev/null 2>&1 || true
|
||||
|
||||
RPC_URL_138="${RPC_URL_138:-http://192.168.11.211:8545}"
|
||||
DODO_PMM_INTEGRATION_ADDRESS="${DODO_PMM_INTEGRATION_ADDRESS:-${DODO_PMM_INTEGRATION:-}}"
|
||||
@@ -114,7 +109,7 @@ for pool in "${pools[@]}"; do
|
||||
done
|
||||
|
||||
echo "Dry-run command:"
|
||||
echo " cd \"$SMOM_ROOT\" && source .env && bash scripts/deployment/inventory-register-dodo-pools-chain138.sh"
|
||||
echo " cd \"$SMOM_ROOT\" && source scripts/load-env.sh && bash scripts/deployment/inventory-register-dodo-pools-chain138.sh"
|
||||
echo ""
|
||||
echo "Broadcast command:"
|
||||
echo " cd \"$SMOM_ROOT\" && source .env && forge script script/liquidity/RegisterDODOPools.s.sol:RegisterDODOPools --rpc-url \"\$RPC_URL_138\" --private-key \"\$PRIVATE_KEY\" --broadcast --slow --with-gas-price 1000000000"
|
||||
echo " cd \"$SMOM_ROOT\" && source scripts/load-env.sh && bash scripts/forge/scope.sh script liquidity script/liquidity/RegisterDODOPools.s.sol:RegisterDODOPools --rpc-url \"\$RPC_URL_138\" --private-key \"\$PRIVATE_KEY\" --broadcast --slow --with-gas-price 1000000000"
|
||||
|
||||
@@ -39,12 +39,10 @@ echo " - WETH10: Predeployed at 0xf4BB2e28688e89fCcE3c0580D37d36A7672E8A9f"
|
||||
echo " - Status: Already exist on Mainnet (no deployment needed)"
|
||||
|
||||
log_info "4. CCIPTxReporter"
|
||||
echo " - CCIPTxReporter.sol (Chain-138 sender)"
|
||||
echo " Location: contracts/ccip-integration/CCIPTxReporter.sol"
|
||||
echo " Deployment: Hardhat script"
|
||||
echo " Script: scripts/ccip-deployment/deploy-ccip-reporter.js"
|
||||
echo " Status: Deploys to Chain-138 (not Mainnet)"
|
||||
echo " Note: This contract is deployed on Chain-138, not Mainnet"
|
||||
echo " - Historical Chain-138 sender"
|
||||
echo " Source archive: archive/solidity/contracts/ccip-integration/CCIPTxReporter.sol"
|
||||
echo " Status: Not part of the active Mainnet deployment set"
|
||||
echo " Note: Use CHAIN138_CCIP_REPORTER for the existing deployment if this flow is still needed"
|
||||
|
||||
log_warn "Summary:"
|
||||
echo " Total contracts for Mainnet: 3"
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
|
||||
set -e
|
||||
|
||||
echo "=== Phase 2: Deploy Core Bridge Contracts ==="
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
source "$PROJECT_ROOT/scripts/load-env.sh" >/dev/null 2>&1 || true
|
||||
|
||||
# Load environment variables
|
||||
if [ -f .env ]; then
|
||||
export $(cat .env | grep -v '^#' | grep -v '^$' | xargs)
|
||||
fi
|
||||
echo "=== Phase 2: Deploy Core Bridge Contracts ==="
|
||||
|
||||
# Check required variables
|
||||
REQUIRED_VARS=(
|
||||
@@ -72,4 +72,3 @@ echo ""
|
||||
echo "=== Phase 2 Complete ==="
|
||||
echo "Core bridge contracts deployed"
|
||||
echo "⚠️ Remember to update .env with all contract addresses"
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
|
||||
set -e
|
||||
|
||||
echo "=== Phase 3: Deploy EnhancedSwapRouter ==="
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
source "$PROJECT_ROOT/scripts/load-env.sh" >/dev/null 2>&1 || true
|
||||
|
||||
# Load environment variables
|
||||
if [ -f .env ]; then
|
||||
export $(cat .env | grep -v '^#' | grep -v '^$' | xargs)
|
||||
fi
|
||||
echo "=== Phase 3: Deploy EnhancedSwapRouter ==="
|
||||
|
||||
# Check required variables
|
||||
REQUIRED_VARS=(
|
||||
@@ -55,4 +55,3 @@ echo ""
|
||||
echo "=== Phase 3 Complete ==="
|
||||
echo "EnhancedSwapRouter deployed"
|
||||
echo "⚠️ Remember to update .env with ENHANCED_SWAP_ROUTER address"
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
|
||||
set -e
|
||||
|
||||
echo "=== Phase 4: Deploy Integration Contracts ==="
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
source "$PROJECT_ROOT/scripts/load-env.sh" >/dev/null 2>&1 || true
|
||||
|
||||
# Load environment variables
|
||||
if [ -f .env ]; then
|
||||
export $(cat .env | grep -v '^#' | grep -v '^$' | xargs)
|
||||
fi
|
||||
echo "=== Phase 4: Deploy Integration Contracts ==="
|
||||
|
||||
# Check required variables
|
||||
REQUIRED_VARS=(
|
||||
@@ -52,4 +52,3 @@ echo ""
|
||||
echo "=== Phase 4 Complete ==="
|
||||
echo "Integration contracts deployed"
|
||||
echo "⚠️ Remember to update .env with all contract addresses"
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
|
||||
set -e
|
||||
|
||||
echo "=== Phase 5: Initialize System ==="
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
source "$PROJECT_ROOT/scripts/load-env.sh" >/dev/null 2>&1 || true
|
||||
|
||||
# Load environment variables
|
||||
if [ -f .env ]; then
|
||||
export $(cat .env | grep -v '^#' | grep -v '^$' | xargs)
|
||||
fi
|
||||
echo "=== Phase 5: Initialize System ==="
|
||||
|
||||
# Check required variables
|
||||
REQUIRED_VARS=(
|
||||
@@ -39,4 +39,3 @@ forge script script/bridge/trustless/InitializeBridgeSystem.s.sol:InitializeBrid
|
||||
echo ""
|
||||
echo "=== Phase 5 Complete ==="
|
||||
echo "System initialized and configured"
|
||||
|
||||
|
||||
@@ -3,7 +3,11 @@
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")/../.."
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
source "$SCRIPT_DIR/../lib/init.sh"
|
||||
source "$PROJECT_ROOT/scripts/load-env.sh" >/dev/null 2>&1 || true
|
||||
|
||||
echo "=== Mainnet Deployment Prioritization ==="
|
||||
|
||||
@@ -32,8 +36,8 @@ declare -A CONTRACT_DEPS=(
|
||||
# Contract deployment scripts
|
||||
declare -A CONTRACT_SCRIPTS=(
|
||||
["CCIPLogger"]="npx hardhat run scripts/ccip-deployment/deploy-ccip-logger.js --network mainnet"
|
||||
["CCIPWETH9Bridge"]="forge script script/DeployCCIPWETH9Bridge.s.sol --rpc-url \$ETHEREUM_MAINNET_RPC --broadcast --private-key \$PRIVATE_KEY"
|
||||
["CCIPWETH10Bridge"]="forge script script/DeployCCIPWETH10Bridge.s.sol --rpc-url \$ETHEREUM_MAINNET_RPC --broadcast --private-key \$PRIVATE_KEY"
|
||||
["CCIPWETH9Bridge"]="bash scripts/forge/scope.sh script ccip script/DeployCCIPWETH9Bridge.s.sol:DeployCCIPWETH9Bridge --rpc-url \$ETHEREUM_MAINNET_RPC --broadcast --private-key \$PRIVATE_KEY"
|
||||
["CCIPWETH10Bridge"]="bash scripts/forge/scope.sh script ccip script/DeployCCIPWETH10Bridge.s.sol:DeployCCIPWETH10Bridge --rpc-url \$ETHEREUM_MAINNET_RPC --broadcast --private-key \$PRIVATE_KEY"
|
||||
)
|
||||
|
||||
log_info "Wallet Balance: $WALLET_BALANCE ETH"
|
||||
|
||||
@@ -58,5 +58,6 @@ fi
|
||||
log_success "✅ Chain-138 environment setup complete"
|
||||
echo "Next steps:"
|
||||
echo " 1. Verify RPC connectivity: ./scripts/deployment/verify-chain138-full-deployment.sh"
|
||||
echo " 2. Deploy CCIPTxReporter: npm run deploy:reporter:chain138"
|
||||
echo " 2. If you use the historical CCIPTxReporter flow, set CHAIN138_CCIP_REPORTER in .env"
|
||||
echo " Source archive: archive/solidity/contracts/ccip-integration/CCIPTxReporter.sol"
|
||||
echo " 3. Run verification: ./scripts/deployment/verify-chain138-complete.sh"
|
||||
|
||||
140
scripts/forge/report-contract-reachability.py
Executable file
140
scripts/forge/report-contract-reachability.py
Executable file
@@ -0,0 +1,140 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Report Solidity contracts that are not reachable from current tests or scripts."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
from collections import Counter
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
EXCLUDED_PARTS = {"artifacts", "broadcast", "cache", "lib", "node_modules", "out"}
|
||||
IMPORT_RE = re.compile(r'^\s*import\s+(?:\{[^}]+\}\s+from\s+)?["\']([^"\']+)["\'];', re.M)
|
||||
|
||||
|
||||
def discover_sources(repo_root: Path) -> dict[str, Path]:
|
||||
return {
|
||||
path.relative_to(repo_root).as_posix(): path
|
||||
for path in repo_root.rglob("*.sol")
|
||||
if path.is_file() and not any(part in EXCLUDED_PARTS for part in path.parts)
|
||||
}
|
||||
|
||||
|
||||
def resolve_import(importer: Path, import_path: str, repo_root: Path) -> str | None:
|
||||
if import_path.startswith(("./", "../")):
|
||||
target = (importer.parent / import_path).resolve()
|
||||
try:
|
||||
return target.relative_to(repo_root).as_posix()
|
||||
except ValueError:
|
||||
return None
|
||||
|
||||
if import_path.startswith("@emoney/"):
|
||||
return f"contracts/emoney/{import_path[len('@emoney/'):]}"
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def build_graph(repo_root: Path, files: dict[str, Path]) -> tuple[dict[str, list[str]], dict[str, set[str]]]:
|
||||
imports: dict[str, list[str]] = {}
|
||||
inbound: dict[str, set[str]] = {rel: set() for rel in files}
|
||||
|
||||
for rel_path, file_path in files.items():
|
||||
text = file_path.read_text(errors="ignore")
|
||||
resolved_targets: list[str] = []
|
||||
for import_path in IMPORT_RE.findall(text):
|
||||
target = resolve_import(file_path, import_path, repo_root)
|
||||
if target and target in files:
|
||||
resolved_targets.append(target)
|
||||
inbound[target].add(rel_path)
|
||||
imports[rel_path] = resolved_targets
|
||||
|
||||
return imports, inbound
|
||||
|
||||
|
||||
def walk_reachable(imports: dict[str, list[str]], roots: list[str]) -> set[str]:
|
||||
seen: set[str] = set()
|
||||
stack = list(roots)
|
||||
while stack:
|
||||
current = stack.pop()
|
||||
if current in seen:
|
||||
continue
|
||||
seen.add(current)
|
||||
stack.extend(imports.get(current, []))
|
||||
return seen
|
||||
|
||||
|
||||
def create_report(repo_root: Path) -> dict[str, object]:
|
||||
files = discover_sources(repo_root)
|
||||
imports, inbound = build_graph(repo_root, files)
|
||||
|
||||
contract_files = sorted(rel for rel in files if rel.startswith("contracts/"))
|
||||
root_files = sorted(rel for rel in files if rel.startswith(("test/", "script/")))
|
||||
reachable = walk_reachable(imports, root_files)
|
||||
|
||||
unreachable = [rel for rel in contract_files if rel not in reachable]
|
||||
no_inbound = [rel for rel in contract_files if not inbound[rel]]
|
||||
|
||||
unreachable_by_bucket = Counter(path.split("/")[1] for path in unreachable)
|
||||
no_inbound_by_bucket = Counter(path.split("/")[1] for path in no_inbound)
|
||||
|
||||
return {
|
||||
"repoRoot": repo_root.as_posix(),
|
||||
"summary": {
|
||||
"contractsTotal": len(contract_files),
|
||||
"rootsTotal": len(root_files),
|
||||
"contractsReachableFromTestsOrScripts": len(contract_files) - len(unreachable),
|
||||
"contractsUnreachableFromTestsOrScripts": len(unreachable),
|
||||
"contractsWithNoLocalInboundRefs": len(no_inbound),
|
||||
},
|
||||
"unreachableByBucket": dict(unreachable_by_bucket.most_common()),
|
||||
"noInboundByBucket": dict(no_inbound_by_bucket.most_common()),
|
||||
"unreachableContracts": unreachable,
|
||||
"contractsWithNoLocalInboundRefs": no_inbound,
|
||||
}
|
||||
|
||||
|
||||
def print_text(report: dict[str, object]) -> None:
|
||||
summary = report["summary"]
|
||||
print(f"repo root: {report['repoRoot']}")
|
||||
print(f"contracts total: {summary['contractsTotal']}")
|
||||
print(f"tests/scripts roots total: {summary['rootsTotal']}")
|
||||
print(f"contracts reachable from tests or scripts: {summary['contractsReachableFromTestsOrScripts']}")
|
||||
print(f"contracts unreachable from tests or scripts: {summary['contractsUnreachableFromTestsOrScripts']}")
|
||||
print(f"contracts with no local inbound refs: {summary['contractsWithNoLocalInboundRefs']}")
|
||||
print()
|
||||
print("Unreachable by top-level bucket:")
|
||||
for bucket, count in report["unreachableByBucket"].items():
|
||||
print(f" {bucket}: {count}")
|
||||
print()
|
||||
print("Archive candidates (unreachable from current tests/scripts):")
|
||||
for contract in report["unreachableContracts"]:
|
||||
print(f" {contract}")
|
||||
print()
|
||||
print("Note: unreachable does not prove safe deletion; it only means this repo's current Solidity tests/scripts do not import the file.")
|
||||
|
||||
|
||||
def parse_args(argv: list[str]) -> argparse.Namespace:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--json", action="store_true", help="emit machine-readable JSON")
|
||||
return parser.parse_args(argv)
|
||||
|
||||
|
||||
def main(argv: list[str]) -> int:
|
||||
args = parse_args(argv)
|
||||
repo_root = Path(__file__).resolve().parents[2]
|
||||
report = create_report(repo_root)
|
||||
|
||||
if args.json:
|
||||
json.dump(report, sys.stdout, indent=2)
|
||||
sys.stdout.write("\n")
|
||||
return 0
|
||||
|
||||
print_text(report)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main(sys.argv[1:]))
|
||||
324
scripts/forge/scope.sh
Executable file
324
scripts/forge/scope.sh
Executable file
@@ -0,0 +1,324 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
REPO_ROOT=$(cd "$SCRIPT_DIR/../.." && pwd)
|
||||
|
||||
declare -A ROOT_SCRIPT_SCOPE_ALIASES=(
|
||||
["DeployAddressMapper.s.sol"]="utils"
|
||||
["DeployAddressMapperOtherChain.s.sol"]="utils"
|
||||
["DeployCCIPRouter.s.sol"]="ccip"
|
||||
["DeployCCIPSender.s.sol"]="ccip"
|
||||
["DeployCCIPSenderMainnet.s.sol"]="ccip"
|
||||
["DeployCCIPReceiver.s.sol"]="ccip"
|
||||
["DeployCCIPReceiverMainnet.s.sol"]="ccip"
|
||||
["DeployCCIPRelay.s.sol"]="relay"
|
||||
["DeployCCIPWETH9Bridge.s.sol"]="ccip"
|
||||
["DeployCCIPWETH10Bridge.s.sol"]="ccip"
|
||||
["DeployComplianceRegistry.s.sol"]="compliance"
|
||||
["DeployCompliantUSDC.s.sol"]="tokens"
|
||||
["DeployCompliantUSDT.s.sol"]="tokens"
|
||||
["DeployCWAssetReserveVerifier.s.sol"]="bridge/integration"
|
||||
["DeployCWReserveVerifier.s.sol"]="bridge/integration"
|
||||
["DeployFeeCollector.s.sol"]="utils"
|
||||
["DeployGenericStateChannelManager.s.sol"]="channels"
|
||||
["DeployMainnetTether.s.sol"]="tether"
|
||||
["DeployMirrorManager.s.sol"]="mirror"
|
||||
["DeployMulticall.s.sol"]="utils"
|
||||
["DeployMultiSig.s.sol"]="governance"
|
||||
["DeployOfficialUSDC138.s.sol"]="tokens"
|
||||
["DeployOfficialUSDT138.s.sol"]="tokens"
|
||||
["DeployOracle.s.sol"]="oracle"
|
||||
["DeployPaymentChannelManager.s.sol"]="channels"
|
||||
["DeployTokenRegistry.s.sol"]="utils"
|
||||
["DeployTransactionMirror.s.sol"]="mirror"
|
||||
["DeployWETH.s.sol"]="tokens"
|
||||
["DeployWETH10.s.sol"]="tokens"
|
||||
["DeployWETHWithCCIP.s.sol"]="full"
|
||||
)
|
||||
|
||||
usage() {
|
||||
cat <<'EOF'
|
||||
Usage:
|
||||
bash scripts/forge/scope.sh list
|
||||
bash scripts/forge/scope.sh build [scope] [forge build args...]
|
||||
bash scripts/forge/scope.sh test [scope] [forge test args...]
|
||||
bash scripts/forge/scope.sh script [scope] <script-target> [forge script args...]
|
||||
bash scripts/forge/scope.sh orphans [--json]
|
||||
|
||||
Examples:
|
||||
bash scripts/forge/scope.sh build treasury
|
||||
bash scripts/forge/scope.sh test flash --match-path 'test/flash/*.t.sol'
|
||||
bash scripts/forge/scope.sh script bridge/trustless script/bridge/trustless/DeployTrustlessBridge.s.sol:DeployTrustlessBridge --rpc-url "$RPC_URL_138"
|
||||
FORGE_SCOPE=vault bash scripts/forge/scope.sh test --match-path 'test/vault/*.t.sol'
|
||||
|
||||
Notes:
|
||||
- Omit [scope] to use FORGE_SCOPE, otherwise default to 'full'.
|
||||
- 'full' preserves the historical repo-wide Forge behavior.
|
||||
- Any other scope is resolved relative to contracts/, for example:
|
||||
treasury -> contracts/treasury
|
||||
bridge/trustless -> contracts/bridge/trustless
|
||||
- If no explicit scope is given, the runner tries to infer one from
|
||||
script/test/build paths and common root-level deployment script names.
|
||||
EOF
|
||||
}
|
||||
|
||||
die() {
|
||||
echo "error: $*" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
info() {
|
||||
echo "$*" >&2
|
||||
}
|
||||
|
||||
resolve_scope() {
|
||||
local raw="${1:-${FORGE_SCOPE:-full}}"
|
||||
raw="${raw#contracts/}"
|
||||
raw="${raw#/}"
|
||||
if [[ -z "$raw" ]]; then
|
||||
raw="full"
|
||||
fi
|
||||
printf '%s\n' "$raw"
|
||||
}
|
||||
|
||||
scope_label() {
|
||||
printf '%s\n' "${1//\//-}"
|
||||
}
|
||||
|
||||
scope_exists() {
|
||||
local scope="$1"
|
||||
[[ "$scope" == "full" || -d "$REPO_ROOT/contracts/$scope" ]]
|
||||
}
|
||||
|
||||
infer_scope_from_script_alias() {
|
||||
local raw="${1%%:*}"
|
||||
local base
|
||||
base=$(basename "$raw")
|
||||
if [[ -n "${ROOT_SCRIPT_SCOPE_ALIASES[$base]:-}" ]]; then
|
||||
printf '%s\n' "${ROOT_SCRIPT_SCOPE_ALIASES[$base]}"
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
infer_scope_from_script_imports() {
|
||||
local raw="${1%%:*}"
|
||||
local script_path="$REPO_ROOT/${raw#./}"
|
||||
[[ -f "$script_path" ]] || return 1
|
||||
|
||||
python3 - "$REPO_ROOT" "$script_path" <<'PY'
|
||||
from pathlib import Path
|
||||
import re
|
||||
import sys
|
||||
|
||||
repo_root = Path(sys.argv[1]).resolve()
|
||||
script_path = Path(sys.argv[2]).resolve()
|
||||
text = script_path.read_text(errors="ignore")
|
||||
imports = re.findall(r'^\s*import\s+(?:\{[^}]+\}\s+from\s+)?["\']([^"\']+)["\'];', text, re.M)
|
||||
|
||||
for imp in imports:
|
||||
if not imp.startswith(("./", "../")):
|
||||
continue
|
||||
candidate = (script_path.parent / imp).resolve()
|
||||
try:
|
||||
rel = candidate.relative_to(repo_root).as_posix()
|
||||
except ValueError:
|
||||
continue
|
||||
if not rel.startswith("contracts/"):
|
||||
continue
|
||||
scope = rel[len("contracts/"):]
|
||||
if candidate.is_file():
|
||||
scope = str(Path(scope).parent).replace("\\", "/")
|
||||
scope = scope.strip(".")
|
||||
while scope:
|
||||
if (repo_root / "contracts" / scope).is_dir():
|
||||
print(scope)
|
||||
raise SystemExit(0)
|
||||
scope = scope.rsplit("/", 1)[0] if "/" in scope else ""
|
||||
|
||||
raise SystemExit(1)
|
||||
PY
|
||||
}
|
||||
|
||||
extract_scope_from_path() {
|
||||
local raw="${1%%:*}"
|
||||
raw="${raw#./}"
|
||||
|
||||
case "$raw" in
|
||||
contracts/*)
|
||||
raw="${raw#contracts/}"
|
||||
;;
|
||||
test/*)
|
||||
raw="${raw#test/}"
|
||||
;;
|
||||
script/*)
|
||||
raw="${raw#script/}"
|
||||
;;
|
||||
*)
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
local candidate
|
||||
for candidate in "$raw" "${raw#deploy/}"; do
|
||||
[[ -n "$candidate" ]] || continue
|
||||
|
||||
if [[ -d "$REPO_ROOT/contracts/$candidate" ]]; then
|
||||
printf '%s\n' "$candidate"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local probe="${candidate%/*}"
|
||||
if [[ "$probe" != "$candidate" ]]; then
|
||||
while [[ -n "$probe" ]]; do
|
||||
if [[ -d "$REPO_ROOT/contracts/$probe" ]]; then
|
||||
printf '%s\n' "$probe"
|
||||
return 0
|
||||
fi
|
||||
if [[ "$probe" != *"/"* ]]; then
|
||||
break
|
||||
fi
|
||||
probe="${probe%/*}"
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ "$1" == script/* ]]; then
|
||||
infer_scope_from_script_alias "$1" && return 0
|
||||
infer_scope_from_script_imports "$1" && return 0
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
infer_scope_from_args() {
|
||||
local arg inferred
|
||||
for arg in "$@"; do
|
||||
inferred=$(extract_scope_from_path "$arg" || true)
|
||||
if [[ -n "$inferred" ]]; then
|
||||
printf '%s\n' "$inferred"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
list_scopes() {
|
||||
(
|
||||
cd "$REPO_ROOT"
|
||||
echo "full"
|
||||
find contracts -mindepth 1 -maxdepth 2 -type d | sed 's#^contracts/##' | sort
|
||||
)
|
||||
}
|
||||
|
||||
prepare_scope_env() {
|
||||
local scope="$1"
|
||||
local command="$2"
|
||||
|
||||
if [[ "$scope" == "full" ]]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
local src_dir="contracts/$scope"
|
||||
[[ -d "$REPO_ROOT/$src_dir" ]] || die "unknown scope '$scope' (expected directory '$src_dir')"
|
||||
|
||||
local label
|
||||
label=$(scope_label "$scope")
|
||||
|
||||
export FOUNDRY_SRC="$src_dir"
|
||||
export FOUNDRY_OUT="out/scopes/$label"
|
||||
export FOUNDRY_CACHE_PATH="cache/scopes/$label"
|
||||
export FOUNDRY_SPARSE_MODE="${FOUNDRY_SPARSE_MODE:-true}"
|
||||
|
||||
if [[ "$command" == "test" ]]; then
|
||||
local test_dir="test/$scope"
|
||||
if [[ -d "$REPO_ROOT/$test_dir" ]]; then
|
||||
export FOUNDRY_TEST="$test_dir"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$command" == "script" ]]; then
|
||||
local script_dir="script/$scope"
|
||||
if [[ -d "$REPO_ROOT/$script_dir" ]]; then
|
||||
export FOUNDRY_SCRIPT="$script_dir"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
cd "$REPO_ROOT"
|
||||
|
||||
local command="${1:-}"
|
||||
[[ -n "$command" ]] || {
|
||||
usage
|
||||
exit 1
|
||||
}
|
||||
shift || true
|
||||
|
||||
case "$command" in
|
||||
help|-h|--help)
|
||||
usage
|
||||
;;
|
||||
list)
|
||||
list_scopes
|
||||
;;
|
||||
orphans)
|
||||
exec python3 scripts/forge/report-contract-reachability.py "$@"
|
||||
;;
|
||||
build|test|script)
|
||||
local scope=""
|
||||
if [[ $# -gt 0 && "$1" != --* ]]; then
|
||||
local maybe_scope
|
||||
maybe_scope=$(resolve_scope "$1")
|
||||
if scope_exists "$maybe_scope"; then
|
||||
scope="$maybe_scope"
|
||||
shift
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -z "$scope" ]]; then
|
||||
if [[ -n "${FORGE_SCOPE:-}" ]]; then
|
||||
scope=$(resolve_scope)
|
||||
else
|
||||
scope=$(infer_scope_from_args "$@" || printf 'full\n')
|
||||
fi
|
||||
fi
|
||||
|
||||
prepare_scope_env "$scope" "$command"
|
||||
|
||||
if [[ "$scope" == "full" ]]; then
|
||||
info "Forge scope: full repo"
|
||||
else
|
||||
info "Forge scope: $scope"
|
||||
info " src=$FOUNDRY_SRC out=$FOUNDRY_OUT cache=$FOUNDRY_CACHE_PATH"
|
||||
[[ -n "${FOUNDRY_TEST:-}" ]] && info " test=$FOUNDRY_TEST"
|
||||
[[ -n "${FOUNDRY_SCRIPT:-}" ]] && info " script=$FOUNDRY_SCRIPT"
|
||||
fi
|
||||
|
||||
case "$command" in
|
||||
build)
|
||||
if [[ "$scope" == "full" ]]; then
|
||||
exec forge build "$@"
|
||||
fi
|
||||
exec forge build --skip test --skip script "$@"
|
||||
;;
|
||||
test)
|
||||
if [[ "$scope" != "full" && -z "${FOUNDRY_TEST:-}" ]]; then
|
||||
die "scope '$scope' has no matching test/<scope> directory"
|
||||
fi
|
||||
exec forge test "$@"
|
||||
;;
|
||||
script)
|
||||
[[ $# -gt 0 ]] || die "script command requires a script target, e.g. script/treasury/DeployTreasuryExecutor138.s.sol:DeployTreasuryExecutor138"
|
||||
exec forge script "$@"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
die "unknown command '$command'"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -9,7 +9,8 @@
|
||||
# So: use repo-root .env by default; set ENV_FILE to use a different file.
|
||||
|
||||
_LIB_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
[[ -z "${PROJECT_ROOT:-}" ]] && PROJECT_ROOT="$(cd "$_LIB_DIR/../.." && pwd)"
|
||||
[[ -z "${PROJECT_ROOT:-}" ]] && PROJECT_ROOT="$(cd "$_LIB_DIR/../../.." && pwd)"
|
||||
source "$_LIB_DIR/../forge-scope.sh"
|
||||
|
||||
# Preferred .env: ENV_FILE if set and readable; else PROJECT_ROOT/.env (repo root).
|
||||
load_deployment_env() {
|
||||
|
||||
45
scripts/lib/forge-scope.sh
Normal file
45
scripts/lib/forge-scope.sh
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ -n "${FORGE_SCOPE_HELPER_LOADED:-}" ]]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
FORGE_SCOPE_HELPER_LOADED=1
|
||||
|
||||
forge_scope_repo_root() {
|
||||
local helper_dir
|
||||
helper_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
if [[ -n "${PROJECT_ROOT:-}" ]]; then
|
||||
printf '%s\n' "$PROJECT_ROOT"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ -n "${REPO_ROOT:-}" ]]; then
|
||||
printf '%s\n' "$REPO_ROOT"
|
||||
return 0
|
||||
fi
|
||||
|
||||
printf '%s\n' "$(cd "$helper_dir/../.." && pwd)"
|
||||
}
|
||||
|
||||
forge_scoped() {
|
||||
local root
|
||||
root="$(forge_scope_repo_root)"
|
||||
bash "$root/scripts/forge/scope.sh" "$@"
|
||||
}
|
||||
|
||||
forge() {
|
||||
if [[ $# -gt 0 ]]; then
|
||||
case "$1" in
|
||||
build|test|script)
|
||||
local subcommand="$1"
|
||||
shift
|
||||
forge_scoped "$subcommand" "$@"
|
||||
return $?
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
command forge "$@"
|
||||
}
|
||||
@@ -31,9 +31,9 @@ source "${LIB_DIR}/common/error-handling.sh" 2>/dev/null || true
|
||||
source "${LIB_DIR}/config/env.sh"
|
||||
source "${LIB_DIR}/config/regions.sh"
|
||||
source "${LIB_DIR}/azure/cli.sh" 2>/dev/null || true
|
||||
source "${LIB_DIR}/forge-scope.sh"
|
||||
|
||||
# Log that libraries are loaded (only in debug mode)
|
||||
# Use default 1 if LOG_LEVEL is unset or not numeric (e.g. from .env)
|
||||
_ll="${LOG_LEVEL:-1}"
|
||||
[[ "$_ll" =~ ^[0-9]+$ ]] && [ "$_ll" -le 0 ] && log_debug "Common libraries loaded from ${LIB_DIR}" || true
|
||||
|
||||
|
||||
@@ -16,8 +16,7 @@ set -euo pipefail
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
|
||||
[[ -f .env ]] && set -a && source .env && set +a
|
||||
source "$PROJECT_ROOT/scripts/load-env.sh" >/dev/null 2>&1 || true
|
||||
|
||||
RPC="${RPC_URL_138:-${RPC_URL:-http://192.168.11.211:8545}}"
|
||||
CUSDT="${COMPLIANT_USDT:-0x93E66202A11B1772E55407B32B44e5Cd8eda7f22}"
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
# Quick compilation test for TokenFactory138
|
||||
|
||||
cd /home/intlc/projects/proxmox/smom-dbis-138
|
||||
source scripts/lib/forge-scope.sh
|
||||
|
||||
echo "Testing TokenFactory138 compilation..."
|
||||
|
||||
@@ -29,4 +30,3 @@ else
|
||||
forge build --via-ir 2>&1 | grep -i "error" | head -10
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -4,6 +4,11 @@
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
source "$PROJECT_ROOT/scripts/load-env.sh" >/dev/null 2>&1 || true
|
||||
|
||||
# Load environment variables
|
||||
if [ -f .env ]; then
|
||||
source .env
|
||||
@@ -106,4 +111,3 @@ main() {
|
||||
|
||||
# Run main function
|
||||
main
|
||||
|
||||
|
||||
@@ -4,6 +4,11 @@
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
source "$PROJECT_ROOT/scripts/load-env.sh" >/dev/null 2>&1 || true
|
||||
|
||||
echo "=== Complete Reserve System Setup ==="
|
||||
echo ""
|
||||
|
||||
@@ -28,4 +33,3 @@ forge script script/reserve/ConfigureInitialReserves.s.sol:ConfigureInitialReser
|
||||
echo ""
|
||||
echo "=== Setup Complete ==="
|
||||
echo "Reserve System is now ready for operations"
|
||||
|
||||
|
||||
@@ -5,9 +5,10 @@ set -e
|
||||
PROJECT_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
export FOUNDRY_PROFILE=default
|
||||
FORGE_SCOPE="${FORGE_SCOPE:-full}"
|
||||
|
||||
echo "=== 1. Compile ==="
|
||||
forge build
|
||||
bash scripts/forge/scope.sh build "$FORGE_SCOPE"
|
||||
echo "✅ Build OK"
|
||||
|
||||
echo ""
|
||||
@@ -17,7 +18,7 @@ echo "✅ Lint done"
|
||||
|
||||
echo ""
|
||||
echo "=== 3. Test ==="
|
||||
forge test 2>&1 | tail -50
|
||||
bash scripts/forge/scope.sh test "$FORGE_SCOPE" 2>&1 | tail -50
|
||||
echo "✅ Tests done"
|
||||
|
||||
echo ""
|
||||
@@ -25,9 +26,9 @@ echo "=== 4. Deploy ==="
|
||||
if [[ "${1:-}" == "--deploy-live" ]]; then
|
||||
echo "Live deploy: run your preferred deploy script, e.g.:"
|
||||
echo " bash scripts/deployment/deploy-tokens-and-weth-all-chains-skip-canonical.sh"
|
||||
echo " or: forge script script/deploy/DeployCWTokens.s.sol:DeployCWTokens --rpc-url \$RPC_URL --chain-id 138 --broadcast --private-key \$PRIVATE_KEY --legacy"
|
||||
echo " or: bash scripts/forge/scope.sh script script/deploy/DeployCWTokens.s.sol:DeployCWTokens --rpc-url \$RPC_URL --chain-id 138 --broadcast --private-key \$PRIVATE_KEY --legacy"
|
||||
exit 0
|
||||
fi
|
||||
echo "Dry-run: DeployCWTokens (simulation only)"
|
||||
forge script script/deploy/DeployCWTokens.s.sol:DeployCWTokens --rpc-url "https://eth.llamarpc.com" --chain-id 1 2>&1 | tail -30
|
||||
bash scripts/forge/scope.sh script script/deploy/DeployCWTokens.s.sol:DeployCWTokens --rpc-url "https://eth.llamarpc.com" --chain-id 1 2>&1 | tail -30
|
||||
echo "✅ Deploy dry-run done (no broadcast)"
|
||||
|
||||
@@ -33,7 +33,7 @@ CONTRACTS=(
|
||||
"contracts/governance/GovernanceController.sol"
|
||||
"contracts/liquidity/LiquidityManager.sol"
|
||||
"contracts/bridge/BridgeOrchestrator.sol"
|
||||
"contracts/plugins/PluginRegistry.sol"
|
||||
"contracts/ccip/CCIPRouter.sol"
|
||||
)
|
||||
|
||||
for contract in "${CONTRACTS[@]}"; do
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
set -e
|
||||
|
||||
cd /home/intlc/projects/proxmox/smom-dbis-138
|
||||
source scripts/lib/forge-scope.sh
|
||||
|
||||
echo "=========================================="
|
||||
echo "TokenFactory138 Compilation Test"
|
||||
@@ -109,4 +110,3 @@ else
|
||||
echo " Review logs: /tmp/tokenfactory-compile-*.log"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.20;
|
||||
|
||||
import {Script, console} from "forge-std/Script.sol";
|
||||
import {TokenRegistry} from "../../contracts/tokenization/TokenRegistry.sol";
|
||||
|
||||
contract DeployTokenRegistry is Script {
|
||||
function run() external returns (address registry) {
|
||||
address admin = vm.envAddress("ADMIN_ADDRESS");
|
||||
|
||||
vm.startBroadcast();
|
||||
registry = address(new TokenRegistry(admin));
|
||||
vm.stopBroadcast();
|
||||
|
||||
console.log("TokenRegistry deployed at:", registry);
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.20;
|
||||
|
||||
import {Script, console} from "forge-std/Script.sol";
|
||||
import {TokenizedEUR} from "../../contracts/tokenization/TokenizedEUR.sol";
|
||||
|
||||
contract DeployTokenizedEUR is Script {
|
||||
function run() external returns (address tokenizedEUR) {
|
||||
address admin = vm.envAddress("ADMIN_ADDRESS");
|
||||
|
||||
vm.startBroadcast();
|
||||
tokenizedEUR = address(new TokenizedEUR(admin));
|
||||
vm.stopBroadcast();
|
||||
|
||||
console.log("TokenizedEUR deployed at:", tokenizedEUR);
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.20;
|
||||
|
||||
import {Script, console} from "forge-std/Script.sol";
|
||||
import {TokenRegistry} from "../../contracts/tokenization/TokenRegistry.sol";
|
||||
|
||||
contract RegisterToken is Script {
|
||||
function run(
|
||||
address registryAddress,
|
||||
address tokenAddress,
|
||||
string memory tokenId,
|
||||
string memory underlyingAsset,
|
||||
address issuer,
|
||||
string memory backingReserve
|
||||
) external {
|
||||
TokenRegistry registry = TokenRegistry(registryAddress);
|
||||
|
||||
vm.startBroadcast();
|
||||
registry.registerToken(
|
||||
tokenAddress,
|
||||
tokenId,
|
||||
underlyingAsset,
|
||||
issuer,
|
||||
backingReserve
|
||||
);
|
||||
vm.stopBroadcast();
|
||||
|
||||
console.log("Token registered:", tokenId);
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
|
||||
source .env 2>/dev/null || true
|
||||
source "$PROJECT_ROOT/scripts/load-env.sh" >/dev/null 2>&1 || true
|
||||
|
||||
GENESIS_ADDRESS="${1:-}"
|
||||
|
||||
@@ -26,7 +26,7 @@ ADDRESS_MAPPER="${ADDRESS_MAPPER:-}"
|
||||
|
||||
if [ -z "$ADDRESS_MAPPER" ]; then
|
||||
echo "⚠️ ADDRESS_MAPPER not set in .env"
|
||||
echo " Deploy AddressMapper first: forge script script/DeployAddressMapper.s.sol"
|
||||
echo " Deploy AddressMapper first: bash scripts/forge/scope.sh script utils script/DeployAddressMapper.s.sol:DeployAddressMapper"
|
||||
echo ""
|
||||
echo "📋 Using static mapping from config/address-mapping.json..."
|
||||
|
||||
@@ -62,4 +62,3 @@ else
|
||||
--rpc-url "${RPC_URL:-http://localhost:8545}" 2>/dev/null | \
|
||||
grep -oE "0x[a-fA-F0-9]{40}" | head -1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user